Got an oppurtunity to build Gentoo again on my server and this led to me building a new portage management script. Since I was at it I decided to update my Gentoo Quick Install and Clamshell iBook guides. The portage management script can be found on the Gentoo Linux Tidbits page.

When I have to do a reinstall, sometimes I have to install from scratch – doing a clean install is just sometimes necessary. My configurations are priceless to me and after my reinstall I restore them from a backup copy. Here’s how I quickly add my configurations to an include file and back them up on a regular basis done with a basic script.

Basic tar Command

A good number of GUI programs can do this (you can read about the ones I’ve looked at here), but they seem to make the process more complicated, so I went back to tar and created a script. And it makes adding and subtracing files easy. For those new to tar the basic archive command is:

tar -c --xz -f <backupname>.tar.xz /folder/file /folder ...

Include/Exclude Files

By putting the archive command in a bash script it can be used later. Files and folders can be appended to the command in the script but for multiple files consider using include and exclude files:

If you are just getting into Quake Wars, has a Strogg just thrown a grenade in your area and then quickly pulled out his Lacerator jumping around the corner to finish you off, all before you could say, “What the…”? Welcome to Quake Wars. Quake Wars has been around for a couple years and has some very devote followers. I almost threw out Quake Wars, discarding it as too tough and moved on. I’ve played a good bit of Urban Terror and thought I could mesh skills pretty well in QW but I couldn’t. For one, QW is a completely different game that UT. It is highly team-based and class-independent game. Second, experts there have a highly configured setups that can make your twist-left-hand stretch-forefinger setup into minchmeat. This is a guide that will get your setup somewhat on par with the experts and put you on evener ground.

ETQW is highly configurable. It literally has thousands of settings that can be changed. Thankfully we will only have to change a number of them the get on par with other players. Be of warning though that changing some settings are considered cheats and the built-in cheat system (Punkbuster) may disallow some settings. I have built a configuration that will work on just about all servers. If there are values that are not allowed by Punkbuster, Punkbuster will let you know in the chat window.

Keyboard Layout

The most important thing you can do is to build a keyboard layout where most commonly used keys are close to the fingertips. Here’s the layout I use. Green keys are at the fingertips, blue require a bit of reach, yellow are just out of reach, and red are need be.

A couple notes. Sprint toggle is the always running toggle. Sprinting is useful most of the time but makes scoping opponents and moving impossible. All keys to right are automated responses that I frequently use. 9 and 0 will respawn you in either the original spawn or the foremost spawn.

User Configuration File

Configurations are put in the users autoexec.cfg file. There won’t be one originally so you will have to create it. The autoexec.cfg file in Linux goes in the user configuration folder: ~/.etqwcl/sdnet/<playername>/base. In Vista it goes in in the users Documents\Id Software\ETQW…\sdnet\base. This file gets loaded when the user logs in. To be able to test it though it needs to be in ETQW’s global location <ETQW-config-folder>/base. Create an autoexec.cfg in the user folder and redirect to the global one:

exec global.cfg

You can name it anything you want. Once you have your global config set up you can test it from a running QW by opening console (~) and running exec global.cfg. QW will let you know of any error exist in the configuration file.

Global Configuration File

I could explain all the details of the configuration file but rather I’ll just give it to you. It has all the explanations in it plus links you need to look up an details. A couple notes: A smooth, even frames per second is critical to QW. You’ll want 30fps or 60fps without any hitching. Good graphics and great light don’t mean a thing when you’re looking to make that great hit and find yourself fighting your hardware. The config is for a nvidia 9600 GSO which at 2009 this is a medium level graphic card that handles shaders and lighting poorly, the config will reflect that. I haven’t give away all my secrets ;), but here it is:

When people have a issue with Firefox I’ve seen many people will resort to deleting their old profile (or folder) and creating a new one. This works but doing this will get rid of any passwords, history, bookmarks… therein. Having used Firefox quite a bit creating a new profile from time to time is a good idea anyhow as cruft, bad extensions, … can slow down browsing.

Manually

Copying the Firefox configs can be done by:

cd ~/.mozilla/firefox/

Backup the old profile and profile list:

mv xxxxxxxx.default{,.bck}
mv profiles.ini{,.bck}

Create a new profile:

firefox -CreateProfile <profilename>

This command will return the name of the new folder. Copy the basic settings to the new profile:

This will transfer the bookmarks, browsing history, form entries, passwords, personal dictonary changes, and page zooms. There might be a couple other things wanted to add (possibly your firefox preferences), take a look at Transferring data to a new profile for more information.

If you ever have an emergency and need a rescue disk to recover your Linux install, or maybe you just want to brag to your friends there’s some good LiveCD/USB’s out there and many distro’s now make LiveUSB install images, but it is also possible to create your own customizable LiveUSB. Hey, if you’re willing to put the time in, you can have a portable Linux in your pocket.

There’s alot of articles about creating your own custom CD/LiveUSB but many of them seemed dramatic involving messing with things like syslinux… Plus many of these create a fixed image, meaning that once it’s on your USB it can’t be changed. But having a customizable Linux on a USB flashdrive isn’t that difficult – just install Linux to the USB drive.

Partition the USB Drive

The first thing you’ll need is at least a 2GB flash drive. Anything less and you better plan a real basic install. First thing you might like to do is partition the flash drive. This isn’t necessary but I was pretty sure I wouldn’t need the 4GB for what I needed so I partitioned the flash drive to have a 1GB FAT32 partition first (so that Vista can see any files I put on it) then I partitioned the remaining 3GB as ext4 with kparted (there’s also gparted for gnome users).

Install via VirtualBox

No need to burn an ISO and reboot, use VirtualBox and do it from your desktop. You can follow my Testdrive a LiveCD with VirtualBox post to getting VirtualBox setup. I personally used Arch Linux for this install because it’s easy to configure, Gentoo should work well too, and Ubuntu looks to be easy.

Note: At the time VirtualBox does not have 64bit capabilities. If you want to install a 64bit Linux on your flash drive best to boot a LiveCD and follow these instruction from there.

Make sure your user is part of the VirtualBox group to enable usb recognition:

sudo gpasswd -a <username> vboxusers

Boot the LiveCD/USB iso/img in VirtualBox then in Devices > USB devices select your flash drive. Now the installer will recognize your flash drive. Proceed to install the distro on the flash drive. If you partitioned beforehand you can skip partitioning and go to setting Filesystem Mountpoints. When you reach GRUB setup be sure to install GRUB on the flash drive itself, for me it was /dev/sdb. Be sure NOT to install GRUB to a partition, it should be at the beginning of the drive.

Fix Grub

Because your BIOS is likely setup to recognize your hard drive before your USB drive you get drive denominations like /dev/sda for your hard disk and /dev/sdb for your flash drive on regular bootup. If booting from a flash drive, many BIOS’s have you enter a key (mine is F10) to get to a Boot Menu. So when you select your flash drive in your BIOS Boot Menu your flash drive now becomes /dev/sda, hard drive /dev/sdb. In grub terminology this is hd0 and hd1. Most BIOS’s are like this (though there a few exceptions). To know for sure you won’t be able to detect this until you try and boot your flash drive (more below).

Close VirtualBox and open your GRUB menu list and change to the first recognized drive:

The (hd0,1) value denotes the partition number, again starting with 0. So this denotation tells GRUB the root filesystem is on the first drive, second partition.

Arch-specific Details (Mostly)

If you already did the configuration for your hard disk, you should be able to copy most the configuation files over to the flash drive (rc.conf, mirrorlist, modprobe.conf, local.conf…) and then install xorg, xfce4… by chrooting in. This is my chroot script:

This will allow you to just cd to the mounted directory and enter command to chroot to the new environment. From there you can install a desktop environment (I choose XFCE because I wanted a lightweight environment and limited disk space):

The kernel initramfs image will need to be rebuilt too to have usb driver support. In the chrooted environment edit /etc/mkinitcpio.conf and add usb to HOOKS:

HOOKS="base udev autodetect pata scsi sata filesystems usb"

Then find the the kernel version name and version:

uname -r

and build a new initramfs image:

mkinitcpio -g /boot/kernel26.img -k <your-kernel-name-version>

The -k option needs to be specified to use the chrooted kernel and not runtime kernel that is being used by chroot.

When done, exit chroot:

exit && umount proc sys dev

Reboot and Test

Now reboot and get to the BIOS Boot Menu. As I said, all BIOS’s are different so keep an eye for a key to get to it. Once in the Boot Menu select your USB drive.

Try and boot the flash drive. If you get a GRUB 17 error or boot into hard drive OS, you’ll have to edit your menu.lst. You can find the devices Grub sees by starting the flash drive again and in the Grub menu press e to edit. On the root line press e again and delete to:

root (hd

now press tab and it will show you the availble drive and partitions. Enter the correct one, hit escape and then b to boot. That’s it, you should now have your own customizable Linux USB drive.

Troubleshooting

If you get errors loading the kernel, it may be because USB device detection may need a delay before loading root. Try to add this to the end of your kernel line in your menu.lst:

rootdelay=8

Conclusion

I was a bit surprised. I didn’t think a USB drive would be much different that a CD/DVD but actually it was alot faster. And I just discovered that I’m using a USB 1.1 flash drive. :) Not quite as quick as my hard drive but definitely not bad. This is also the first time I ran without an xorg.conf and my desktop runs great. Definitely worth a try if you ever need a rescue os to fix problems with.

Results will vary depending on your machine but it may be quicker to burn and reboot to testdrive a LiveCD. If you want to try VirtualBox though, this is how you do it.

I decided to take a look at Fedora 11 and I thought that if I wanted to take a look at other LiveCDs in the future may as well set up VirtualBox and save myself the time of burning and restarting to take the look at them. Virtualbox is a bit slow but not terribly though. Note: I don’t have virtualization on my CPU though so load-times may alot better with it.

Install VirtualBox

Virtualbox has been getting some good reviews and is easy to use. Locate you distro’s documentation and find out how to do this.

Once Virtualbox has been installed load the module:

sudo modprobe vboxdrv

Start VirtualBox

VirtualBox in the KDE menu is under System > Sun VirtualBox, or you can just type VirtualBox in a terminal.

Setup

Click New in the VirtualBox window, name it, select OS type and version. Select base memory size as 512MB (most operating systems will need at least 512MB to function properly).

To create a hard disk image, when the new image has been created click Settings then CD/DVD-ROM and check Mount CD/DVD Drive, and then add the ISO image.

In the General dialogue select the Advance tab and check Enable IO APIC.

That’s it. You should now be able to load a LiveCD from VirtualBox.

Going Further

There are several programs to get mail notifications in the notification tray in KDE 4 but up until now there have been no native KDE ones: cgmail, and gnubiff rely alot on Gnome. There is the emailnotify plasmoid which isn’t too shabby but I wanted my notifications in the notification area!

Popular KDE 3 applications are making their way gradually to KDE 4 and kcheckgmail just made that plunge. So thanks to the devs that got this done.

Kcheckgmail for KDE 4 would still be considered beta software though as I encountered a couple bugs setting it up. After setup though kcheckgmail has been running good the last few days.

For now if you want to use kcheckgmail you’ll have to compile it from git. Luis has the basic instructions on how to do this.

Continued from Part 1. Now that you got your card and PSU there’s couple more things to know.

Linux Drivers

It’s best to add your new video card drivers before you shut down so your new card will just boot up to the deskotp. Remove your old driver and install the new. Don’t try to keep both drivers as they’d probably conflict. Don’t worry about uninstalling a video driver on a running system, the driver is stored in memory so this is no problem to do.

BIOS

For newer BIOS’s this isn’t a problem. On mine I had a video setting that by default said “PCI Express First’ so I didn’t have to change anything. The card was recognized at boot and the BIOS disabled the onboard one automatically. Most BIOS’s have this option. You may have to change this yourself though so look into your BIOS before booting.

Post Boot

If everything is set up correctly, you should have your new video card up and running. In the terminal type:

lspci | grep VGA

and you should see your new card. With that you can try out a game or an HD movie and see how it does.

Overclock

There’s alot of talk in the video card click of overclocking. My advice? Don’t! Sure you can if you want to but keep in mind that overclocking voids most warranties. Overclocking can also take years off a video cards lifetime. Plus even the greatest overclocks will usually only yield about 2-4 fps. If you need more fps than that then likely you need another video card. If you absolutely have to do it, there’s a good post in the nvidia forums (see third post down).

Budget for a Price

I decided to go with the nvidia PNY 9600 GSO 768MB card. This isn’t a good card for gamers (be careful of manufacturer-reviews) but it is good for the price I got it for. I picked this up at Fry’s for $40 after a mail-in rebate. It’s runs quiet and has a three year warranty to boot. I tested a few games and found out it ran decent on most new games on medium settings (Crysis plays 20-40fps). I found out a bit too late but if you want a good budget/gamer card you’re gonna have to begin at the $100 price range and I’ve heard alot of good things about the ATi 4770.

My PSU

This PSU is a great buy for the money as I said before though if you want to be sure you got a good PSU spend $40 dollars or more. As it was though, I couldn’t afford it and took a chance on a bargain PSU that has gotten some good reviews. The hec HP485D 485W ATX12V Power Supply installed easily and seems to be doing ok (I just hope it holds out for more that a year :) )

Welcome to linuxtidbits.

linuxtidbits is a place for common bits of Linux knowledge. Linux is a good operating system with good people. Being part of Linux, to me, means being a part of something that everyone can contribute to.