Thursday, March 31, 2011

running more than one linux distribution without rebooting ...

My laptop has reached Nirvana with Debian Squeeze, everything works out of the box, and I very happy with the stability of the system. I don't feel the software is outdated, because I anyway install some applications I need or like directly from source.
However, I still want to be able to run Debian testing, and see how my system evolves. Enter "chroot".

With chroot I can run more that one Linux Distro and more than one X-Server with out the need to stop my work and reboot my laptop. This is just great.

Here is how to do it, assuming you already have a partition with a Debian installed on in do the following (if you don't have a partition with Debian installed, I suggest you take a look at "debootstrap"):

1. First make a location where you will work as the root of the new debian, in my case:
$ su -
# mkdir /debian-sec
2. now mount that partition, in my case /dev/sda5:
mount /dev/sda5 /debian-sec
3. enable important devices so the new Debian will work as expected.
mount -o bind /proc /debian-sec/proc
mount -o bind /dev/ /debian-sec/dev/ 
mount /dev/pts /debian-sec/dev/pts -t devpts 
mount -t sysfs /sysfs/ /debian-sec/sys 
4. finally change the root with chroot:
chroot /debian-sec/ /bin/bash
If you want to run a secondary X-Server, do the following inside the chroot:
chroot # vi /etc/gdm/gdm.conf # do s/vt7/vt9/ in [servers] section
chroot # /etc/init.d/gdm start
this will start another X-Server on vt9, to which you can switch with Alt+Ctrl+F9.

Cheerios, Linux and Debian !

UPDATE: The last section about GDM in chroot seems not to work in gdm3...
with gdm3:

chroot # vim /usr/share/gdm/gdm.schemas

change the following keys:
   <schema>
      <key>daemon/FirstVT</key>
      <signature>i</signature>
      <default>9</default>
    </schema>



What does work ?

Switch to tty1, login as root, and chroot into the chrooted debian.
Then chanage to with "su - "

now start the X server as the following:
startx /usr/bin/fluxbox -- :1&
or
startx /usr/bin/gnome-session -- :1&
or
startx  -- :1&


Friday, March 25, 2011

'yes,yes' we can ... on the usefull linux command ...

Recently I started building my own LFS, I was pretty amused by the command 'yes'...

However, today I found a use for that command, when I had to install a binary firmware on multiple servers. The binary is not editable and  expects two times 'yes' to finish the process.
So, the solution is to run on all the computers the following command inside a loop :
'yes | sh binary_firmware.exe' - also, this is a simple example a of parallel programming and pipes.

This little trick saved me quite some typing and waiting in front of the computer !


Thursday, March 03, 2011

Matlab Alternative: RStudio

To the list of great Matlab alternative I add today RSTUDIO.
Although, I usually don't program in R, I am glad to see it is not freezing, and continuously develop as a scientific interested language. I am guessing that this fancy IDE for R, would make it easier to accept among people who are deeply rooted in the EXCELLENT MATLAB IDE.
However, doing most of my scientific tasks, and system administration in python, I think Matlab's syntax is equally weird to that of R ;-).

One weird choice of the developers is to call the binary rdesktop instead of rstudio... Maybe they don't know about rdesktop
which is familiar to most system administrators ... oh, well, I guess I'll have to open a bug ...

Saturday, February 26, 2011

Network-manager still sucks !

I have been long complaining about the buggy network-manager included in GNOME. Today, I have (re)discovered I am still unable to use Network-Manager to connect to a WPA secured wirless...
Being too lazy to look up why on a clean install of Debian Mint Linux Edition, Network-Manager is still retarded, I opted to the following solution:

apt-get --purge remove network-manager && apt-get install wicd wicd-gtk

So long, Network-Manager!

Friday, February 25, 2011

oh, Yesterday I was a bad programmer ...

Forgetting my first lesson in programming, I looked for a solution to convert IP addresses to country. I found out tables, and SQL files, and went on and on trying to figure how to use them, and do SQL in python...
Until, I remembered that a good programmer should not re-invent what has been invented.
And then I looked around and found: pygeoip.
I honestly felt sorry for the time I wasted on that problem ...

Friday, February 18, 2011

Hey, I actually like the new Blogger

It used to really suck, but my two hours of playing with it made me change my feeling about it.
I have almost as much control as I have with my own WordrPress instance! This is AWESOME ! And I can even link it to my google adsense very easily.
Thanks Google for making a great job !
Wow, Long time ago ... My last post ages ago was a rant about Uhbuntu ...
Needless to say that since then, I have quit using Uhbunutu as my main Desktop, and moved to Debian and ArchLinux. I also play extensively with OpenBSD and FreeBSD, and at work my workstation is OpenSUSE from which I maintain mostly CentOS servers. But no Uhbuntu ...