Shell Person Help me keep the shell people alive.

5Jul/101

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).

8May/100

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: http://www.wolfire.com/humble

28Apr/103

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.

24Apr/105

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

22Apr/103

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).

#!/bin/bash
## 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 ]
then
shift
mpc search album "$*" | mpc add ; mpc play
exit
fi

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

21Apr/100

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).

21Apr/100

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.

20Apr/105

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 X.org (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.

10Apr/1042

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 64.124.102.44
Invalid user windows from 64.124.102.44
Invalid user worthy from 122.201.70.12
Invalid user www123 from 64.124.102.44
Invalid user www from 64.124.102.44
Invalid user www from 66.235.201.39
Invalid user www from 75.126.69.5
Invalid user wwwrun from 64.124.102.44
Invalid user xam from 64.124.102.44
Invalid user xbitchx from 64.124.102.44
Invalid user xchat from 64.124.102.44
Invalid user xfs123 from 64.124.102.44
Invalid user xfs from 64.124.102.44
Invalid user ydnah from 64.124.102.44
Invalid user yoshida123 from 64.124.102.44
Invalid user yoshida321 from 64.124.102.44
Invalid user yoshida from 64.124.102.44
Invalid user yssor from 64.124.102.44
Invalid user z1x2c3 from 64.124.102.44
Invalid user zabbix from 75.126.69.5
Invalid user zachary from 64.124.102.44
Invalid user zoe from 64.124.102.44
Invalid user zuperman from 64.124.102.44
Invalid user zxcvb from 64.124.102.44
Invalid user zxcvbn from 64.124.102.44

The full list is at the bottom of the post.

19Dec/093

Install SCMPC – Audioscrobbling MPD to Last.fm in Ubuntu 9.10

leopard

I've been using SCMPC to scrobble my music played with MPD to Last.fm 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:

./configure
make
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/scmpc.pid"
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.

scmpc
sudo /etc/init.d/mpd restart