RESEARCHUT
Minds With Innovations

RESEARCHUT - minds with innovations

Search!

Archives

Next Archive Previous Archive

01 Jun - 30 Jun 2005
01 Jul - 31 Jul 2005
01 Aug - 31 Aug 2005
01 Sep - 30 Sep 2005
01 Oct - 31 Oct 2005
01 Dec - 31 Dec 2005
01 Jan - 31 Jan 2006
01 Feb - 28 Feb 2006
01 Mar - 31 Mar 2006
01 Apr - 30 Apr 2006
01 May - 31 May 2006
01 Jun - 30 Jun 2006
01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Oct - 31 Oct 2006
01 Nov - 30 Nov 2006
01 Dec - 31 Dec 2006
01 Jan - 31 Jan 2007
01 Mar - 31 Mar 2007
01 Apr - 30 Apr 2007
01 May - 31 May 2007
01 Jul - 31 Jul 2007
01 Aug - 31 Aug 2007
01 Oct - 31 Oct 2007
01 Nov - 30 Nov 2007
01 Jan - 31 Jan 2008
01 Feb - 29 Feb 2008
01 Mar - 31 Mar 2008
01 Apr - 30 Apr 2008
01 May - 31 May 2008
01 Jun - 30 Jun 2008

Categories

Fun
KDE
Sex
Rant
News
Debian
Romance
Computer
Software
Philosophy
Technology
Programming

About

A space which could be philosophic, energetic, poetic, technic, mantic, idealistic, frenetic and sarcastic at times,
I guess!


Copyright © Ritesh Raj Sarraf

Unless specifically stated otherwise, the information on this page is available under the terms of the
GNU Free Documentation License.

Calendar

« August 2008
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Links

RESEARCHUT
Technical Consultancy
Photo Gallery
About Me

Last Comments

Ashish Shukla (Boston, MA): So, are you also going to …
Ravi (Boston, MA): How did they allow you? BT…
Ritesh (Lambroghini Drink…): Stopped != Quit Blame th…
Ravi (Lambroghini Drink…): Someone said that you stop…
Ritesh Raj Sarraf… (KDE4 with KDE3): Sorry. One more important …

Powered By

Powered by Pivot - 1.40.5: 'Dreadwind'
XML: RSS Feed
XML: Atom Feed
Pivot Blacklist
Powered by Debian

Linkdump

+ 6 - 4 | § Linux Power Management

I must admit, Linux Power Management is Fuckin' Pathetic.

On a Dell XPS M1210 Laptop with a 6 Cell battery, I get a shitty 15 mins of power backup compared to 2 hrs on Microsoft Windows XP.

And woo, On my IBM T43 running Microsoft Windows XP, I watched a full movie on battery, and it still survived.

The Linux running laptop had no sound enabled.

Yes, Yes Yes!!! As many would say

But hey, Microsoft Windows XP has that too:

 Linux still is way behind for laptop usage     . Used tags:

Keywords: linux_power_management_pathetic

+ 6 - 3 | § ANSI Color Codes

So in the search of finding a simple solution for printing colored text in python, it took me some time to dig up. Most solutions people have done were using curses or some modules. My ultimate intention has always been to cut down on the dependency on the 3rd party modules.

I think the ANSI Color Codes would be good enough for my requirements to print colored text on an ANSI compliant terminal.

The ANSI Terminal Specification gives programs the ability to change the text color or background color.
An ansi code begins with the ESC character [^ (ascii 27) followed by a number (or 2 or more separated by a semicolon) and a letter.

In the case of colour codes, the trailing letter is "m"...

So as an example, we have ESC[31m ... this will change the foreground colour to red.

The codes are as follows:

For Foreground Colors
1m     -     Hicolour (bold) mode
4m     -     Underline (doesn't seem to work)
5m     -     BLINK!!
8m     -     Hidden (same colour as bg)
30m    -    Black
31m    -    Red
32m    -    Green
33m    -    Yellow
34m    -    Blue
35m    -    Magenta
36m    -    Cyan
37m    -    White

For Background Colors

40m    -    Change Background to Black
41m    -    Red
42m    -    Green
43m    -    Yellow
44m    -    Blue
45m    -    Magenta
46m    -    Cyan
47m    -    White

7m     -     Change to Black text on a White bg
0m     -     Turn off all attributes.


Now for example, say I wanted blinking, yellow text on a magenta background... I'd type ESC[45;33;5m

This isn't a complete list of features provided by the ANSI Codes. There are many more....

Used tags:

Keywords: ansi_color_pypt_offline_terminal_command_interpreter

+ 8 - 1 | § Networking in KVM/QEMU

In my previous blog entry, I mentioned about not being able to simply configured networking for the Guest VMs. I feel that area is still unimplemented properly by the GUI wrappers available for KVM/QEMU.

There is a good utility VDE2, which can work great for all your networking needs for the Guest VMs. But unfortunately none of the GUI wrappers (Qemulator, QtEmu, Qlauncher) are handling it.

The simplicity of vde is amazing. Here's what all you need to do:

iface tap0eth2 inet static
        address 172.16.1.1
        netmask 255.255.0.0
        network 172.16.1.0
        broadcast 172.16.1.255
        vde2-switch -
        #tunctl_user uml-net
        pre-up /sbin/iptables -t nat -A POSTROUTING -s 172.16.1.1/24 -o eth2 -j MASQUERADE;
        pre-down /sbin/iptables -t nat -D POSTROUTING -s 172.16.1.1/24 -o eth2 -j MASQUERADE;
        up echo 1 > /proc/sys/net/ipv4/ip_forward
        down echo 0 > /proc/sys/net/ipv4/ip_forward

And this is how you'd execute each VM (be it from a wrapper of from the command-line)

rrs@learner:~/bin$ cat virtual-hurd
#!/bin/sh

vdeq kvm -M pc -hda /media/VMIMAGES/Debian_GNU_Hurd.img -m 128 -usb \
-net nic,vlan=1,macaddr=52:54:00:12:02:00 -net vde,vlan=1,sock=/var/run/vde2/tap0eth2.ctl -fda \
/media/VMIMAGES/hurd-floppy.img -boot a

rrs@learner:~/bin$ cat virtual-kfreeBSD
#!/bin/sh

vdeq kvm -M pc -hda /media/VMIMAGES/Debian_GNU_kFreeBSD -m 256 -usb -net \
nic,vlan=1,macaddr=52:54:00:12:01:00 -net vde,vlan=1,sock=/var/run/vde2/tap0eth2.ctl -boot c

rrs@learner:~/bin$ cat virtual-PCBSD
#!/bin/sh

vdeq kvm -M pc -hda /media/VMIMAGES/PC-BSD.img -m 512 -usb -net \
nic,vlan=1,macaddr=52:54:00:12:03:00 -net vde,vlan=1,sock=/var/run/vde2/tap0eth2.ctl -boot c

Interesting things to notice here are the vde2-switch - option in the network configuration section and macaddr=52:54:00:12:03:00 being used with each instance of KVM/QEMU. The macaddr needs to be unique for all the VMs or otherwise you'll have network lost in all VMs except the one that gets executed last.

As for the tap0eth2 interface, it is very simple. All you'll need to do is to NAT tap to the interface (eth2 in my case) which talks to the external network.

That's it. Enjoy the network access in the Guest VMs.

PS: Network access has worked for me in Guest VMs on Hurd, FreeBSD, PCBSD, Minix. These are the only ones I've tried till now.

Used tags:

Keywords: vde_vde2_qemu_kvm_virtualization_qemulator_qtemu_qlauncher

- Powered by vIm && Mozilla - Best viewed with your eyes