Wednesday, December 26, 2007

/home sweet /home

Last night, I encountered a very horrific situation. I was working on getting Sabayon to actually WORK CORRECTLY, and if you don't know my hard drive layout, I share my /home directory between Ubuntu and Sabayon (this is because it's on a different hard drive). The problem I had with Sabayon was that the application list was gone. I had to run applications by going Alt+F2 (which opens up the "Run Application" dialog box) and typing in it's name. I didn't want to do that, so I set out to figure what was wrong. I started out with a reinstallation of the partition (/home wasn't touched). When I booted back, the applications were still gone, so I decided that the problem lay in the /home partition. Now, I decided to do something that could have gone better. I did a clean reinstall from another partition, and copied all of the contents from there to my /home. Now, many of the programs I had were preserved, but it also overwrote a couple of configuration files that Ubuntu kinda wanted. However, I got many of the applications back in the menu, which was good.

Let's fast forward to when I boot into Ubuntu. Everything initially goes normally, however, once I log in, Gnome looks like crud. I'm missing the top panel and title bars, and there's an error saying that Gnome couldn't find some file. The theme was reverted back to the minimal one, and nothing really worked. I was worried, however, I worked on servers a week ago, so I knew my way around the command line (sorta). So, I go into what's called a virtual terminal (Press Ctrl+Alt+F1 through Ctrl+Alt+F6) and logged in. These are basically ways for you to log in if your GUI goes kapoot. From there, I used irssi to get to IRC (boy am I getting dependent on that) and get some help! Luckily, there was someone (Kr0ntab on #ubuntu-california) who knew how to restore a /home directory. And this is what I'm going to lay out now.

1. Unlock the root user
sudo passwd
and pick a root password. Be sure you do this and not sudo su, and LOG IN as root in a virtual terminal (Ctrl+Alt+F[1-6]).

2. Log out from your user. This means both from X, and any virtual terminals you might be in (type "exit" without quotes).

3. Move your home directory to some backup location:
mv /home/*user* /root/backup
where *user* is your username.

4. Now here comes the fun part, get rid of your home directory:
rm -rf /home/*user*
As always, be careful when you use rm -rf. MAKE SURE you didn't mistype anything.

5. Make sure your home directory is GONE. Do an "ls /home" (without quotes) and make sure that it's not there.

6. Copy a skeleton home directory to your home directory:
cp -r /etc/skel
/home And rename it:
mv /home/skel /home/*user*
7. Now log back in to X and your home directory should be reconfigured to its original state. If you can log in to something that looks like you just installed Ubuntu, you're good so far. Now re-lock the root account for security reasons:
sudo -l
And log out of root.

8. Now you're wondering how you're going to get the settings you worked so hard to tweak. Well, some, you're just going to have to do by hand, but most you can get back. Remember when we backed up the original home directory? Well, go back there and move back files that you know weren't a problem (you wouldn't want to restore that file that broke you system, would you? So be aware of what you're moving back).

After this, it's just a matter of copying and pasting (or dragging and dropping, depends how you like it). Most program configuration files (such as .gaim or .xchat) ought to be fine, and you should be able to replace them. However, try not to replace configuration files (like files that have to do with X), because you might replace the wrong file; and plus, those are settings you could tweak back easily. Don't take that chance.

Well, this is how I saved my home directory. I hope this guide will be of help to you if you ever need it. Hopefully, you won't. And for those of you who enjoy it when I screw something up on my computer, I HOPE YOU'RE HAPPY!!!

Tuesday, December 25, 2007

Happy Holiday!

No, I'm not being a politically-correct corporation which doesn't want to offend anybody. I'm celebrating the Pastafarian holiday of Holiday! The timing of this announcement just HAPPENED to coincide with Christmas. But now, you know the real reason. So, be sure to eat all of the pasta you can this next few weeks, to celebrate his noodliness.

Friday, December 21, 2007


All right everyone, this blog is going to go through a period of spartan looks while I upgrade the blogger template. I started out formatting this blog using just HTML, but now technology has caught up and I'm upgrading to Layout mode, so I can do a lot more interesting stuff without having to know the extreme technical background. However, upgrading deletes all of your customizations, so I'll have to redo them. If I miss something, leave a comment and I'll get back to it. Thanks for your patience!

The Dangerous Book for Boys

Today was the Christmas Shopping day. It was when the stores were getting desperate to sell their goods, and marked many for HUGE sales. However, today, we went to Toys R Us, because there were some small kids who we were looking to buy gifts for. That entire process went well, and we got (what we think) are the perfect gifts for them. However, a certain book at Toys R Us caught my eye, and I looked through it while we traversed the isles. It was called The Dangerous Book for Boys, by Conn and Hal Iggulden. Now, a title like that just begs a passerby to ask "What's so dangerous about it?" And I wasn't an exception.

I opened up the book expecting to find some popular claptrap of modern culture which would be ephemerally lost to the jaws of time after a few years (don't I sound intelligent). But instead, the page contained information about the Battle of the Alamo. I was intrigued, and decided to investigate this book further. Sure enough, the chapter was on major battles of history. I thought that this book seemed to be a beacon of intelligence in an otherwise indifferent store whose wares shifted with the populous's opinion. I looked further in the book, and found that it contained many different types of information, history only being one of them. It had several guides, such as how to fish or tie a knot or even play poker. There was information on meteorology, astronomy, and grammar. There were several topics which I had tried to find information on, that were all compiled in this small, easy-to-read book. They even covered some details of the opposite sex (I found that I need some sports. Being computer-oriented is apparently not as attractive. Well, I didn't say it was PERFECT). I found this book to be an extremely well-compiled guide to being a respectable intellectual!

Unfortunately, I did not buy it. As helpful as it would have been when I was young, I found that I did not have a need for it. And did not know of any others that did (plus, it was pretty expensive. I'd recommend using a coupon on it or getting it on sale). However, for those of you who haven't come up with the perfect gift, consider this. It's the ideal book to give to a budding intellectual. Maybe you need something for a girl: try The Daring Book for Girls. If it's anything like its companion (and the customer reviews say it is), it'll be a great gift.

Now, I shall wait for the intellectual properties of that book to wear off. That's how amazingly edifying it was.

Wednesday, December 19, 2007


During the winter break, I decided to go back to doing work at CENS, and over the last two days, I've had a great deal of training with RAID systems, and I'll probably get some more over the break. For those of you who don't know, RAID stands for "Redundant Array of Inexpensive Disks". The basic purpose of RAIDs are to protect against disk failure. If you're running an array of disks, and one of the disks becomes corrupted, your data is still safe and your computer will keep running. However, you're urged to replace the hard drive, and once you do, everything will be backed up and well until another hard drive croaks.

There are several types of RAIDs. However, the type we did was a RAID1, which involves two hard drives, and one mirroring the other. That way, if one hard drive fails, the other will be an exact copy and can take over. The higher levels of RAIDs involve more complex means of restoring data such at parity and will make for an interesting discussion later on. But now, we're sticking to RAID.

The background of the project is a RAID1 on a Linux Server (A SUN server, I might add). The first part basically entailed getting used to the Linux RAID tool (mdadm) and finding out why one of the hard drives was removed from the RAID. It turned out, when you remove a hard drive, you have to manually re-add it after you put it back. And once you do that, it has to manually rebuild the mirror for an hour or so. So, removing hard drives to test out the RAID is something we quickly decided to do very rarely. The next time we did it was with the second step, getting GRUB to work on it.

The second thing turned out to be much easier than we expected. In order to get GRUB to boot off of a RAID, you just have to put a copy of GRUB on the Master Boot Sectors of BOTH hard drives. And they both have to reference (hd0), because if one is taken off, then the other will be called (hd0) because the first one isn't detected. So we didn't have to even differentiate that between the two GRUB menus. It was much easier than expected.

The third thing is a bit more private, and being done in progress. We're basically re-designing the hard drive to extreme modularity. There are entirely separate partitions of data some of which will be RAIDed, others which will not be. It's quite confusing, and I'll probably have more detail about that later on. But, I hope you enjoyed this update, and yes, I managed to put a picture in a post. Hooray for me!

Friday, December 14, 2007

2007 Environmental Scorecard

Several weeks ago, the California League of Conservation Voters, a powerful lobbyist group in California for the protection of the environment published the California Environmental Scorecard of 2007 (pdf file). This booklet has all of the information about the environmental measures that took place in the California government, and provides a rundown on ALL of the representatives in the California legislatures. Some features are the worst of 2007, which involves budget threats, indifference to the Central Valley Air Quality, and politics which involved the Fish and Game Commissioner being dismissed for sharing research on the impact of lead ammunition on condors (However, lead ammunition hunting has been banned in habitats of the California condor). For more optimism, there is the Best of 2007, which features cleanup of ports, more environmental friendliness among Republicans (but the subject is still HEAVILY partisan), even stronger support among Democrats for the environment, and improvement in organizing people to contact their representative (MAC campaign).

After the best and worst, come the numbers, which are essentially facts about the people of California and their representatives. To see the extreme partisanship in this issue, there were NO republicans who scored ABOVE 50% in the State Assembly or Senate. Meanwhile, there are only 2 Democrats who scored BELOW 50% in the Assembly and only 1 in the Senate. Next comes a list of the bills, which can be read by you. After that, comes the really interesting part. Individual scores for every senator and assemblyman, and the governor. I'm glad Schwarzenegger (I'm now able to spell that correctly the first time) had an improvement of 13%. Now, my senator (Mark Ridley-Thomas) and assemblyperson (Mike Feuer) both have perfect ratings, so I'm happy about that. If you live in California, take a look at this, and see how your senator/assemblyperson does. If they're good, that's great. If they're not, you have some action you can take. And if you don't live in California, well, you can see how the eighth largest economy in the world treats the environment in great detail. I hope you find it at interesting as I did. If you want to have this guide mailed to you, feel free to join the California League of Conservation Voters.

Monday, December 03, 2007

Sun at Ubuntu Live

I recently stumbled upon this podcast on the Sun Developer Network Channel with interviews of key speakers at the Ubuntu Live event last year (technically this year, but you know what I mean). Unfortunately, I haven't had the opportunity to listen to them, but I felt like putting them out there. How can a mixture of Sun and Ubuntu EVER be a bad thing?

Saturday, December 01, 2007

More Good Science Videos

This time, Fresh Brainz has a collection of videos that discuss "Why do people laugh at creationists?". Of this eleven part series, only three are hosted on Fresh Brainz. Those three have to do with Solar System formation, false probabilities, and the fine-tuning argument. Of course, you can watch all eleven by searching "Why do people laugh at creationists?". Enjoy laughing at them!