Archive for the 'Linux' Category

Installing Arch Linux on the EEE 701

Before I went travelling I installed Ubuntu 8.04 on my EEE because I wanted something relatively stable and that I was familiar with. Now that I’m back, I want to hack around with it a bit so, so yesterday I installed Arch Linux on it.

There is a pretty comprehensive guide to installing Arch on the EEE which I followed for the most part. Between that and the beginners guide, the installation and initial configuration were relatively straightforward. I installed from the 2009.02 FTP USB image, using a wired ethernet connection to download the required packages during the installation phase, but the EEE wireless card was supported “out of the box” on the first boot (after selecting the wireless-tools and netcfg packages).

The base installation was simple enough after a bit of reading. However, configuring Xorg almost drove me mad! After spending most of the day reading through the ArchWiki Xorg article, I finally came upon the (partial) solution of ignoring the xorg.conf file completely and relying instead on the startx command and the hal daemon.  This left me with a couple of problems related to the keyboard layout, but did give me an X11 environment capable of supporting Gnome.

Installing Gnome was as simple as typing pacman -S gnome, but I’d recommend installing the gnome-extra package too while you’re at it, as the gnome package is pretty minimal to say the least!

I had no problems with sound or the internal microphone, and following the ACPI section of the guide enabled the hotkeys, OSD and power button to function correctly.

I’m still tweaking my setup here and there, but the system seems stable so far. It was a lot more work than simply installing Ubuntu or Fedora, but I think it was worth it to get a smaller, faster system running on the EEE’s (quite limited) hardware.

Converting .lit files to PDF for Linux

Rather than carry a load of “dead tree” books with me on my travels, I have a collection of Microsoft Reader (.lit) ebooks on my laptop. The only problem is that there doesn’t seem to be any Linux software available to read them! Fortunately, the software exists to expand MS Reader files to plain HTML, which can then be converted to Postscript and on to PDF, which is most definitely handled by Linux.

The first program required is ConvertLit (slightly dubiously shortened to clit). The source is available, but since I’m running Ubuntu 8.04 on my laptop, I opted to install from the .deb files linked below.

sudo dpkg -i libtommath_0.37-1_i386.deb
sudo dpkg -i clit_1.8-1_i386.deb

Once ConvertLIT is installed, the process is as below.

clit my_book.lit html/
html2ps html/my_book.html > my_book.ps
ps2pdf my_book.ps my_book.pdf

Although simple, this can be time-consuming and repetitive, especially if you have a lot of files to convert! To deal with this I wrote a short shell script which runs through the process of converting a specified .lit file to PDF.

To use it, download the script and set the permissions to allow execution. I have a ~/bin directory in my $PATH for scripts and small bits of code that I’ve hacked together. It’s not required, but I find it pretty useful.

lit2pdf my_book.lit

My script only handles one file at a time, but something like this can be used to deal with entire directories.

#!/bin/sh

for file in *.lit ; do
lit2pdf "$file"
done

echo "Complete!\n"

Feel free to make changes, pass the script on, etc. It works well enough for my needs, but please let me know if you come up with an improvement. And remember, as the ConvertLIT usage screen says, “Please do not use this program to distribute illegal copies of ebooks. … that would make Baby Jesus sad.

Free Online Poker for Linux

I really like poker. Partly as an interesting artificial intelligence problem, but mostly as a fun way to spend time with a group of friends. Now that I’ve finished travelling the problem is finding people to play with!

There are a couple of reasons why I don’t like online poker. The first is an issue of trust. Between bots, collusion, and poor security, I just don’t believe that all the players in a game are on an equal footing. The second reason is that I think of poker as a social game. I like to be able to see the people I’m playing against!

PokerTH is a cross-platform (Windows, Mac OS X & Linux) Texas Hold ‘em poker application, released under the GPL. It includes the option of a local game against AI opponents, as well as a free online setting, allowing the player to join a public table or create a private one to play with friends. I still can’t see the other people at the table, but it’s a great way to learn the game or just play for fun!

My only complaint so far is that the minimum window size is too big for the Eee 701. It’s easy to get around by moving the window every so often, but it would be nice to have the ability to scale the window down for smaller screens.

Download PokerTH (Currently version 0.62)

PokerTH version 0.60 is currently available in the Ubuntu 8.04 repositories.

Enabling Eee 701 WiFi hotkeys in Ubuntu 8.04

I picked up an Asus Eee 701 a couple of weeks ago to take with me when I’m travelling. After a few days I started to get a bit frustrated with the some of the more simplistic aspects of the default Xandros “desktop”. I found the wireless configuration tool particularly unintuitive so after a bit of research I decided to install Ubuntu 8.04.

The hardware support is pretty good “out of the box”, but there are still a number of issues with the initial installation. Thankfully eee.ricey.co.uk have made a shell script available to take care of almost everything automatically. After running the script most of the hotkeys (Volume, screen brightness, sleep) work correctly, but the WiFi one does not.

To enable the WiFi hotkey functionality (Fn + F2) add the following line to /etc/modules

pciehp pciehp_debug=1 pciehp_force=1

Then create the file /etc/acpi/actions/wireless-toggle.sh containing the following

#!/bin/sh
wlan_control=/proc/acpi/asus/wlan
WLANSTATE=$(cat $wlan_control)
case $WLANSTATE in
  1)
    ifconfig ath0 down
    modprobe -r ath_pci
    echo 0 > $wlan_control
    modprobe -r pciehp
  ;;
  0)
    modprobe pciehp pciehp_force=1 pciehp_debug=1
    echo 1 > $wlan_control
    modprobe ath_pci
    echo 0 > $wlan_control
    echo 1 > $wlan_control
  ;;
esac
 

Make the file executable chmod a+x /etc/acpi/actions/wireless-toggle.sh

After a reboot you should be able to toggle the internal wireless card by using the hotkey.