I’m writing a script that needs to know the external IP address of the current machine (ifconfig only gives the local network address)
wget -q -O - http://checkip.dyndns.org | html2text \
| sed s/Current\ IP\ Address\:\ //
What this does is:
- hit http://checkip.dyndns.org, silencing wget’s output and redirecting the downloaded file to stdout
- parse the html page as text
- get rid of the cruft (I was thinking about using a complex regex here, but the IP address prefix seems less of a dependency concern than the actual dyndns service)
For a while I’ve had this weird bug on my Ubuntu laptop where, while using an external keyboard, if I hit any key on the numeric keypad the current X server would reset. Incredibly annoying. What’s worse, is that I never really got around to “fixing” the problem, I just trained my right hand to not stray too far to the right. But of course, accidents happen, and this last time of losing work was the final “home loan that brought down the US economy”.
The problem originates somewhere between XGL and using your numeric keypad to control the pointer (known as Mouse Keys).
If you’re sure you don’t need XGL (check your xorg.conf first!), then simply remove it:
sudo apt-get remove xserver-xgl
And disable your Mouse Keys:
- System -> Preferences -> Keyboard
- Mouse Keys (tab)
- Uncheck “Allow to control the pointer using the keyboard”
Now restart your machine, and VoilĂ