Thread: Re: [ANet-devel] Coding: What You Can Do
Status: Abandoned
Brought to you by:
benad
From: Benoit N. <be...@ma...> - 2001-03-06 13:22:29
|
>afaik, the default ethernet interface on a linux machine is always >"eth0". somebody, please correct me, if i'm wrong. the snippet which >you'd sent a few days back should do very well for this. the snippet >checks for command line args and if there are none, then prints all the >interfaces with their IP addresses and if the interface is specified >(for eg, "eth0"), then it will print the IP address of only eth0. Actually, the default routing interface can be anything you want. For modem users, it is ppp0. I can't assume that the computer is connected to the internet through its ethernet card. Look at the "route" command to see what I mean. Most programs never ask you "what is your default routing interface?. So, I know that there is a way to do it, and it would make our deamon much more user-friendly, instead of "write the interface in the .anet file"... >i am not sure if i got you on the second task. you mean you need an >editor to write to a device? i am not sure what do you mean by "text >device"; if it's serial port, then i suppose minicom kind of tool >should do fine. No. Just something other than "cout" or "printf". From what I know, when you output something, it is to some terminal device, which, in turn, may do fun things like colors, highlighting and so on for displaying text on screen. It's because, usually, scanf is blocking, and you can't call printf until the user press return. So, basically, I'd like to be able to do screen output like vim does on the terminal(with color, bold characters...). - Benad |
From: Quentin S. <que...@co...> - 2001-03-06 15:59:34
|
Hi- There should also be a way to manually set your IP address. Here is some perl code that can find your outside IP if you are behind a firewall. I am behind a firewall, but I can set the firewall to route unidentified packets to my computer, so this is useful. use LWP::Simple; sub getIP() { #www.dyndns.org = 207.127.235.88 as of 7/30/00 #$IPtxt = get("http://207.127.235.88:8245/cgi-bin/check_ip.cgi"); #Now using upsys.be: #upsys.be = 213.61.13.10 as of 8/29/00 $IPtxt = get("http://ubsys.by/dyndns/check_ip.php3"); $IPtxt =~ /Address: ?([0-9.]*)/; $ip = $1; if (wantarray) { $IPtxt =~ /Hostname: ([^\n]*)/; $name = $1; return ($ip, $name); } Please beware of line breaks from email. --Quentin Benoit Nadeau wrote: >> afaik, the default ethernet interface on a linux machine is always >> "eth0". somebody, please correct me, if i'm wrong. the snippet which >> you'd sent a few days back should do very well for this. the snippet >> checks for command line args and if there are none, then prints all the >> interfaces with their IP addresses and if the interface is specified >> (for eg, "eth0"), then it will print the IP address of only eth0. > > > Actually, the default routing interface can be anything you want. > For modem users, it is ppp0. I can't assume that the computer is > connected to the internet through its ethernet card. > Look at the "route" command to see what I mean. > > Most programs never ask you "what is your default routing interface?. > So, I know that there is a way to do it, and it would make our deamon > much more user-friendly, instead of "write the interface in the .anet file"... > >> i am not sure if i got you on the second task. you mean you need an >> editor to write to a device? i am not sure what do you mean by "text >> device"; if it's serial port, then i suppose minicom kind of tool >> should do fine. > > > No. Just something other than "cout" or "printf". From what I know, when > you output something, it is to some terminal device, which, in turn, may do > fun things like colors, highlighting and so on for displaying text on > screen. It's because, usually, scanf is blocking, and you can't call printf > until the user press return. So, basically, I'd like to be able to do > screen output like vim does on the terminal(with color, bold characters...). > > - Benad > > > > _______________________________________________ > ANet-devel mailing list > ANe...@li... > http://lists.sourceforge.net/lists/listinfo/anet-devel > > |
From: Mathieu T. <tr...@ge...> - 2001-03-08 20:19:03
|
dont know if you will find what you are looking for in this... but it might help ;) Mathieu --- Windows Source Code ----------------- ================================================== /* TOP SECRET Microsoft(c) Code Project: Chicago(tm) Projected release-date: MAY 1998 $History$ */ #include "win31.h" #include "win95.h" #include "evenmore.h" #include "oldstuff.h" #include "billrulz.h" #define INSTALL = HARD char make_prog_look_big[160000] ; void main() { while(!CRASHED) { display_copyright_message(); display_bill_rules_message(); do_nothing_loop(); if (first_time_installation) { make_50_megabyte_swapfile(); do_nothing_loop(); totally_screw_up_HPFS_file_system(); search_and_destroy_the_rest_of_OS/2(); hang_system(); } write_something(anything); display_copyright_message(); do_nothing_loop(); do_some_stuff(); if (still_not_crashed) { display_copyright_message(); do_nothing_loop(); basically_run_windows_3.1(); do_nothing_loop(); do_nothing_loop(); } } if (detect_cache()) disable_cache(); if (fast_cpu()) { set_wait_states(lots); set_mouse(speed, very_slow); set_mouse(action, jumpy); set_mouse(reaction, sometimes); } /* printf("Welcome to Windows 3.11"); */ /* printf("Welcome to Windows 95"); */ printf("Welcome to Windows 98"); if (system_ok()) crash(to_dos_prompt); else system_memory = open("a:\ swp0001.swp" O_CREATE); while(something) { sleep(5); get_user_input(); sleep(5); act_on_user_input(); sleep(5); } create_general_protection_fault(); } |