Backing up the Beast
Over the last few days I’ve been a virtual cosmonaut exploring all routes to restore my troubled Gentoo.
The just cause was my aging laptop which I discovered was bandied by pirates. To discover that my toss about had been violated was a shocking. Though I admit there was more I learned about security. Before I pined that the only safe computer is one locked in Fort Knox. The only viable way to really infiltrate a computer is direct access to the hardware.
To discover if the intruder was a hardware or software cause, I did a complete zap of the system, reinstalling everything. First I backed up all my configs:
cd /
tar cvpzf Gentoo-system-configs.tgz /etc/resolv.conf /etc/env.d/02locale /etc/sudoers /usr/lib/locale /etc/conf.d/clock /etc/make.conf /boot/config* /etc/modules.autoload.d/kernel-2.6 /etc/fstab /etc/mtab /etc/conf.d/hostname /etc/hosts /etc/conf.d/net /etc/conf.d/ntp-client /etc/samba/smb.conf /etc/sysctl.conf /etc/X11/xorg.conf /etc/conf.d/local.start /etc/portage/package.mask /etc/portage/package.unmask /etc/portage/package.keywords /etc/portage.use /usr/local/portage /etc/slim.conf /etc/updatedb.conf /opt/nwn/nwn /usr/share/applications/*
And for the home folder.
cd /
tar cvpzf Gentoo-home-configs.tgz --exclude=/home/user/Applications --exclude=/home/user/Desktop --exclude=/home/user/My\ Documents --exclude=/home/user/My\ Music --exclude=/home/user/My\ Pictures --exclude=/home/user/My\ Videos --exclude=/home/user/Storage --exclude=/home/user/.mozilla/firefox/*.default/Cache --exclude=/home/user/.etwolf --exclude=/home/user/.Trash /home/user/
I call this the poor mans backup. All I currently have is a DVD drive so this definitely becomes intriguing. I backed up all my configs, the rest of my files in my home folder, and the /opt directory where all my games were to DVD.
I decided to try the 2007.0 minimal install CD as the 2006 minCD could be buggy for me at times. The min install CD, I must say, is really sweet. Using these LiveCDs your computer is like swimming in jello. No insta-desktop, no thanks.
Since I don’t have a backup drive (or any other drive for that matter) I used ISO Master to put the configs (as well as the stage3) on the ISO and burned it to disk. The procedure works well and saves a bunch of time from having to re-edit all the configs.
The min install CD on DVD started right up. I used the never aging fdisk to partition the drives. I haven’t used fdisk for a long time but I like it’s Linux concept – no frills, dangerous if used wrong. :) The first time I used it (early 90’s?) I had to use sectors, now the process is some much easier. fdisk is actually pretty simple if you can put the setup in your head.
I’m still learning scripting but one of the things you discover during an install is that you have a lt of time. I wrote a script that mounts my partitions.
#!/bin/bash
# Script to mount partitions from Gentoo Minimal Install CD.
if ls /mnt/gentoo | grep * > /dev/null
then echo " * Devices aleady mounted, unmounting..."
if ls /mnt/gentoo | grep boot > /dev/null
then umount /mnt/gentoo/boot
echo " * /boot unounted."
fi
if ls /mnt/gentoo | grep home > /dev/null
then umount /mnt/gentoo/home
echo " * /home unmounted."
fi
if ls /mnt/gentoo | grep proc > /dev/null
then umount /mnt/gentoo/proc
echo " * /proc unmounted."
fi
if ls /mnt/gentoo | grep dev > /dev/null
then umount /mnt/gentoo/dev
echo " * /dev unmounted."
fi
else echo " * Devices not mounted, mounting..."
mount /dev/sda2 /mnt/gentoo
if ls /mnt/gentoo | grep boot > /dev/null
then echo " * /boot directory already created."
else mkdir /mnt/gentoo/boot
fi
if ls /mnt/gentoo | grep home > /dev/null
then echo " * /home directory already created."
else mkdir /mnt/gentoo/home
fi
if ls /mnt/gentoo | grep proc > /dev/null
then echo " * /proc directory already created."
else mkdir /mnt/gentoo/proc
fi
if ls /mnt/gentoo | grep dev > /dev/null
then echo " * /dev directory already created."
else mkdir /mnt/gentoo/dev
fi
mount /dev/sda1 /mnt/gentoo/boot
mount /dev/sda3 /mnt/gentoo/home
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
fi
The script is designed to also dismount but needs more work.
I’ll talk more of reinstalling tomorrow.
Restoring System
I’ve been gone the last few days because I’ve done an enormous effort to repair my failing computer. I just recently got my desktop restored. I’ll write in a little bit.
A Little Soul
Anybody knows me knows I love the Blues. And for something as awesome as a Blues lick, I need a player just as good. I jumped into the merits of MPD yesterday – lightweight, fast. But didn’t mention on any clients to use with it.
I touched on Sonata in a previous sitdown. Sonata’s a nice GUI client for MPD. I wrote that Sonata has the finest GUI in the business. Having come from Rhythmbox and Exaie it was nice to see a client that didnt hog the entire screen. Sonata has the ability to do radio streams on the net as well.
The next two MPD clients I tried, Gimmix and GMPC, aren’t as feature complete as Sonata, this leaves Sonata as the GUI champ, but they have their own.

Gimmix is coded in C and GMPC, well I’m not sure, but both take ittle time to load. I’ll start with Gimmix.

Since MPD is a daemon my music directory was already set. Gimmix asked me to define the settings which just confused me, so I bypassed the setup.
Gimmix started nearly instantaneously. I’m used to waiting a bit for my music player to start, with Gimmix… nothing. Absolutely amazing. This helps people like me that forget what song they like to listen waiting for a program to start. Besides this though, unfortunately, Gimmix feel short. Gimmix wasn’t real intuitive for me to learn. After a bit of searching I discovered you have to hit the + to find your music collection.
So, then I setup the library window size and position but Gimmix doesn’t want to save it.
Then I do finagle all my settings, open the library, add music the the player and, CRASH! A little bug, but I discover that the “play music immediately” preference setting causes this.

So Gimmix had it’s issues, hopefully the author will release another version soon, as being written in C, it feels solid. As I entered the bug I noticed a couple of the previous issues had been resolved, so..
With the Gimmix tiny straw, I decided to try GMPC.
GMPC started nearly as quickly. This is becoming a nice feature to me. Though how much I Sonata is champ of GUI, it’s dependency of python doesn’t allow for quick startups. I saw this too with Exaile. I’m not sure what GMPC is written in but it feels nearly as responsive as Gimmix did. GMPC has more features than Gimmix, for one a library thats integrated and plugin support.

I am happy to say that GMPC is my new music player As I mentioned before, I can’t play radio streams from the net with it, which is a big bug for me, otherwise I’m pretty happy. Only thing I had a trouble about is that I could find a place to have GMPC stop the music when I exit GMPC.
Fixing MPD
Once before I had installed MPD, and once before I really liked it. But as always with updates something had to be stuborn. I honestly hadn’t noticed the breakage until I tried to play some music recently with Sonata. I have Sonata configured as to search for new audio on every load up. This time I had added new audio to the music folder and this time I got zip – the playlist showed, well… empty. I looked into /var/lib/mpd/database and sure enough it the listing blanked.
It had been awhile since I installed the Music Player Daemon originally, and though I usually take notes of the process i didn’t’ remember to and I was at a loss at how to repair it. With the Gentoo LInux Wiki down last week, I was at a total loss.
Fixing MPD
The Music Player Daemon for those of you who haven’t tried it, heard it, is exactly as it states: a constant running process on your computer that’s able to play music. I should not say “your” however because many people use MPD on server and listen to audio over a network. What I’m talking about here is setting up MPD as a local daemon as opposed to a remote daemon. Why do this? MPD provides an absurdly low CPU usage and since it is continually running near to zero startup times. Using MPD as a local daemon as opposed to the remote daemon, though both processes will be similar, is different enough. I’ll start at the very beginning.
Install MPD
emerge mpd
Setting Permissions
This is what I had forgotten so many months ago. MPD looks at it’s configuration files and requires them to belong to the audio group and also to the owner listed in the configuration file. I saw this as odd as I failed to see why a daemon needs permissions since it runs as root. This is reasonable I learned if you use MPD as it was originally intended: as a remote daemon. An MPD server would create a user “mpd” and hence have all the proper settings to begin distributing sound. I might argue that MPD is probably installed as a local daemon more often then it is as a remote one…
Verify these exist:
/var/lib/mpd/music
/var/lib/mpd/playlists
/var/lib/mpd/database
/var/log/mpd/mpd.log
/var/log/mpd/mpd.error.log
The database will need to be created.
echo > /var/lib/mpd/database
As well as a pid file (I’ll talk about that in a bit.)
echo > /var/run/mpd/mpd.pid
All these files and folders must have the correct permissions. They need belong to owner:group – youruser:audio.
chown user:audio /var/lib/mpd/* /var/log/mpd/* /var/run/mpd/*
Now we need to tell MPD where to find your audio directory
cd /var/lib/mpd/music
ln -s /home/user/My\ Audio
Setting the Configuration
nano /etc/mpd.conf
There a few details here that will need to be set to have MPD work nicely
To begin make sure info of the pid file is commented out, this is necessary to the init-script to close correctly.
Now replace your username. Since we won’t be running MPD as a separate user we need to set “mpd” for our own.
Configure audio output if you know all the details otherwise the driver settings will be used (which is what you want for most cases.).
Create the Music Database
Now we should have all the settings need to build a proper database.
mpd --create-db
Start the Daemon
/etc/init.d/mpd start
Add the daemon to the run-level
rc-update add mpd default
Troubleshooting MPD
Setting a pid file as a local daemon is little tricky. MPD wants a Personal ID file which is important to close MPD., whether it’s needed or not… In my personal opinion this is an over-site of MPD as it does not create a new pid on initializing but requires one to shutdown. To add the the dilemma, MPD will delete pid on shutdown, meaning that we will have to make one each time MPD is started. The only solution I’ve found to reasonably fix this is to edit the boot script.
nano /etc/init.d/mpd
And add in the checkconfig section:
echo > /var/run/mpd/mpd.pid
chown user:audio /var/run/mpd/mpd.pid
Picking a Client
Since MPD is a daemon it will not play the music directly, we need a client for that. The MPD wiki offers a good number of them.
Questions
I’ve heard of MPD using a ~.mpdconf. Has anyone tried this? How does it work?
The Fuss about Fusion.
The new exciting buzz in LInux is Compiz-Fusion. Though still almost the same as previous, it’s been branded new. Actually the re-emergence of Compiz-Fusion is pretty significant. Once divided by separating interests it now has re-coalesced into something wonderful. I mean it. Yeah it’s still pretty much alpha, and it will likely still crash on you, but we’re beginning to see something with applicable potential.
I had abandoned previously attempts of Compiz-0.5.0 and a very early version of Fusion. The largest distraction was that sometimes I’m forced to kill the desktop, and many times it would just hang. Now I’ve gotten around this with Fusion. Settings are no longer a problem and seem to work as expected. And I can play games with Fusion running, something I’ve haven’t been able to do before. I’m not gonna rehash what I’ve already said, instead I will point you to the howto i wrote on the subject. Enjoy! And have a laxing 2 days!
Love Linux Games
I love a good battle. Thats all thats really important, in you know me. Some say, winnings the only thing, nahhh, a decent challenge is all we need.
I remember still the games I used to play with my Dad. He always made it fun to play, he always kept it interesting and challenging.
And so that leads me to last… night, playing my favorite online-game, Continuum ( See my HowTo’s on what one needs to install it ). I was pummeled mercilessly, but I’ll try to think that it’s the challenge that counts. This can also be said for ET, Enemy Territory which I’m just starting. Once you get the little details right, its a piece of cake.
Since the source logic for ET went public, finding the settings can be difficult. ET doesn’t have one settings-file, it has many. Mods in ET have their own settings, and, exponetially, each profile in these mods do as well. You’ll soon discover that you have dozens and dozens of settings.
The best way to deal with this is to create an autoexec.cfg. This is a file you can place all the settings you want and can call up anytime. Place the file in ~/.etwolf/etmain. To see some of the settings look at your etconfig.cfg. Yeah, there’s tons and tons of settings. Place whatever values you like in the autoexec.cfg.
Heres some more important ones.
Type /modelist from the console to see available screen modes. -1 for custom.
set r_mode -1
set r_customwidth "1024"
set r_customheight "768"
Sound and music effects
set s_musicvolume "0.114583"
set s_volume "0.156250"
Higher values are better for better frames per second
set r_picmip 3 // Texture Detail
set r_picmip2 2 // Not sure what it is but it improves FPS
The mouse can be very sensitive
set sensitivity "2" //1-32 Higher is more sensitive
set m_pitch 0.016 // make looking up & down slower.
Limit Bobbing, the up and down movement while running.
set cg_bobroll "0.002"
set cg_bobpitch "0.002"
set cg_bobup "0.005"
set cg_bobyaw "0.002"
set cg_runpitch in 0.002
set cg_runroll in 0.005
Now punkbuster will limit some of these values so that some people don’t gain an unfair edge. Always check your console before playing in an arena and see that all cvar checks clear.
To be you will probably have to tell ET of the new settings for every new mod and profile ( unless you want to erase the profiles and begin all over. ) You can do that in each arena by typing in the console
/exec autoexec.cfg
Playing a game with fair settings is what it’s all about – the decent challenge, no matter what the outcome as long as you play with people you trust and like, you will be enjoying oneself. Those pickup games with my Dad I’ll always think of. Now I’m going to, like we always did after our pickup games, have a Big Mac.
Late late.
New Router … done!
We get pretty spoiled when it comes to electronics. The newer the item, the easier it becomes. These days this means that items can almost configure themselves and sometimes do.
When I say new router I actually mean new for me. I’m junking the old one. phht garbage. That’s kinda been me these days, scrapping the new and going legacy. Thing is, I wasnt sure how spoiled I was. After the ups and downs of setting up a router the first time ( I didn’t acknowledge that router for weeks ) I feel pretty knowledgeable around computers, but when it comes to networking… I’ll leave that for my brother. The new router would have been easy to setup if I had done my research first, but with novelties for me it has always been best to do the cold water plunge, or else never do it.
Now this simple setup I had for the new router I turned into a script to run at boot ( The Gentoo Init script only worked periodically connecting to networks. ) It was one of my first scripts and I was quite proud of it. However the new (ok old) router didn’t take too well to this script at all. It would connect just fine, but drop intermittently. It was like being on grippy terra firm and going straight to ice, and it was never that predictable.
Well, I think I now have this connection going pretty well now. I discovered there are many other options you can enter using wireless-tools. MadWifi’s wiki was an excellent resource in assisting me with this. The main problem was that wireless-tools was just using the same standard that my card was ( 802.11g ) not the previous standard that the router was using ( 802.11b ). They two are supposed to be compatible but I found out this is not the case.
I haven’t tested it completely, but it already fells a ton better.
Blog Tips
I started myself blogging with a grimace most commonly seen when a person scrapes their fingernail across a chalkboard. I had zero propensity to do it. Though, I considered myself a fair writer ( don’t we all? ) I considered it a chore, something that people become obligated to. Eventually the urge to give back won. When I started I gradually grew in confidence and then began thinking all of my words were golden. The one big tip to a blogger – they’re not. I’ve been looking over a few of my past blogs – as much as I like to read my own writing (rolleyes) – and began to think that maybe what I read at O’Reilly’s is was true: I’m not as good a blogger as I thought. Spencer Critchley writes that not all blogging is journalism and that not all blogging is good blogging. Like it or not, blogging as journalism, and the law is beginning to show this. Bloggers are journalists, i.e. we have an obligation to the public. This means not only journalism ethics but most importantly considering other people.
Some things I learned.
- Keep it short
Not everyone wants to hear every detail. What is often fascinating to you is someone else that needs to check their email soon.
- Never ever rant.
Professional journalist can get away with this sometimes. If you’re new, its the most likely way that someone will stop visiting your page.
- Is this a diary or a publication?
Some writers just seem to be venting but is it anything interesting? Sometimes it is. This one from White’s page is venting but you can tell that the person is actually telling an interesting story. I always enjoy visiting this site.
- Try and post regular and quality is #1.
I very very guilty of this one. I’ve read some of my previous posts and I realized that sometimes I just wrote things because I felt obligated to. Some were even decent subjects but totally splatted. If you don’t feel the urge, don’t do it, otherwise just do it once, twice a week and let the viewers know it.
- Proof read
Yes, I’m gonna be your 4th grade teacher here. But it’s important. People sometimes will stop reading if they can’t figure out a the meaning of a sentence. Proof read once only too. We can always find little bits to improve, but this usually destroys the whole.
- And the last bit…
“If you find an adjective, kill it.” Thats what Mark Twain said. I had to tell a popular newsletter of it this week. Let the viewers decide.
Someone’s Sleepy
I discovered this past week that I wasn’t the only one sleeping at odd hours. I discovered our regular over caffeined-lovin’ tux could too be caught taking a nap. I got the idea from some suspend tools located in the kernel. Since Linux at times seems centered around servers, us laptops users notice it most, I created this dude to help Linux power management.

I bandied about the license for the awhile and discovered Creative Commons seems to be working for a lot of different artists. It offers variations from free-use to commercial, to alterable to fixed. I choose the Attribution-NonCommercial-ShareAlike 3.0 Unported. Which looks to be a nice fit with the Linux style – non commercial use and alterations must be shared.
—
I mentioned last week that font rendering could be improved by setting the correct DPI for you monitor. I want to show you what it looks like, here’s the original, and the improved version:

and

You dont’ really even notice it ( besides aesthetically ) it until you look closer.

and

It amazing what a keen eye it takes, you can see what I mean when I said I thought the original is fine… I hadn’t any idea the dpi settings were off. Obviously Linux fonts don’t look anywhere near as good as the clearlook fonts we see in MS, too many patents in the way of that ever happening. But it’s nice to have something. :)
Tomorrow I’ll be talking about tips for journalists ( yes, us bloggers ).
A Repository for Linux… hmm.
I remember a little while back famed Linux neo-avant Mark Shuttlesworth remarked about eventually needed to create a central repository for Linux development. I’m sure we’ve all had this thought at some time but people like Shuttlesworth can make it happen. I’ve talked about this earlier and it would truly help, I believe, overlapping resources. Since Linux distros aren’t really serious business cut-throat types, almost every distro I would guess shares about 90%+ of the code, having a central-repo makes sense. Ron Hovsepian, the Novell CEO, talked of this too. Despite Novells having aligned themeselves to a non-open-source partner, I still sense that Novell’s interest in Linux is genuine. Ron spoke that if Linux doesn’t do this he fears that Linux could fracture like the previous generatoins *nix’s did. Yes he fears that. I personally think this is overblown. And a little too paranoid. Linux being forked? I think the only way that could happen is if someone found a way that Linux could be used commercially, i.e. for a profit, and break compatibility. This would be extremely tough to do as the GPL and other such licenses, and the very basic Foundation of Linux itself is compatibility. Nonetheless, a central repository would be nice and I think most people would agree on the. In fact creating a central repository may be the thing that could fracture Linux the most ( but not in the important way ). With a solid base, I think you would see distros become more unique and the would be better able to create software directly for what their customers want instead of having to consolidate the base all the time.
Just ramblings.
Fonts and DPI
Making nice looking fonts on your screen takes a little bit on know how. A great help to improve the fonts is to learn the correct DPI for your screen. When a person in the forums mentioned that my fonts looked fuzzy, I never considered the the DPI was set incorrectly for my monitor. The problem was that I had been using the original DPI the X server choose when installed and the X server doesn’t always know how to the correct value. If the X server cannot determine the size of the screen it will set a default value and your fonts will appear hazy.
First place to look to find the DPI for the monitor, is in the user guide that came with your computer or the manufactures website may also have this information. However, if it isn’t it isn’t very difficult to figure out.
First see if X recognizes the monitor’s physical size:
xdpyinfo | grep dimensions
If X server knows this value, then it can calculate the correct DPI. If the dimensions are correct then the correct DPI will be calculated:
xdpyinfo | grep resolution grep DPI /var/log/Xorg.0.log
The X server will default to 75×75 if it cannot discover a value. If the DPIs are wrong, you’ll have to tell X server the correct dimension of your monitor. Since most specifications now just list the diagonal length of the screen, I’m going to use that. The MacBook I use has a 13.3″ (diagonal) LCD screen with 1280 x 800 resolution. With the Pythagorean theorem you can discover your horizontal and vertical measurements.
Using bc (a command line calculator) this will give us the diagonal resolution:
echo 'scale=5;sqrt(1280^2+800^2)' | bc
Using the diagonal length divided by the diagonal resolution will give the aspect percentage and multiplying as aspect percentage times the horizontal and vertical resolutions will give the monitor’s horizontal and vertical lengths.
echo 'scale=5;(13.3/1509)*1280' | bc 11.27680 echo 'scale=5;(13.3/1509)*800' | bc 7.04800
With this I know my monitors physical dimensions are 11.27680 wide by 7.04800 high. Now X server needs to be told of these values. X server doesn’t use inches though and the values has to be calculated for metric. I like to do this with Google, just type in “11.2768 inches in millimeters”.
Now tell X server in whole values in the “/etc/X11/xorg.conf” file in the Monitor section:
Section "Monitor"
Identifier "Monitor0"
DisplaySize 286 179
Kill the X server and restart and the new values for DPI will take effect.
Gnome and KDE have their own DPI settings that might override the correct DPI. Gnome only has the ability to set one value for DPI, if horizontal and vertical DPI differ, choose a medium in between. In KDE 4, users have the ability to disabled KDE’s DPI setting and use the X servers.
Fonts and Web Browsers
Firefox in particular, has a built-in way of how it renders fonts, so fonts in Firefox may not look as good as your other applications. To set up sizes of fonts in your web browser a good way is to set the fonts to corresponding css values. Adjust what regular size reading font you want in your web browser with the corresponding to font size medium in css samples, and set xx-small to the smallest readable size.
Thanks
Thanks to Padaa for showing me that my fonts weren’t up snuff, though I berated him for getting off topic ;) .

