for your eyes only
Knowledge Hurts – a blog of thoughts, things and stuff.

Nov
16

Debugging ns2 is easy (or should be):

  1. go to ns-?.?? directory
  2. run ./configure –enable-debug
  3. make clean
  4. make

BUT here comes the big BUT:

for the –enable-debug option the compiler flag -WError is passed to gcc and will make it throw errors instead of warnings in many cases – for the (sometimes not too well written) Mannasim code, this is deadly: It won’t compile due to formalities.

If you get errors when compiling ns with Mannasim in order to debug: Edit the configure script and change the part where -WError is passed. It will compile like a charm (if you don’t run into compiler bugs).

You might want to pass arguments to the executable that you want to debug.

you can do this without problems:

gdb [gdbarguments] -args yourexecutable yourarguments

By calling a gdb-script, you can run the executable automatically and also quit gdb if everything went fine.

Create such a batch file by running

echo "run" > run.script

and execute it like this:

gdb [gdbarguments] -x run.script -args yourexecutable yourarguments

And all of a sudden you have the possibility to call gdb inside of scripts without having to type run all over again. Practical, huh?

Read on! Knowledge hurts.

Nov
11

Jim Lindeman submitted to Benjie Chen code of his SPAN implementation for ns-2. It has been available since 2005 here: http://pdos.csail.mit.edu/~benjie/span/span_ns.html

I updated it to run with gcc 4.x and made it into a patch file in order to apply it in an easy way. It is available at http://www.box.net/shared/esc71ny5ns .

How to apply:

Download the ns-2.28-allinone distribution,  http://www.box.net/shared/ottfdyaz60 (patch for configure scripts in ns-2.28) and http://www.box.net/shared/esc71ny5ns (patch that inserts SPAN into a fresh ns-2.28-allinone), then unzip all files.

cd ns-allinone-2.28
patch -p1 < ns2.28-gcc4-configure-scripts.patch
patch -p1 < ns2.28-span-gcc4.patch
./install

Have fun with the SPAN protocol on NS-2, THE Network Simulator.

Read on! Knowledge hurts.

Nov
11

HP sucks terribly!!! Yesterday, I completely took apart an HP dv2000 laptop. If you think taking apart laptops is fun, don’t read on. If you think, it’s risky business and a lot of damn fucking work, you might wonder: Why did I take it apart?

I had turned it on – it didn’t post. No beeps, but no BIOS screen. Nothing.

Of course I looked the problem up. There are MILLIONS of people out there complaining about defunct DV2000 and DV6000 laptops – all this due to a manufacturing problem at Nvidia.

I complained to HP. They called me and said that they were sorry to hear that the service fee of over 400 € for replacing the motherboard didn’t suit me and suggested going to an independent repair service. I was stunned. A problem that lay clearly on their side – just canceled off like that? WTF?

The problem: The BGA soldering of the graphic chip is bad. And the chip keeps heating up and extending and then cooling down and shrinking again all the time. Until some connections break.This is further helped by some bad heat conducting (or so we hope) foam pad of 2mm that is between graphic chip and cooler and lets the chip move almost freely.

I mean, really: I have disliked HP for a long time because of their printing supply business model and I didn’t think much of the quality of their products. But this shocked me. A HP product that goes defunct 5 months after guarantee ends? And HP only providing a BIOS update to make the fan turn faster??? Not using the 200 Million US$ provided by nVidia to help their customers? Where did all that money go??

I still haven’t finished reassembling the laptop. Let’s see what happens. But I am highly disappointed.

Read on! Knowledge hurts.

Nov
02

If ever you should come accross this:

checking system version (for dynamic loading)... ./configure: 1: Syntax error: Unterminated quoted string

or this:

checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... ./configure: 1: Syntax error: Unterminated quoted string

then you should make a replacement in some of the configure scripts

wrong:

system=MP-RAS-`awk ' { print $3 } '/etc/.relid'`

right:

system=MP-RAS-`awk ' { print $3 } '/etc/.relid`

All the steps together:

  1. edit tcl8.4.11/unix/configure
  2. -> autoconf
  3. edit tk8.4.11/unix/configure
  4. -> autoconf
  5. edit otcl-1.11/configure
  6. -> autoconf

A good patch to make ns 2.28 work with gcc 4 and higher is this one: http://www.cs.uc.edu/~cdmc/ucbt/src/ns228-gcc40.patch

I have made a patch that does steps 1-6 by changing directly the configure scripts. It is available here: http://www.box.net/shared/ottfdyaz60

Read on! Knowledge hurts.

Oct
02
If you are user who has significant Linux skills and wants to access your computer behind the college’s NAT with SSH from all around the world, you might try these instructions.On your local machine (behind the NAT), run (where 1024 > port > 65536, preferably something pretty random): ssh -R port:localhost:22 user@minerva

Then, log in to minerva and leave the connection there. You might want to run this in screen or set your terminal not to send the hup signal or whatever. If you’re worried about the connection terminating, you can fix this with a while loop plus ssh-agent OR configure your ssh_config to set TCPKeepAlive to yes.

When you want to connect to your machine from somewhere external, ssh to minerva and run (where localuser is the user on your machine, not minerva): ssh -p port localuser@localhost

And then you’ll be sshed to your machine.

Source: http://ca.simons-rock.edu/ca/wiki/RemoteSSH?version=2

If you are user who has significant Linux skills and wants to access a computer behind the college’s NAT with SSH from a remote host, you might try these instructions.On your local machine (behind the NAT), run (where 1024 > port > 65536, preferably something pretty random): ssh -R port:localhost:22 user@minerva

Then, log in to minerva and leave the connection there. You might want to run this in screen or set your terminal not to send the hup signal or whatever. If you’re worried about the connection terminating, you can fix this with a while loop plus ssh-agent. OR configure your ssh_config to set TCPKeepAlive to yes.

When you want to connect to your machine from somewhere external, ssh to minerva and run (where localuser is the user on your machine, not minerva): ssh -p port localuser@localhost

And then you’ll be sshed to your machine.

http://ca.simons-rock.edu/ca/wiki/RemoteSSH?version=2

Oct
02

A happy hello to all students and engineers out there battling with Network Simulator 2 to get mannasim up and working under Ubuntu 9.04!

It’s not me who had this idea first and so it’s not me who has found the solution all by myself either… Cudos go out to Ravit Sachasiri who posted a manual on the ns-2 Mailing List. I just made a patch out of his solution in order to keep you from manually changing a total of 6 files.

Background: Since gcc-4.3, the way standard C++ libraries are included is strictly following the latest standard. That’s why people get errors because of headers not being included correctly. One example of an error can be seen below:

 [...]
 mannasim/accessPointApp.cc: In member function ‘virtual void  AccessPointApp::forward_data(int, AppData*)’:
 mannasim/accessPointApp.cc:97: error: ‘AppDataList’ was not declared in  this scope
 mannasim/accessPointApp.cc:97: error: expected `;' before ‘list’
 mannasim/dataGenerator.h: At global scope:
 mannasim/dataGenerator.h:65: warning: inline function ‘virtual void  EventTimer::expire(Event*)’ used but never defined
 mannasim/dataGenerator.h:52: warning: inline function ‘virtual void  SensingTimer::expire(Event*)’ used but never defined
 mannasim/sensorBaseApp.h:83: warning: inline function ‘virtual void  DisseminatingTimer::expire(Event*)’ used but never defined
 make: *** [mannasim/accessPointApp.o] Error 1
 Ns make failed!

You can use the following patch to avoid this…

Link to the patch: http://www.box.net/shared/2zmoru8gyu

howto apply the patch:

patch -p0 < ns-mannasim-patch-ns2.29+gcc-4.3.patch

Find out more about this here: http://gcc.gnu.org/gcc-4.3/porting_to.html

Aug
05

If you are looking for a command that gives out a list of all routes set on the PC, you can’t simply type route show on any operating system. For Windows, this should work, but for the rest of the Unix, Linux and BSD machines out there it is an other, quite simple command:

netstat -r

Note to myself: Never forget…again!

Jul
24

Seems like the most active time this blog has lived till today… Well, anyway.
It doesn’t seem like a good idea to set the config of ppp in the ppp.conf file like this

set server /tmp/pppoe-in "pppoe-in" 0177

as this doesn’t have the effect of changing at every call of a ppp session.

It’s this code, that will work for you:

set server /tmp/pppoe-in\%d "" 0177

Now you can call pppctl like this: sudo pppctl -p "" /tmp/pppoe-in0
and you won’t get any more of this ugly stuff:

pppctl: cannot connect to socket /tmp/pppoe-in: Connection refused

Am I happy? Yes I am!

Jul
18

Wiederherstellen kann nicht erfolgreich abgeschlossen werden. Die ausgewählte Sicherungsdatei wurde auf einem anderen mobilen Gerätetyp erstellt. Klicken Sie auf “?”, um weitere Informationen über mögliche Ursachen und Lösungen zu erhalten.

Wer auf diese Fehlermeldung trifft hat eigentlich nichts falsch gemacht. Aber urplötzlich soll das Backupfile nicht mehr zum PDA passen?! Ist die Datei korrupt – oder was ist passiert? Ganz einfach: Man hat nur ein bisschen an den Ländereinstellungen des PDAs rumgepfuscht. Da war man im Urlaub auf den Seychellen und fühlte sich dort so zu Hause dass man das Datum sich auf Landesart hat einzeigen lassen will – und zurück zu Hause geht das Backup nicht mehr – DES RÄTSELS LÖSUNG: Handy und Backup-File müssen die gleiche Sprache haben, sonst ist kein rückspielen möglich.

Danke Microsoft, deshalb hab ich doch glatt noch einen Abend unnötig mit Haareausreißen verbracht!

May
21

Another big problem solved: in Debian unstable, after running set-language-env, I had so many files altered, that it was very hard to return to a configuration where it was ME who chose which language to use and not some creepy config file in the back. My main problem was to chose a language in Gnome and to have different gnome languages for different users. Here is how: You simply chose in the GDM screen when logging in! (That is, if there isn’t any configuration hindering you to do so…if you have a negative result when selecting your language via GDM, read on.)

How to generate locales:

  1. don’t use set-language-env. don’t use locale-gen (it works, but why bother…)
  2. simply go to a root shell and type dpkg-reconfigure locales
  3. select the locales you’d like to use. Select an additional non-UTF8 locale for your standard language, even if you’d like to work in UTF-8 only.
  4. Go through the dialogues – and at the end everything is done for you automatically.

Manual Configuration – Here is where your locale is set:

globally: /etc/environment – this is where your favorite language should go (a language that can be understood by everybody using the machine, that is). For me it reads:

LANG="de_DE.UTF-8"
(yupp, that’s all there is)

for each user: /etc/.bashrc the beginning of this file reads:
LANG=de_DE.UTF8
export LANG

FILES YOU DON’T TO ALTER, BUT WHICH SHOULD NOT HAVE LANGUAGE INFORMATION IN THEM FOR THIS METHOD TO WORK:

  • .xsession (if you don’t have anything other than your language specified in it, delete it. With a standard config, it will not be executed anyway)
  • .profile (if you put your language here, this would be quite effective, but don’t do it – you like clicking and setting it with GDM, don’t you?)

How to select your language after booting up your system – how to change the language of GNOME:

  1. In GDM simply click on language (bottom-left corner) and select a language
  2. type in your username and password and specify if you’d like to change your prefered language or not.

How to verify that everything’s alright:

  1. open a terminal.
  2. typing “locale” should give you the locale selected in .bashrc
  3. open “xterm sh”
  4. typing “locale” should give you the locale selected via GDM.
  5. if not:

What to do if I use KDM?

I honestly don’t know. Select your language via altering .profile (but don’t forget, where you changed it!)