Archive for April, 2006

Installing Grub on software RAID 1

Wednesday, April 19th, 2006

I have recently run into an issue where I needed to reinstall grub after an install. The problem was that the server was running software RAID 1 on a Redhat Enterprise Linux 4 server and the grub-install command doesn’t support software RAID. To fix this issue, I manually booted the server. Then, I simply ran the grub command to get into the grub shell. Once in there the steps were simple. At the prompt you will need to fist type the following.

root(hd0,0)

The first 0 referrs to the actual drive, and the second 0 referrers to the partition. So, for this example you would be referring to /dev/hda1 which is where your /boot directory resides. Now you will need to actually set up grub. For this you will use the following command.

setup (hd0)

Once you execute this command it will run through the install and everything will be installed correctly.

Generating SSH Keys

Tuesday, April 18th, 2006

This is a quick little how to for getting ssh keys working.

First you will need to generate the keys. The default is 2048 bytes which should be sufficient. You can specify a different value by using the -b option. The -t option is so that you create an SSH2 key and not an SSH1 key. I like to use a passphrase for some extra security; however, you can leave the passphrase blank if you do not want to use one. Not recommended though.

Use the following command.

ssh-keygen -t rsa

gerard@despondency:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gerard/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gerard/.ssh/id_rsa.
Your public key has been saved in /home/gerard/.ssh/id_rsa.pub.
The key fingerprint is:
8a:28:a4:4e:d6:a1:7c:9b:38:d4:1c:19:82:a9:ef:ca gerard@despondency

This will create two files id_rsa and id_rsa.pub unless you have specified a different file name. The file with the .pub extension is your public key which you should put on the client systems which I will explain later. The one without the .pub extension is your private key which you should guard with your life!

Now you will need to distribute the public keys to the destination systems. The easiest way is to use ssh-copy-id . You will use a command similar to the following.

ssh-copy-id -i .ssh/id_rsa.pub gerard@192.168.xxx.xxx

Using this command you will need to use -i then the name of the file which contains the public key you would like to distribute. Then, the destination is where you would like to SCP the public key to.

gerard@despondency:~$ ssh-copy-id -i .ssh/id_rsa.pub root@192.168.xxx.xxx
15
root@192.168.30.45’s password:
Now try logging into the machine, with “ssh ‘root@192.168.xxx.xxx’”, and check in:
.ssh/authorized_keys

to make sure we haven’t added extra keys that you weren’t expecting.

Random desktop background

Sunday, April 16th, 2006

Well, I have a directory with a bunch of backgrounds, and I like to have it change pretty often because I get bored with the scenery :) . So I figured I would make a script to randomly select an image and change the background. Then I added it to the crontab so now I have a different background every hour.

All you need is to change /home/gerard/wpaper with whatever your directory is.

#/bin/bash
imagedir=/home/gerard/wpaper
count=`ls $imagedir|wc -l`
let “pick = $RANDOM % $count”
let “pick += 1″
image=`ls $imagedir|sed -n “$pick”p`
Esetroot -scale $imagedir/$image

CVS pserver

Sunday, April 16th, 2006

I set up my server on my Libranet server which is based on Debian. I am using Sarge sources. If you are running a different distribution, some files may differ but are essentially the same.

First you need to install CVS if it is not already installed. Type apt-get install cvs.
Once the server is installed you would want to make sure that you check the /etc/services and /etc/inetd.conf

This is /etc/services.

cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations

This is /etc/inetd.conf
cvspserver stream tcp nowait root /usr/sbin/tcpd /usr/bin/cvs –allow-root=/home/cvs/rep pserver

Next, you will need to create the repository directory. This is where your projects will reside, you can put it anywhere you want and call it whatever you want. I chose to put it in /home/cvs/rep. Also when creating this directory you want to make sure that the user that will be using this has ample permissions to the directory.

Depending on which shell you use you will need to set your environment variables for the cvs. I use bash so I will need to edit my ~/bashrc file and add the lines for the CVSROOT variable.

Here is an example for the local machine.

CVSROOT=”/home/cvs/rep”
export CVSROOT

Here is a remote example.

CVSROOT=”:pserver:username@servername:/home/cvs/rep”
export CVSROOT

Next you want to initialize the repository. You want to make sure you run this as the CVS user.

cvs -d /home/cvs/rep init

Now, everything should be working. It’s time to add projects to the repository. The way I like to do it is as follows.
Create a directory, or you can copy an existing directory with files. for example lets use ~/devslash.

mkdir devslash
cd devslash
cvs import devslash devslash start

Everything should be in your repository now under the directory of devslash. If you want to make sure, go into an empty directory and type cvs checkout devslash and all of the files should propagate down.

That should be enough to get you going. If you have any other questions or need more help you can get me as always by email.

Extra mouse buttons

Saturday, April 15th, 2006

Ok, so I have a mouse with extra buttons. And as you can guess I wanted to use them to go back and forward in a browser and such. Here is the configuration I have whipped up. At current I have a Microsoft IntelliMouse Optical. But I assume this will work with most mice.

First you will need to edit the /etc/X11/XF86Config-4 file.

Section “InputDevice”
Identifier “Default Mouse”
Driver “mouse”
Option “CorePointer”
Option “Protocol” “ExplorerPS/2″
Option “Device” “/dev/input/mice”
Option “Buttons” “7″
Option “ZAxisMapping” “6 7″
EndSection

Now you will need to edit your .imwheelrc file.

“.*”
None, Left, Alt_L|Left
None, Right, Alt_L|Right

You can edit this file to do whatever you would like the extra buttons to do. This configuration will make just about every program go back or forward. Which is what Alt and the left arrow would do. Next, you will need to run the following lines.

xmodmap -e “pointer = 1 2 3 6 7 4 5″
imwheel -b 0067

You will need to run this basically every time you log in or you can put it in your startup files. I run gdm so I added the lines to my session file. This is actually a lot simpler to set up the I thought it would be.

Weird Background

Saturday, April 15th, 2006

Old Debian KDE Screen Shot

This is an old screenshot that I had but it is such a weird background that I had to share again.

Google Maps

Saturday, April 15th, 2006

Currently I am playing with Google maps, which you can read more about here if you are interested. I have created a user submission model and map for a bar site in NJ. If you would like to take a look, visit this site. Google has some great ideas which all seem to lead to a higher purpose. They all seem to fit like pieces to a big puzzle.

I believe that Google introducing Gmail was a great idea to get users to log in and give their information. This now leads to Google home and other various projects. That was the easiest way to get users to log in. Also, this leads to demographic information that users are now volunteering. Now, I know Google has a “do no evil policy” but, where is the line drawn?

First Post

Saturday, April 15th, 2006

I have currently switched from my old site to a bloging type site to make posting easier. The old site is still available here, http://www.devslash.org/devarchive/