Linux
As you might have noticed from other parts of this website, I enjoy using Linux very much. Ofcourse, it gives me many frustrations at times, but often enough it gives me much joy. The thing I like best about it, is that it just looks awesome when you configure it neatly. Further down the page, you can find two screenshots of my current desktop.
Okay, enough blabla, back to business. Purpose of this page is to create a bit of a log of anything I do on my computers that deals with Linux. Things like kernel configuration, scripts, do's and don'ts, and anything else that might be of any interest. Before I do that, it might be useful to mention the hardware I use (or have used).
Chances are you already saw my Vaio C1 page, and obviously this deals with anything that is specifically related to the C1. I will only put some things here that do not specifically relate to the C1, since I don't want to do things twice. My regular PC at home has the following stats:
- Pentium 4 2.4 GHz 800FSB HTT
- MSI Neo2-LS Mainboard, with on-board sound en on-board LAN
- 1 GB DDR-400 Memory
- 2 HD Drives: Maxtor 120GB 7200 RPM (8MB cache) and Maxtor 60 GB 7200 RPM
- 40x CD-ROM
- 20/8/4x CD-ROM/W/RW
- 3.5" Floppy
- Sapphire ATi Radeon 9800 Pro Video Adapter
- Pinnacle Bt878 TV/Radio Adapter
This all is cased in a Chieftek Midi tower casing (dark grey, better than that standard beige stuff I'm getting so tired of). Then, attached to that machine we have:
- Dell 2000FP 20.1" LCD FlatPanel Monitor (1600x1200)
- HP Deskjet 880C Printer
- LogiTech Cordless Desktop MX set (consisting of Elite cordless keyboard and MX700 cordless optical mouse)
- Sweex 10/100 Mbit 16-port LAN Switch
Ofcourse there's also a nice soundset attached, but that's not running Linux, so not worth mentioning here. ;-) My old, trusted iiyama 19" CRT screen was recently replaced by the Dell 2000FP. What a beauty this is. The only affordable 20" LCD screen running at 1600x1200 that I've seen so far, and it's a really good screen. Also auto adjusting (centering and resizing any video mode input it gets) works amazingly well.
All this is ofcourse connected to the internet permanently. I have an 8 Mbit upstream / 1 Mbit downstream ADSL connection (tweaked a little on latency (average of 10 ms to this webserver)), and we have a Linux access PC which does firewalling, routing, NAT, DHCP, and some other interesting stuff to keep us busy. There's probably about 8 PC's connected to this internal network on average.
Well then, on to the software. At this time, the machine is only running Linux, a Debian sid distribution to be more specific. The main things I run:
- GDM as X engine
- Enlightenment as Window Manager, with a splash of Gnome
- Eterm
- Mozilla
- Pan
- ProFTPD
Obviously there's lots more, but this might give you an overall idea of what my prefered software applications are. Here you can see why I use Enlightenment:
I'm not sure why I like the blue so much, but well, maybe my website already made clear that I enjoy blue. To me this is very relaxing and still exciting to work with. Odd thing is that I only like it inside computers; there's not a single blue decorative item in my room. As you can see, it's a 1600x1200 desktop, which is comfortably used on my 19" monitor, and it was also a must for a future monitor; I will not settle for anything less than 1600x1200 anymore, and I was glad the Dell 2000FP is actually quite affordable, considering the size and the quality.
Okay, more serious business now. first of all, I guess my kernel configuration (2.4.24) might be of interest, and maybe even my XF86Config-4 configuration. The XF86 config file is a cleaned-up version of the ATi X server configuration program output, because that was, with all the comments and stuff, very unreadable.
You can see in the XF86Config that I'm using the LogiTech cordless keyboard/mouse combination through USB instead of PS/2, which is actually working wonderously well. Especially the keyboard is interesting, since it has all those "media buttons". I usually despise those, but since I liked the MX700 mouse so much (my friend got it, so I had to have it), and I needed a new keyboard anyway, I just thought I'd get all done in once. By the way, owners of this set, if you are worried that your LED's are not on the keyboard (for Caps Lock, Num Lock and F-Lock), look at the receiver/mouse coking station... ;-) A nifty thing is: I got most of the multi-mediakeys to actually do something! Beware, it's an Enlightenment specific configuration, but it's still very nice. Here's how it works:
- First you have to find out your keycodes for each key. xev does this for you; just run it, get your mouse on the little window it opens, and press the button you want to map. Third row, second variable says "keycode xxx", and that's the code you need to use.
- In brackets, behind the keycode, you will find the "keysym". For the common keys on any pc104 keyboard, it will display a name that has been linked to the keycode. For multimedia buttons, the codes are usually not linked to a keysym, but you need to link it, to be able to use the key in Enlightenment. /usr/X11R6/include/X11/XF86keysym.h has a whole range of predefined keysyms which are in many cases at your disposal (be sure to not use any keysyms that are already in use by other keycodes, for obvious reasons ;-)). You could also add other names, but then you'd have to update xc/lib/XKeysymDB as well, and that's just more hassle, while there's no real need: the names you give to the keys don't really matter, they're just tags. As long as they have a tag, you can address them, and that's the main thing. So, find a few names that you think might work for you, take out the "XK_" part, and those names you should bind to the keycodes.
- The binding is done with xmodmap. Create a file, as examplified here, ~/.xmodmaprc, and run "xmodmap ~/.xmodmaprc". If you have the same keyboard, only connected through PS/2, look here; the keycodes actually differ depending on use of USB or PS/2.
- Now, the OS knows the bindings, but Enlightenment doesn't yet, and it doesn't even know what to do with them. So first we tell Enlightenment what should happen, when one of the "new" keys are pressed. Copy /usr/share/enlightenment/config/keybindings.cfg to ~/.enlightenment/, and edit the file in the section:
__ACLASS __BGN
__NAME KEYBINDINGS
- At the end of that section, just add your own entries. My additions can be found here (don't forget the __END part).
After doing this, you need to restart Enlightenment for the changes to take effect. Also, remember to run the "xmodmap ~/.xmodmaprc" command each time you boot, otherwise your keys won't work anymore. Make sure to run them _before_ Enlightenment starts, otherwise you'll have to restart Enlightenment each time you just logged on. If you use my keyboard, and the same configuration as above, the following keys actually do something:
Left part of the keyboard:
- Scroll: acts like mouse-scroll (except for clicking)
- Go: opens Eterm
Upper middle part of the keyboard:
- Rev/Rewind: skips backwards one song in xmms
- Fast Forward: skips forward one song in xmms
- Volume: adjusts volume and unmutes (see volume script below)
- Mute: mutes/unmutes
- Play/Pause: plays/pauses current song in xmms
- Stop: stops playing song in xmms
Upper right part of the keyboard:
- Search: see search script below
I haven't linked all keys to an action, simply because I couldn't think of useful actions for them. Two buttons can definitely not be used: User and F-Lock on the upper left part of the keyboard. User should be able to "sleep" the PC, and F-Lock determines whether the Function keys act like normal function keys, or like their symbolised version as specified on each one for this specific keyboard. When F-Lock is not active, xev doesn't even see any activity when pressing one of the function keys, so I guess this option is of no use in Linux.
As specified above, there are two scripts that support the functionality of the multi-media keys I have mapped. The first is the volume script. Basically, it adjusts the chosen volume type (master volume (vol) or pcm volume) by percentage, using rexima (apt-get install rexima). You can also have the osd interface put a message on the screen, telling you which volume the machine is set to by your change (apt-get install xosd-bin). Also the script can mute and unmute your system (pay attention: changing the voume also unmutes :-)). For muting and unmuting, make sure the script is allowed to write in /var/tmp. Fluor, thanks for creating this for me, and Andy, thanks for bugfixing it.
The second script is, if possible, even cooler. When pressing the Search button on the upper right part of the keyboard, the google script is run. First, xclip (apt-get install xclip) finds out which bit of text is in your copy/paste buffer, then it opens a mozilla tab with a google search to the selected text. For this, and all the rest of the help with the Enlightenment keymapping, I thank Kyle and his Enlightenment Extended Keyboard Howto.
Procmail
To sort and filter mail properly, procmail is a very powerful tool. You can make it as difficult or complicated as you like, but the idea is that your e-mail gets sorted in a certain way, that makes it easier for you to manage your e-mails. Here you can find my personal procmail definition (edited somewhat for privacy purposes), which should give you some simple pointers on how to sort your e-mail properly. Note that I use the Maildir format for my e-mail client (PINE), which has impact on the way your target files/directories are formatted in the procmail definition. I will explain per rule what is meant, and how it basically works. Keep in mind that procmail works as a top-down rulematching script, through which your e-mail is pushed, and unless specified otherwise, when a rule matches and an action has been performed on it, the mail will stop moving through the rulelist.
- First, in the first few lines, you define your settings; where is your e-mail stored, where do you log, and what do you log
- Rule (01) is a simple rule which will forward e-mail to any address (except if Bcc is used!) which goes through your procmail rules, to another e-mail address - useful when you have a domain name and you want others to make use of an e-mail address of that domain
- Rule (02) is a simple blacklist-based spam filter; it matches strings in a file (defined per line within the file) to a string in for example the From: address - useful for blocking whole domain names which are known for spamming, or for certain e-mail addresses on your domainname which only receive spam
- Rule (03) moves messages marked by SpamAssassin (meaning they are spam) to a spam folder; on the server which is running this procmail script, all e-mail is piped through SpamAssassin before it reaches procmail, and the header "X-Spam-Status: Yes" is added when the mail is spam - this is a very efficient tool when it comes to spamfiltering
- Rule (04) matches Microsoft executable attachment filenames; if the rule is a hit, the e-mail gets deleted - I don't really use MS executables on my Linux machines (odd hm), and these are usually viruses
- Rule (05) is a simple one; all the e-mail sent to an address starting with "spam" will get sent to my spambox - I use spam@kryz.org for different purposes, for example signing up for services which might start sending a lot of commercial e-mail
- Rule (06) is a rule which matches on an e-mail address which I don't use anymore; if an e-mail matches the rule, an automatic reply is sent with a text as specified in .changed-addr.msg - I used this for e-mail address that had a .forward to my new addresses, without me really having access to the addresses anymore
- Rule (07) and (08) save mailing lists e-mails to different e-mail boxes
- Rule (09) saves e-mail to my vaio address to a seperate box
- Rule (10) saves guestbook e-mail to my personal folder; I don't get that many guestbook entries so there's no use creating a seperate box for it
- Rule (11) and (13) save e-mail to different useful boxes
- Rule (12) sends forwarded e-mail (don't you hate those "funnies"?) to a seperate e-mail box
This procmail script is not perfect, but it basically works for me. Any improvements are ofcourse welcomed.
ATi Radeon 9800 Pro in Linux
I bought an Sapphire Radeon 9800 Pro a few weeks ago, and ofcourse I needed to get it to work in Linux as well. It's not as simple as getting an NVidia card to run, but it's not too hard either. Step by step:
- If you've had an NVidia video adapter before your new and improved Radeon, make sure you uninstall the NVidia drivers first. If you're using the newest NVidia driver install script, all you have to do is run it with the option -uninstall, and it will be gone. If you omit this step, you will get strange XFree86 errors about using the wrong NVidia drivers, while you're running a Radeon adapter. It will work, but without dri/gl accelleration.
- I changed to a 2.4.24 kernel before doing this, to make sure that the ATi drivers were compatible with the AGP 8x accelleration specifications of the card. I basically just used my .config from the 2.4.22-rc2-ac2 install and copied it to the 2.4.24 kernel source, and built the kernel. I know it's not very clean, but it worked flawlessly nonetheless.
- Then, make sure you're using XFree86 version 4.3.0. It should also work with
4.2.0 and 4.1.0, but if you're using Debian unstable (sid), most people will have
4.2.1 installed, which is not an ATi supported XFree86 version, and we all know
that upgrading to a newer version is always easier than downgrading to an older
version in Debian. To upgrade to 4.3.0, take the following steps:
- Add the Debian experimental sourcelines to your /etc/apt/sources.list, like this: "deb ftp://ftp.debian.org/debian ../project/experimental main contrib non-free" (without the quotes ofcourse)
- Debian experimental will never install new packages on your machine, unless you specifically tell apt to take the experimental train version of a package. To find out which packages you need to upgrade, execute: "XFree86 -version" to find out which version you are currently running, and then "dpkg -l | grep xxx" (with xxx being the version number of your current XFree86 install) to list all packages which are part of your current XFree86 install
- To install XFree86 4.3.0, which is the current XFree86 version in experimental, execute the following command: "apt-get update; apt-get install -t experimental <list of packages>"
- Now that you have XFree86 4.3.0, you need to install the correct driverpackage for your Radeon. Find out here what the current version is, download it, and follow the install instructions. Make sure you backup your current /etc/X11/XF86config-4 file before going into the ATi config routine, you might need it for reference purposes. And again, as stated before, don't ever let debconf manage your XFree86 configuration. It just doesn't work.
This should do the trick. Interesting part is that when you upgrade your kernel, you don't even have to rebuild your graphics driver, it will work straight away (unless your new kernel is broken or the changes are so big that your driver doesn't understand anymore). Good luck and have fun with it.
Talk to Kryz
![]()
(c) 2001 - 2005: Kryz for content, Anya for design