Shell Person Help me keep the shell people alive.


Keyboard Hotkeys with Debian Lenny

Here are some notes on assigning functions to those special keys that come on so many keyboards. My Gateway SK-9920 has 12 of these hotkeys: volume up, down, and mute; play, stop, next, and last track; internet, help, mail, shopping cart (?), and back (presumably). I don't even know what the creators of this keyboard envisioned for the "shopping cart" key. Often these keys aren't recognized out-of-the-box in Windows, much less in Linux.

Like usual, there are almost certainly specific GNOME or KDE tools to accomplish this goal. Since I'm not running those, however, I'll stick to tools available in almost any X.Org environment (I happen to be using Ratpoison).


Support EFF: Play Video Games

For three more days you can buy a bundle of 5 indie video games, and you can pay whatever you want. Furthermore, you can designate where your money goes, between the five game developers, EFF (the Electronic Frontier Foundation), and the Childs Play charity (video games for hospitals). Also, all of the games are cross platform; linux, mac, and windows.

The games are:

You can buy the bundle here:


Change Super Contacts Icon on the Palm Pre

I doubt many people will be searching for this post...

I like the Super Contacts app for the Palm Pre, and I decided to put it in the quicklaunch dock instead of Palm's default Contacts app. The only problem with this is that the Super Contacts app is really ugly (my apologies, guys-who-made-it, I admit I'm shallow). Here's what I did to replace it with Palm's Contacts icon.


Autostart X Without GDM

I'm going to explain how I auto-start ratpoison on my bare-bones Debian Stable (Lenny) system. I don't use GDM, KDM, or any other "DM" (display manager). There are multiple steps here (involving multiple config files), but it is not complicated.

Step 1
/etc/inittab & mingetty

mingetty is an alternative to getty, which (for the sake of simplicity) I describe as the linux login program. You'll need to install mingetty:

#as root (i.e., using either su or sudo)
apt-get install mingetty


MPC Script – Quickly Find and Play by Album

This is a simple script for MPD & MPC users. It allows you to quickly queue and play an album. I name the script "album" and put it in ~/bin (which is included in my $PATH).

## Shortcut to search, add, and play an album (after clearing current playlist).
## Use -a (for "add") to add the album to the playlist without clearing current playlist.

if [ $1 = -a ]
mpc search album "$*" | mpc add ; mpc play

mpc clear
mpc search album "$*" | mpc add ; mpc play


Removing Ratpoison’s Borders

This is a simple issue, but one that wasn't immediately evident to me. When using Firefox in ratpoison, I noticed that there was a 1px border surrounding the window. This is annoying, especially when trying to scroll with the mouse -- it's always easiest to fling the mouse to the far edge of the screen, so I'm not scrolling frames or text boxes (or flash). But the 1px border is essentially dead space, so I then have to move back a little, wasting time. (I suppose this relates to Fitts's law).


Mounting Canon PowerShot A590

First I should note that I assume GNOME or KDE probably does a great job automounting the Canon PowerShot A590, or at least getting the pictures off of it. Not having GNOME or KDE, however, I'd like to do it from the command line.

Lots of cameras will automatically be recognized as USB mass-storage devices. If this is your camera, great. Just find the camera with "fdisk -l" (as root), and mount it. Then use it like any other mounted drive. Unfortunately, The PowerShot A590 does not work that way (I think it may use PTP - Photo Transfer Protocol). For these kinds of devices, "fdisk -l" yields nothing. You can, however, see that the system took note of the camera if you look at /var/log/messages

Apr 21 11:28:42 tv kernel: [ 8006.701357] usb 6-2: new high speed USB device using ehci_hcd and address 6
Apr 21 11:28:42 tv kernel: [ 8006.839278] usb 6-2: configuration #1 chosen from 1 choice
Apr 21 11:28:42 tv kernel: [ 8006.842357] usb 6-2: New USB device found, idVendor=04a9, idProduct=3176
Apr 21 11:28:42 tv kernel: [ 8006.842357] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 21 11:28:42 tv kernel: [ 8006.842357] usb 6-2: Product: Canon Digital Camera
Apr 21 11:28:42 tv kernel: [ 8006.842357] usb 6-2: Manufacturer: Canon Inc.
Apr 21 11:28:42 tv kernel: [ 8006.842357] usb 6-2: SerialNumber: 9CA872EC36E04292B3602599D62AC848

I had heard of gphoto2, so I did an apt-cache search to see what was available.


The Trouble with the Framebuffer

The original plan

I've tried for a long time to have a usable, console-only, desktop linux system.  By console-only, I mean running without (a.k.a. X).  I thought the key to this would be using the framebuffer.  Here's wikipedia's definition of the framebuffer, but in short it allows displaying graphics without running X.  When the framebuffer is enabled (some systems enable it by default), the first thing you notice is that the console font is smaller and nicer.  This alone makes the console considerably more usable, as the screen doesn't scroll nearly as much, letting you see more at once.  However, that's not all you can do with the framebuffer.  You can also view PDFs, images, and video (using mplayer) with the framebuffer, and even compile complex programs to use the framebuffer instead of X (i.e. gimp, using GTK-DFB).

The main thing that stood in the way of my console-only desktop system is a modern browser.  Now supposedly Firefox has been compiled for the framebuffer, as has uzbl.  However, I've had no luck with either, and I've sunk a fair amount of time into the task.  And links-g just doesn't cut it for me.


Hacked – SSH Bruteforce

This isn't much of a surprise, as the box had an incredibly simple root password. Here's some info:

This was a brute force ssh attack. ssh root login was not disabled. Here are some of early attempts before success:

cat /var/log/auth.log.1 | grep "Invalid user" | cut -d ':' -f 4 | sort | uniq | tail -n 25
Invalid user wilson from
Invalid user windows from
Invalid user worthy from
Invalid user www123 from
Invalid user www from
Invalid user www from
Invalid user www from
Invalid user wwwrun from
Invalid user xam from
Invalid user xbitchx from
Invalid user xchat from
Invalid user xfs123 from
Invalid user xfs from
Invalid user ydnah from
Invalid user yoshida123 from
Invalid user yoshida321 from
Invalid user yoshida from
Invalid user yssor from
Invalid user z1x2c3 from
Invalid user zabbix from
Invalid user zachary from
Invalid user zoe from
Invalid user zuperman from
Invalid user zxcvb from
Invalid user zxcvbn from

The full list is at the bottom of the post.


Install SCMPC – Audioscrobbling MPD to in Ubuntu 9.10


I've been using SCMPC to scrobble my music played with MPD to for a couple of years now. I can't find a package for it in the repositories, but it's easy to install from source. The source hasn't changed in almost 3 years, but it still seems to be working fine.

Here's how I installed it in Ubuntu 9.10 Karmic Koala.

The SCMPC homepage is here. You can download the source at this link.

First install the dependencies you'll need:

sudo apt-get install libargtable2-dev libconfuse-dev libdaemon-dev

You may also need libcurl (I apparently already had it).

Then extract the source code (the file was scmpc-0.2.2.tar.bz2 in my case) by right-clicking and selecting "Extract here". In a terminal, cd into the directory you just extracted. Then just:

sudo make install

That should install it. Now create a directory for the config file in your home directory:

mkdir ~/.scmpc

You can copy a template for the config file:

cp /usr/local/share/scmpc/scmpc.conf ~/.scmpc/

And then fill in your own details.

Or you can just make your own. Here's copy of mine.

log_level = debug
log_file = "/home/james/.scmpc/scmpc.log"
pid_file = "/home/james/.scmpc/"
cache_file = "/home/james/.scmpc/scmpc.cache"
mpd {
	#host = "localhost"
	#port = 6600
	#timeout = 5
	#password =
audioscrobbler {
	username = "my_user_name"
	password_hash = "a_hash_of_my_password"

I keep all of SCMPC's operating files in ~/.scmpc

I use password_hash= instead of password= so I don't have to store my password in plain text. You can get a hash of your password like this:

echo -n your_password | md5sum

Don't include any spaces or the dash ( - ) symbol that follow the hash.

Now just start SCMPC and restart MPD. Add SCMPC to your startup programs (System -> Preferences -> Startup Applications) if you want it running at startup.

sudo /etc/init.d/mpd restart