Please don't die!!

Thursday, February 5. 2015

It's too late.. I'm already gone!

Seriously, this is not useful anymore. Please follow me on Twitter instead.

BART cushioned seats

Saturday, March 19. 2011

Interesting use of one of my Flickr photo in a quite disgusting article: 2nd Avenue Sagas: In praise of hard plastic seats.

BART seats

You should go read the article, as it points out why plastic seats are indeed the way to go in subways. I'm wondering if the seats in the AMT trains suffer from the same contamination.


Sunday, February 13. 2011

It's snowing, the river is frozen, time to go snowshoeing:

It's a GPS Christmas

Sunday, December 26. 2010

What happens when you receive a good handheld GPS unit for Christmas and you have to travel a lot to see the family?

Guess what... Google is not up to date about certain streets... And guess what... OpenStreetMap is :)

Dell LCD Display

Friday, June 4. 2010

Dell LCD Display control from shell.


# Max length the LCD can accept. Typically 62

# Read from first argument if present, else take first line of stdin
if [ $# -lt 1 ]; then
	read INPUT
	INPUT=$(echo $INPUT | tr -d [:cntrl:])
	INPUT=$(echo $1 | tr -d [:cntrl:])

# Check if we respected the max length after removing control chars
if [ ${#INPUT} -gt $MAXLENGTH ]; then
	echo "Cannot use more than $MAXLENGTH characters"
	exit 1

# Split by bytes and encode them as hex strings (0xff)
BYTES=$(echo -n $INPUT | od --width=1 -v -t x1 | grep " " |
	awk '{print $2}' | awk '{print "0x"$1}')

# Encode length of string as hex digit also
LENGTH=$(printf "0x%x" ${#INPUT})

# Go through all bytes, grouping them by chunk of 16 bytes
CMD="0x0 0x0 $LENGTH"
for BYTE in $BYTES; do
	# Chunk ready, append it to array and reset counters
	if [ $i -gt 16 ]; then
		CMD=$(printf "0x%x" ${#LINES[*]})

	# Push byte on accumulator
	let i+=1

# Put last chunk into array

# Tell BMC text to print on LCD, chunk by chunk
for i in "${LINES[@]}"; do
	/usr/bin/ipmitool raw 0x6 0x58 0xc1 $i > /dev/null

# Tell BMC to output our User String on LCD
/usr/bin/ipmitool raw 0x6 0x58 0xc2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 > /dev/null

Update VMware tools before reboot

Friday, May 14. 2010

I have searched the web and couldn't think of a simpler way to do this.

When you upgrade your kernel, all modules that were installed by the VMware tools will be missing in the new /lib/modules directory. To reinstall those, you need to reboot first and then re-run the VMware tools. Problems arise if you need the modules prior to the next reboot (ie: if you are doing weird pvscsi on root partition for example).

Out of the box, the VMware tools cannot regenerate modules and initrd for a kernel different than the running one. If you are upgrading the same distribution to a different patch level (RHEL 5 system to a bugfix kernel), chances are that the same modules will work, you just have to install them at the new location.

Tricking the VMware tools software into installing some place else works very well in that case.

This snippet is very RedHat specific, but could be adjusted for any distro. Main points include the uname hack, running a depmod and rebuilding initrd image.

It is important to note that the tools do run depmod, but not specifying a kernel version, hence defaulting to the running kernel.

# Get latest kernel installed
VERSION="$(rpm -qa kernel | sort -r | head -n 1 | sed 's/kernel-//')"

# uname hack (because VMware Tools are stupid)
mv /bin/uname{,.orig} &&
cat > /bin/uname << EOF &&
exec /bin/uname.orig "\$@" | sed 's/2.6.[^ ]*/${VERSION}/'
chmod 0755 /bin/uname

# Launch VMware Tools install
/usr/bin/ -d

# Remove our uname hack
mv /bin/uname{.orig,}

# Redo what VMware missed
depmod -a $VERSION
mkinitrd -f /boot/initrd-$VERSION.img $VERSION

Tested on RHEL 5.4 upgrading to a security fix kernel, works like a charm.