Monday, August 31, 2009
ssh login without a passwd
First, generate the key, the key will be used to open the remote machines door.
ssh-keygenYou will see something like that
Enter file in which to save the key (/home/myname/.ssh/id_rsa):Whatever it appears just press enter until it ends, press enter for passphase as well.
Okay, the key will be generated, something looks like ~/.ssh/id_rsa.pub
Copy over the key to remote machine, and enter your password
ssh-copy-id -i ~/.ssh/id_rsa.pub mysurface@10.0.0.4Done. Now you can ssh 10.0.0.4 with username mysurface without password.
ssh mysurface@10.0.0.4
Wednesday, August 26, 2009
Taglist info in vim
2)Unzip in $HOME/.vim directory
3)Open a vim editor and type :TListToggle
You should see a Tag List Wiindows at your left side. This will contain info about all the functions , variables, macros etc. Very useful
Make your vim competent with other IDE's
Simple File Sharing Mechanism between machines
python -m SimpleHTTPServer _port_no_
where port_no could be anything like 1234
From the other machine, http://_ip_addr_:_port_no_/
Tuesday, August 25, 2009
Setting up private network
----> M2 <--------------------> M3--
| -----------------------------------------|
M1 ------------------------------------M4
M2 and M3 are servers
M1 and M4 are clients
M1 - 10.18.71.238
M2 - 10.18.71.1
M3 - 10.18.207.1
M4 - 10.18.207.180
Hardware connections
1) All are single homed (They have only one ethernet slot)
2) There are 2 network switches (M1 and M2 are connected to one switch; M3 and M4 are connected to the other switch. These hubs are directly connected so that M2 and M3 are connected
3) All of these switches are just accept and forward type of switches
Configurations
On Clients
M1
1) Assign the ip
ifconfig eth0 10.18.71.238/24
2) Set the default gw as 10.18.71.1 (M2)
ip route flush all
route add net 10.18.71.0/24 dev eth0 ( This means, if you need connection to the local n/w, try anywhere where you find eth0)
route add default gw 10.18.71.1
M4
1) Assign the ip
ifconfig eth0 10.18.207.180/24
2) Set the default gw as 10.18.207.1 (M3)
ip route flush all
route add net 10.18.207.0/24 dev eth0 ( This means, if you need connection to the local n/w, try anywhere where you find eth0)
route add default gw 10.18.207.1
Check: Now M1 should be pingable to/from M2 and M3 should be pingable to/from M4. If these are NOT pinging, something else might be wrong. Resolve this before proceeding further
On servers
M2
1) Assign the ip
ifconfig eth0 10.18.71.1/24
2) Make this as a router
ip route flush all
route add -net 10.18.71.0/24 dev eth0
route add -host 10.18.207.1 dev eth0
route add -host 10.18.207.180 gw 10.18.207.1
echo 1 > /proc/sys/net/ipv4/ip_forward
M3
1) Assign the ip
ifconfig eth0 10.18.207.1/24
2) Make this as a router
ip route flush all
route add -net 10.18.207.0/24 dev eth0
route add -host 10.18.71.1 dev eth0
route add -host 10.18.71.238 gw 10.18.71.1
echo 1 > /proc/sys/net/ipv4/ip_forward
Check : Now M2 --> M3 should be pingable
Now the private network is establised. All machines should be pingable from/to all machines
P.S- Make sure to disable Firewalls of all machines (iptables --flush; iptables -t nat --flush; verify iptables -L and iptables -t nat -L. This should NOT have any entries in them
Wednesday, June 10, 2009
Viewing the contents of ext2/3 filesystem
debugfs xxx.ext2
Sunday, May 31, 2009
Creating and analysing coredump messages
1) Creating a core dump
a) Run the command ulimit -c unlimited
b) Run the executable that is crashing
c) You should see a message like "Segmentation fault (core dumped)"
2) Analysing core dump using gdb
a) Run the command
gdb
b) You should see the point of the crash (in the back trace)
Reading symbols from /lib/libcrypto.so.0.9.8...done.Loaded symbols for /lib/libcrypto.so.0.9.8Reading symbols from /lib/libresolv.so.2...done.Loaded symbols for /lib/libresolv.so.2Reading symbols from /lib/libc.so.6...done.Loaded symbols for /lib/libc.so.6Reading symbols from /lib/libdl.so.2...done.Loaded symbols for /lib/libdl.so.2Reading symbols from /lib/ld.so.1...done.Loaded symbols for /lib/ld.so.1
#0 0x0fd60954 in strlen () from /lib/libc.so.6
This means it is some problem with strlen .