Friday, October 15, 2010

Generate IPV6 Addresses with BASH

A fast way to generate some IPV6 addresses via BASH, with tool called "wcalc" that will help generating hexadecimal values.
First make sure "Wcalc" package is installed on your system:

root@paul-laptop:~# rpm -qa Wcalc

Next, using bash "for" loop let's generate some addresses (values selected randomly):

root@paul-laptop:~# for i in $(seq 600 610) ;do echo -n '2001:fade:28e1:3712::1'; echo ${i} |wcalc -h|awk -F x '{print $2}';done



Tuesday, October 12, 2010

Reinstall MBR with GRUB stage1

Creating a dual-boot Linux system such as the Red Hat/Debian is a neat way to experiment with both distributions another advantage is  having a fallback point.
A small downside is that the GRUB stage1 information in the MBR can be overwritten by the second install. In our example, Red Hat is installed on the first disk, and Debian is installed on the second. After Debian is installed, however, the Debian GRUB menu is displayed instead of the Red Hat menu that we are used to and that has been customized for our installation.

Let's see how we can solve this issue -

step 1 
Boot to grub CLI

step 2
The root (hd0,0) command sets the (hd0,0) partition as the location of the boot directory. This command tells GRUB in which partition the stage2 and grub.conf or menu.lst files are located.

step 3
The find /boot/grub/stage1 command returned the first stage1 entry it found.
Both disks should have this file. In this instance, GRUB shows the stage1 file from the second disk.Because we want GRUB to format the MBR on the first disk, /dev/hd0 is used.

step 4
The setup (hd0) command writes the MBR of the selected disk or partition.

That's it! The whole process should look like this :