Saturday, April 28, 2012

I was a bit surprised when clang complained about an (legitimate) operator precedence issue, which gcc never pointed out to me. I fixed this by judicious use of parenthesis, and recompiled.

But the generated binary failed to run - I got an "Illegal instruction" error. This error persisted with optimizations turned off (i.e. -O0). I tried running the binary under valgrind and got the following:

I don't grok x86 assembly much, so it took me some googling to find that the combination of pxor and xmm type registers is in fact an SSE instruction. The CPU on this box is an aging 32-bit Mobile AMD Athlon XP, and the CPU flags in /proc/cpuinfo include SSE, so I'm not sure what to make of this.

Saturday, April 21, 2012

I usually leave my computer at home turned on, logged in to the graphical desktop, with a VNC server running, to allow remote access to the desktop with a VNC viewer.

A few days ago, while waiting for code to compile, I logged in to my computer from work, and performed a long overdue package upgrade, which required a reboot to complete. This left me logged out of the desktop, with the GDM3 greeter waiting for someone to log in, but no VNC server to allow remote access to it.

Here's how to run a VNC server and start the desktop, in this situation:

connect to the remote machine with ssh, forwarding the default VNC port (this is the usual way I access my home PC):

# ssh -L 5901:localhost:5900 example.home-computer.com

run the following command as root to detect the path to the X authority file:

Friday, April 13, 2012

Once upon a time I described how to automatically update the rkhunter database after installing/upgrading packages. There's an easier way of achieving this which either did not exist at the time, or I somehow missed. Just add the following line to /etc/default/rkhunter:

APT_AUTOGEN="yes"

My original method is still useful for running any custom script after installing/upgrading packages.