Monday, August 30, 2004

cp -p : Use if you do not want to change mod times and permissions

linux kernel memory leak

Wednesday, August 25, 2004

Changing xterm title

Tuesday, August 24, 2004

cscope

find . -name "*.[chsS]" -follow -print > cscope.files
cscope -bq
cscope -d

-b: build
-q: cross references

Ctrl-b will browse through history of cscope searches that u performed earlier.

Sunday, August 22, 2004

Touchpad tapping in Suse 9.1

TRY
//Putting it at the end of the append
boot=/dev/hda
default="linux"
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
label="linux"
root=/dev/hda5
initrd=/boot/initrd.img
append="devfs=mount acpi=ht resume=/dev/hda6 splash=silent psmouse.proto=imps"
vga=788
read-only

wireless lan setup in SuSE 9.1

Suse 9.1 recognizes the wireless cards: Orinoco and Belkin
and loads the drivers automatically. But the following have to be done in order to successfully configure them:

1. LOG IN AS ROOT
2. set essid
3. set key
4. set default gateway if u know its IP address
5. set it as pcmcia
6. set default route: destination=default, mask=0.0.0.0, gateway=192.168.2.1, interface=eth1
7. set it to be configured at boot time.

after spending 3 and 1/2 hours on this stupid thing, lesson learnt:

LOG IN AS ROOT AND DO EVERYTHING!!!

dunno why it cannot configure these cards properly when we su from another user's login.


Thursday, August 05, 2004

kernel syncronization

You can use the macros DECLARE_MUTEX and DECLARE_MUTEX_LOCKED

to declare semaphores with initial values of 1 or 0. You can
then use the up and down functions on theese variables.

static DECLARE_MUTEX(mymutex);
void myfunc()
{
down(mymutex);
...
up(mymutex);
}

Tuesday, August 03, 2004

ATI Radeon IGP 340M driver for linux installation

 

Monday, August 02, 2004

linux page cache

VFS in linux kernel 2.4

Disk cloning using dd

This is a step by step solution for the people who want to get straight to the point.
You can print only this page and use it as a quick reference.

Local Step 1:
root@from# dd if=/dev/hda of=/safe/place/hda.mbr.dd bs=1 count=512
root@from# sfdisk –d /dev/hda > /safe/place/hda.pt.sfdisk
root@from# dd if=/dev/hda1 of=/safe/place/hda1.dd bs=512
root@from# dd if=/dev/hda2 of=/safe/place/hda2.dd bs=512
root@from# dd if=/dev/hda3 of=/safe/place/hda3.dd bs=512
root@from# dd if=/dev/hda5 of=/safe/place/hda5.dd bs=512
root@from# dd if=/dev/hda6 of=/safe/place/hda6.dd bs=512

Local Step 2:
root@to# dd if=/safe/place/hda.mbr.dd of=/dev/hdc bs=1
root@to# sfdisk –R /dev/hdc
root@to# sfdisk –n /dev/hdc < /safe/place/hda.pt.sfdisk
root@to# sfdisk /dev/hdc < /safe/place/hda.pt.sfdisk
root@to# dd if=/safe/place/hda1 of=/dev/hdc1 bs=512
root@to# dd if=/safe/place/hda2 of=/dev/hdc2 bs=512
root@to# dd if=/safe/place/hda3 of=/dev/hdc3 bs=512
root@to# dd if=/safe/place/hda5 of=/dev/hdc5 bs=512
root@to# dd if=/safe/place/hda6 of=/dev/hdc6 bs=512

Remote Step 1 (clone the mbr)
root@to# nc –v –l –p 2000 | gzip –cd > /dev/hda
root@from# dd if=/dev/hda bs=512 count=1 | gzip –c9 | nc –q 2 2000
root@to# nc –v –l –p 2000 | gzip –cd > hda.sfdisk
root@from# sfdisk –d /dev/hda | gzip –c9 | nc –q 2 2000
root@to# sfdisk –n /dev/hda < hda.sfdisk
Test OK…
root@to# sfdisk /dev/hda < hda.sfdisk
root@to# sfdisk –R /dev/hda

5.4 Remote Step 2 (clone the partitions):
root@to# nc –v –l –p 2000 | gzip –cd | dd of=/dev/hdaX
root@from# dd if=/dev/hdaX | gzip –c9 | nc –q 2 2000
Repeat this step for the number of partitions that you have. All that will vary is the
partition X eg. hda2, hda3, hda4 etc.