Monday, July 20, 2009
VirtualBox Configuration
https://help.ubuntu.com/community/VirtualBox
Note that when configuring networking the hosts may not be able to ping each other but network applications works perfectly
Saturday, July 18, 2009
Installing ATI Radeon HD2600 propriatory driver on Debian/Lenny
$mkdir fglrx
$cp ati-driver-installer-9-6-x86.x86_64.run fglrx/
$cd fglrx
$chmod +x ati-driver-installer-9-6-x86.x86_64.run
$./ati-driver-installer-9-6-x86.x86_64.run --buildpkg Debian/lenny
$ su
#dpkg -i *.deb
Reboot the system for single user mode
#apt-get install build-essential linux-headers-$(uname -r) module-assistant
#m-a prepare
#m-a a-i fglrx
#modprobe -v fglrx
If this is the first installation
#dpkg-reconfigure xserver-xorg
Thursday, July 9, 2009
Statistical Data Collection and Analysis Tools for Linux
1. R - http://www.r-project.org/
2. PSPP - http://www.gnu.org/software/pspp/
3. SOFA - Statistics Open For All - http://www.sofastatistics.com/home.php
Installing R
R is available in universe repositories. But if you want to get the latest version then you have to add a repository as follows.
Add a repository to your /etc/apt/sources.list file
deb http://ftp.sunet.se/pub/lang/CRAN
You can select a suitable mirror from the following list of mirrors
http://cran.r-project.org/mirrors.html
Then you have to update your package list
sudo apt-get update
Now you are ready to install R into your system
sudo apt-get install r-base
Now it is time to install GUI for r-base called R Commander
sudo R
install.packages("Rcmdr", dependencies=TRUE)
When you want to update your R then it is simple as this
>update.packages(lib.loc = "/usr/local/lib/R/site-library")
Installing PSPP
PSPP is also available in Ubuntu repositories.
sudo apt-get install pspp
Installing SOFA
wget http://www.vislab.uq.edu.au/debuntu/uqvislab-pubkey.asc
sudo apt-key add uqvislab-pubkey.asc
sudo apt-get update
wget http://www.vislab.uq.edu.au/debuntu/uqvislab-pubkey.asc -O - | sudo apt-key add -
sudo wget http://www.vislab.uq.edu.au/debuntu/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/uqvislab.list
sudo apt-get update
sudo wget http://www.vislab.uq.edu.au/debuntu/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/uqvislab.list
sudo apt-get install python-webkitwx
Download SOFA from http://www.sofastatistics.com/downloads.php
Double click on the downloaded file and install
Wednesday, February 25, 2009
Mother Nature
Today, I needed to get wheel barrow to bring some wood. As the case in most houses, my wheel barrow was also filled with some junk. I picked out one peace of the stuff at a time to unload the wheel barrow and I was in a hurry. Suddenly a mouse jumped off from it an ran away. Then I heard some noises from under the stuff loaded in the wheel barrow. I continued the cleaning and I found 5 mouse kids who are not even had their eyelids open. I was really worried about what I have done and I picked them and placed them in a box with the garbage that the mouse had make in the same place where the wheel barrow was. I was really worried about that mother who left her children will not come back as I cleaned the things up.
After some time we heard some noise from the place we left the mouse kiddies. Oh, mom has come to pick her babies and she is hanging around. After few hours we checked for little mouse kiddies and found that mother mouse has taken her children away from that place.
See how wonderful. But why some of the women are not gifted by such a gift which gives them the courage and feeling to protect their children. Also it is worth to remember that life cannot be valued regardless of being a human or other living being.
Tuesday, February 10, 2009
Dual booting using Windows Vista boot loader
dd if=/dev/sda5 of=/dev/sdb1/boot.lnx
I plugged my pen drive and directly copied the file into it. Then unmount pen drive from the system and rebooted the system into Windows Vista. Get a command line interface by right clicking on the application icon from the menu bar and choosing "Run as Administrator". Then execute following commands ...
bcdedit.exe /create {ntldr} /d "GNU/LInux Ubuntu"
This will create a legacy boot loader entry
bcdedit.exe /set {ntldr} device boot
This will declare it as it contains a bootable system
bcdedit.exe /set {ntldr} path /Windows/system32/boot.lnx
This will set the path of the bootable image. Note that it only worked for me when I copied the boot.lnx file into /Windows/system32/
bcdedit.exe /displayorder {ntldr} /addfirst
This will set this boot option to appear at first line
bcdedit.exe /default {ntldr}
This will make Ubuntu system as default booted system
OK if you have successfully created the entry reboot and see it work ...
If you already have a Windows Xp also installed in your machine then creating an ntldr will not be allowed as it may have been already created. Then you can use one of the following options. I recommend the second option.
1st Option
Open a command line same as above and you have to have the boot.lnx file with you.
bcdedit.exe /copy {ntldr} /d "GNU/Linux Ubuntu"
This will copy a legacy boot loader entry to new one and give you an ID for that for further configurations. and the ID would be something like {81ed7925-47ee-11db-bd26-cbb4e160eb27} I will refer to it as .:ID:. hereafter
bcdedit.exe /set .:ID:. device boot
This will declare it as it contains a bootable system
bcdedit.exe /set .:ID:. path /Windows/system32/boot.lnx
bcdedit.exe /displayorder .:ID:. /addfirst
bcdedit.exe /default .:ID:.
2nd Option
bcdedit.exe /create /d "GNU/Linux Ubuntu" /application BOOTSECTOR
This will create a location to hold a bootsector application and give you an ID for that for further configurations. I will refer to it as .:ID:. hereafter
bcdedit.exe /set .:ID:. device boot
bcdedit.exe /set .:ID:. path \boot.lnx
Note that you can copy your boot.lnx boot image into C:/ and use above command to set the path for it.
bcdedit.exe /displayorder .:ID:. /addfirst
bcdedit.exe /default .:ID:.
OK now reboot your system and see it works ....
Oh let's say that you unfortunately rebooted Ubuntu after installing it and then installed Vista which result Ubuntu partitions inaccessible. Don't worry. Then you need to boot your system using a Ubuntu Live CD. Then get a gnome terminal ... execute the following commands..
Find your linux installed "/" partition and mount it.
sudo mount /dev/sda6 /media/disk
If your /boot partition is separated from root partition then you have to mount it also ...
sudo mount /dev/sda5 /media/disk/boot
Then you have to change your root ... using the following command ...
sudo chroot /media/disk
Mount following partitions which are essential to run a system ...
sudo mount /proc
sudo mount /sys
Now you should be able to run above commands as you are in the installed system ...
Openclipart Gallary for cliparts
I hope you know about Inkscape and Openclipart.org. It now has a very good collection of clip arts which may benefit you in your day to day activities. You can found my small collection of open clip arts at Openclipart.org here. It is also a very good way to contribute to open community. enjoy :-D .
Saturday, January 17, 2009
Encrypted USB with Ubuntu 8.10 Installed
OK let's get started ...
First of all boot you Laptop or Desktop with Ubuntu 8.10 Live CD. Then plug in the pen drive which you want to install GNU/Linux (backup all the data before starting this, otherwise you will loss your data forever). Use dmesg to find the device file of your pen drive.
dmesg
In my case it was /dev/sdb
Now it is time to fill your pen drive with some random data. You can use either
dd if=/dev/urandom of=/dev/sdb
or
shred -n 1 -v /dev/sdb
Use fdisk to create a new partition table. If you want to use this pen drive in Windows systems, then you will have to create your first most partition in FAT. If you create it elsewhere then Windows will not give a drive letter for that partition and hence it will be not accessible though Windows systems. In my pen drive I have the following partition table
Name Part Type FS Type Size (MB)
------------------------------------------------------------------------------
sdb1 Primary FAT 2836.52
sdb2 Primary Linux 541.81
sdb5 Logical Linux ext2 111.55
sdb6 Logical Linux 4310.55
sdb7 Logical Linux 326.68Once you finish partitioning you need to create file systems on each partition. Before doing this required encrypted partitions should make encrypted using LUKS. In Ubuntu GNU/Linux there is an application called cryptsetup which will give necessary tools to do this. Therefore installcryptsetupapplication into your Live system.
apt-get install cryptsetup
Load necessary kernel modules to use cryptsetup
modprobe dm-crypt
Now let's create encrypted partitions.
cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdb2
On execution of the above command you will be prompted for a pass phrase. That pass phrase will be use to create necessary encryption keys to encrypt the partition. You may use different keys for different partitions.
cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdb6
After making partitions encrypted you should decrypt and mount those partitions to use them. The following command is used to open and mount LUKS encrypted partition.
cryptsetup luksOpen /dev/sdb2 enc_data
enc_data is the location where encrypted /dev/sdb2 should be mounted. You don't have to create mount points specifically. cryptsetup will do it for you. Newly created mount point can be located at /dev/mapper/ directory. Make sure you remember the corresponding pass phrase for encrypted partitions.
cryptsetup luksOpen /dev/sdb6 enc_root
Now create file systems in partitions using following commands.
mkfs.vfat /dev/sdb1
mkfs.ext3 /dev/mapper/enc_data
mkfs.ext2 /dev/sdb5
mkfs.ext3 /dev/mapper/enc_root
Now your pen drive is ready for installing Ubuntu GNU/Linux. Click on System -> Administration -> Install to begin Ubuntu installation. In the installation process make sure you partition disks manually. Below pictures show how I have allocated partitions for my installation. As you can see in the image, you should not format devices /dev/sdb6 and /dev/sdb7. Instead you should format decrypted devices of those which are located in /dev/mapper/.

At the final stage of your installation process you should give the installation location of grub as /dev/sdb by going into the advanced options.
After successful installation of Ubuntu GNU/Linux system you will be prompted to restart your machine. As we have some more things to do, you should chose to continue with the live CD system.
Making a swap partition to use with your newly installed system is bit different from others. If we create it using the above method then you will have to enter the password at the boot time for decrypting swap partition as well. It is embarrassing to enter too many passwords just to boot your system. So we will use a derived key from enc_root partition to decrypt our swap partition at boot time. It means that once root partition is decrypted the system will decrypt your swap partition seamlessly.
/lib/cryptsetup/scripts/decrypt_derived enc_root | cryptsetup luksFormat /dev/sdb7 --key-file -
Let's decrypt the partition.
/lib/cryptsetup/scripts/decrypt_derived enc_root | cryptsetup luksOpen /dev/sdb7 enc_swap --key-file -
Make it a swap partition.
mkswap /dev/mapper/enc_swap
Now we should make our installed system capable of decrypting our root partition. To do that first we have to chroot to the installed system. Use following commands to change your root.
mkdir /tmp/tmp/
mount /dev/mapper/enc_root /tmp/tmp/
mount /dev/sdb5 /tmp/tmp/boot
chroot /tmp/tmp/
mount -t proc proc /proc
mount -t sysfs sys /sys
Install required packages into the newly installed system.
apt-get update
apt-get install cryptsetup
Now we have to update initramfs with installed new modules. Edit /etc/initramfs-tools/modules and append following modules line by line.
aes-i586
sha256
dm-crypt
Edit /etc/crypttab file and add following lines.
enc_root /dev/sdb6 none luks,retry=1
enc_swap /dev/sdb7 enc_root luks,keyscript=/lib/cryptsetup/scripts/decrypt_derived,retry=1
Edit /etc/fstab and replace encrypted partitions UUID with it's real device name. My /etc/fstab file looks like this.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# my root partition
/dev/mapper/enc_root / ext3 relatime,errors=remount-ro 0 1
# my /boot partition /dev/sdb5
UUID=71500825-460e-4945-8634-04912c7b2999 /boot ext2 relatime 0 2
# my swap partition
/dev/mapper/enc_swap swap swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
Regenerate initram file
update-initramfs -k all -c
Now reboot the system and boot the system with using your pen drive. :-D


