Friday, August 13, 2010

Perl scripts to assemble/disassemble

I wrote a couple little perl scripts that allow interactive entry of x86 assembly or machine hex and converts between them. It uses nasm under the hood to assemble and x86dis under the hood to disassemble.

You can find them here.

Sunday, June 6, 2010

Debian Linux 5 (Lenny) on Thinkpad T42

I know it seems backwards, but I recently switched from Ubuntu to Debian on my old reliable Thinkpad T42 laptop. Here are some of the problems I encountered and tweaks I made to get it working nicely.

Back and forward keys, and right alt as windows key:
1. Set up .xinitrc
#!/bin/sh
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group
xmodmap -e "keycode 234 = XF86Back" # Back button.
xmodmap -e "keycode 233 = XF86Forward" # Forward button.
2. Add command to gnome session to run .xinitrc

Fix the "Access IBM" and "Alt-Space" keys:
1. Add to /etc/rc.local
# Dumb kernel drops the acpi_fakekey.
/usr/bin/setkeycodes e017 148 # (for the Access IBM button)
/usr/bin/setkeycodes 0082 192 # (for the Fn+SPACE combination)

Emulate mouse wheel in X with middle button:
1. Add these three lines to /etc/X11/xorg.conf in the "Configured Mouse"
InputDevice section:
Option "EmulateWheel" "true"
Option "EmulateWheelTimeOut" "200"
Option "EmulateWheelButton" "2"

Note: Lenny uses XServer 1.4.2, which does use HAL, but not as fully as 1.5 or something because I couldn't get it to work with a .fdi file.

Make Fn-F5 toggle just bluetooth, not wireless:
1. Copy bluetooth_toggle.sh to /usr/local/sbin/
2. Change the action line in /etc/acpi/events/ibm-wireless to:
action=/usr/local/sbin/bluetooth_toggle.sh

Make Fn-F7 toggle between LCD,TV,and TV+LCD
1. Copy video.sh to /usr/local/sbin/
- (borrowed heavily from this script.
2. Change the action line in /etc/acpi/events/ibm-videobtn to:
action=/usr/local/sbin/video.sh toggle
3. Enable Fn-F7 by modifying the options line in /etc/modprobe.d/thinkpad_acpi.modprobe to:
options thinkpad_acpi hotkey=enable,0xffffff experimental=1

Welcome to my new blog site

Welcome to my new blog site. I figured I might as well let Google host my blog, since that will make it easier to moderate spam.

Here is the location of my old blog: hellewell.info/phillip/blogs. If you have any comments about any of the posts on my old blog, you may make them here.