open-source-search-engine/hosts.cpp

41 lines
919 B
C++
Raw Normal View History

2013-08-03 00:12:24 +04:00
#include "gb-include.h"
int main ( int argc , char *argv[] ) {
2014-11-11 01:45:11 +03:00
//for ( int32_t i = 0 ; i < 137 ; i++ )
// printf("66.154.103.%"INT32" gk%"INT32"\n",i+36,136+i);
2013-08-03 00:12:24 +04:00
printf ("# the new hosts.conf format:\n"
"\n"
"# <hostId> <hostname> [portoffset] [# <comment>]\n"
"# spare <hostname> [portoffset] [# <comment>]\n"
"# proxy <hostname> [portoffset] [# <comment>]\n"
"\n"
"# we use /etc/hosts to get the ip of eth0\n"
"# we insert an 'i' into hostname to get ip of eth1\n"
"\n"
"working-dir: /w/\n"
"port-offset: 2\n"
"index-splits: 64\n"
"\n"
);
2014-11-11 01:45:11 +03:00
int32_t gk = 0;
for ( int32_t i = 0 ; i < 256 ; i++ ) {
2013-08-03 00:12:24 +04:00
if ( i && (i%16==0) ) gk += 16;
// wrap to lower rack half at 128
if ( i == 128 ) gk = 16;
2014-11-11 01:45:11 +03:00
printf("%03"INT32"\tgk%"INT32"\n",i,gk);
2013-08-03 00:12:24 +04:00
gk++;
}
2014-11-11 01:45:11 +03:00
for ( int32_t i = 256 ; i < 271 ; i++ )
printf ("spare\tgk%"INT32"\n",i);
2013-08-03 00:12:24 +04:00
printf ("#proxy\tproxy0\n");
printf ("#proxy\tproxy1\n");
return 0;
}