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.

Snowshoeing

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.

#!/bin/bash

# Max length the LCD can accept. Typically 62
MAXLENGTH=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:])
else
	INPUT=$(echo $1 | tr -d [:cntrl:])
fi

# 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
fi

# 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
i=3
CMD="0x0 0x0 $LENGTH"
LINES=()
for BYTE in $BYTES; do
	# Chunk ready, append it to array and reset counters
	if [ $i -gt 16 ]; then
		LINES[${#LINES[*]}]="$CMD"
		CMD=$(printf "0x%x" ${#LINES[*]})
		i=1
	fi

	# Push byte on accumulator
	CMD="$CMD $BYTE"
	let i+=1
done

# Put last chunk into array
LINES[${#LINES[*]}]="$CMD"

# 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
done

# 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 &&
#!/bin/sh
exec /bin/uname.orig "\$@" | sed 's/2.6.[^ ]*/${VERSION}/'
EOF
chmod 0755 /bin/uname

# Launch VMware Tools install
/usr/bin/vmware-config-tools.pl -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.

1.0.3 on AppStore

Tuesday, November 24. 2009

Following this last entry on 1.0.3, I've just received news from Apple that the new version of AMT Mobile should hit the App Store within a couple of minutes.

I hope you all enjoy the complete train schedule on you iPhone or iPod touch :)