2007-02-22

Sniffing

Need a "sniffer" type device that can be put between two network interfaces transparently. For example when an embedded device is not behaving and you need to monitor traffic between it and a switch (and don't have access to the switch monitoring functions).
Ingredients:

  • Ubuntu
  • A network card
  • Another network card
  • bridge-utils
  • tcpdump

Set the machine up as a bridge:

sudo ifconfig eth0 promisc 0.0.0.0 up
sudo ifconfig eth1 promisc 0.0.0.0 up
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo brctl addif br0 eth1
sudo ip link set br0 up

To watch packets go between eth0 and eth1:

sudo tcpdump -i br0

2007-02-16

Parallels/Macbook and {}[]|\ etc.

From: http://forum.parallels.com/showpost.php?s=4be86dd8ac6ad4b23d937d556aecc920&p=27651&postcount=2

"If you want Right Enter to operate as AltGr key in VM:

1. Stop any running VMs, close all instances of Parallels Desktop for Mac.
2. Launch “Macintosh HD” - “Applications” – “Utilities” – “Terminal”.
3. Type the following commands in Terminal (without quotes), please mind that the system might ask you for the Administrator password after each command – type it and hit Enter:
4. “sudo touch /Library/Parallels/.keyboard_config”
5. “sudo chmod 666 /Library/Parallels/.keyboard_config”
6. “sudo echo "numenterisaltgr" > /Library/Parallels/.keyboard_config”
7. Close the Terminal.
8. Launch Parallels Desktop for Mac and check Right Enter key behavior in VM – everything should work as you’ve set."

2007-02-08

Cygwin, how kewl

It works..!

Installed Cygwin (have been using it for couple of years mainly because of the shell as a superior substitute for Windows cmd.exe but never actually compiled anything) on a new computer, and with it gcc and friends. Opened a shell and did:

$ cat >foo.c
#include <stdio.h>

int main( int argc, char **argv)
{
    printf( "Hello, world!\n");

    return 0;
}
(Ctrl-d)

$ gcc foo.c -o foo.exe -mno-cygwin

$ ./foo.exe
Hello, world!

The -mno-cygwin flag links againts native Windows libs so that there is no need for a Cygwin installation to be present in a computer that the program is being run on. Gdb worked fine too. How sw33t. Next step is to "port" a program that has been developed with Visual Studio.. should work ok I think.