Friday, December 29, 2006

Getting an Rconnect card working in linux

Well I thought this would be pretty difficult but turned out a lot simpler though.

First the specs
I am using a Dell D620 laptop with the Rconnect card in my PCMCI slot. I specifically told the Reliance guys to get me a card that works for Linux and they gave me a Huawei one . The normal ZTE cards they give don't work with linux AFAIK. Nevertheless the drivers you get with the Huawei card are still for Windoze. But don't worry, if you are using the latest kernel it will get detected automatically. For the record, mine is 2.6.9-42.13 thats RHEL 4.

Now su as root. open vi and create this small script file say rconnect in your directory.
[root@nmoidu ~]# cat rconnect
sudo modprobe usbserial vendor=0x12d1 product=0x1001
mknod /dev/ttyUSB0 c 188 0
mknod /dev/ttyUSB1 c 188 1

Then set permissions for this to be executable.

Now for the modem properties and details of the dialup parameters, configure this file as below :

[root@nmoidu sysconfig]# cat /etc/wvdial.conf
[Modem0]
Modem = /dev/ttyUSB0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = NOFLOW
[Dialer Rconnect]
Username = 93293292323
Password = 932939392323
Phone = #777
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Inherits = Modem0
[root@nmoidu sysconfig]#

Then add this file to setup the network parameters of the Rconnect interface.
[root@nmoidu ~]# cat /etc/sysconfig/network-scripts/ifcfg-Rconnect
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
ONBOOT=no
USERCTL=yes
PEERDNS=yes
TYPE=Modem
DEVICE=ppp0
BOOTPROTO=dialup
AC=off
BSDCOMP=off
VJCCOMP=off
CCP=off
PC=off
VJ=off
LINESPEED=115200
MODEMPORT=/dev/ttyUSB0
PROVIDER=Rconnect
DEFROUTE=yes
PERSIST=no
PAPNAME=93293293293# Change this no...:)
WVDIALSECT=Rconnect
MODEMNAME=Modem0
DEMAND=no
IPV6INIT=no
IDLETIMEOUT=600
[root@nmoidu ~]#

Customize each script and file according to the specifics in your machine like the device name and your phone no. etc. Run a dmesg to see under what device name your card is detected .
Now Run the script rconnect twice. Then do an ifup Rconnect.
Btw you'll have to call up Reliance and ask them to activate the card first and then the first connection will have to be done from a Windoze machine using the Rconnect software. Thats the unavoidable world of Windows . You have to live with it ;) .
Now once you are connected, browse , enjoy........


Alternately you can do it using the GUI too.
Create the rconnect script, run it.
Then open system-config-network . Add a new modem connection. Set the provider name to Reliance. Give no. to be dialled as #777. Enter your mob. no and password . Leave the other parameters as it is.
Follow the wizard and create the the new connection. Activate the new device from the GUI. Thats it.

In case of issues, Pls let me know. Leave a comment or mail me.

Wednesday, December 06, 2006

Setting up an SMS gateway

I am writing this little howto for setting up an email2sms gateway which basically sends a mail to your mobile , like any alerts etc.

Hardware/software requirements are:

1) A GSM modem (or a phone which can act as one). The key point is it should be able to talk to Linux as a modem. A lot of the modern CDMA/GSM phones have modems that need proprietary drivers to access the modem. These generally are not available for Linux.Choose one with support for linux.
Put your SIM into the modem, connect the serial cable to a serial-to-USB converter and connect to the system via USB port.( Nowadays I've seen the modems coming directly with a USB interface).

2) Linux , we used FC 5 since the modem drivers had some issues on RHEL.

3) The SMS software. We use here smstools ( http://smstools.meinemullemaus.de/)

Download the tar.gz file and do the normal installation - unzip , make , make install.

Go to the configuration file /etc/smsd.conf . Configure as follows

[root@smsgw]# cat /etc/smsd.conf
# Example smsd.conf. Read the manual for a description

devices = GSM1 # Put in any name here for the modem to be identified.
logfile = /var/log/smsd.log # Set the log file here so that you can use it for debugging
loglevel = 7 # Check out the http://smstools.meinemullemaus.de/configure.html for details


outgoing = /var/spool/sms/outgoing # Define directory where the mails will come
checked = /var/spool/sms/checked
failed = /var/spool/sms/failed # Failed sms , for reasons like say - nil balance in SIM
incoming = /var/spool/sms/incoming # Define directory where incoming sms will be stored
sent = /var/spool/sms/sent # Mails sent out as sms

[GSM1] # Define each modem you named above , eg GSM1 , GSM2 etc.
device = /dev/ttyUSB0 # Define the device name of the modem
incoming = yes

We had used a serial-to-USB converter to connect the modem to the system. The modem hence appears to the system as a SUB device. So we define the GSM modem device as /dev/ttyUSB0. The mails that come into the outgoing folder should have the To field as the mobile no. of the person to whom the sms should be sent to. For automatically setting it to change the names of the mail id in the To field of the mail to the phone no. you will have to configure a filter like procmail to automatically change this.

[root@odin sent]# cat /etc/procmailrc
SHELL=/bin/sh
LOGFILE=/var/log/Proctest.log
LOG="--- Logging for ${LOGNAME}, "
#First, a few environment variables are included.
#Troubleshooting:
VERBOSE=yes
LOGABSTRACT=all

:0
* ^TO_ .*@company.com
| /usr/local/bin/extract-headers.sh

This calls for execution of the script extract-headers.sh for all mails coming to @ company.com domain.
The extract-headers.sh is just a script to extract the required headers only from the mail body and replace it with the phone no.s of the persons concerned in the To field , since the smsd sends the message to the number given in the To field of the message. See http://smstools.meinemullemaus.de/fileformat.html for more details on the sms format to be followed.

[root@smsgw]# cat /usr/local/bin/extract-headers.sh
#!/bin/bash
TMPFILE=$(mktemp)
FILE=$(mktemp -p /var/spool/sms/outgoing/)
formail -k -XFrom: -XSubject: -XTo: >> $TMPFILE # From, To and Subject headers copied to TMPFILE
rcptad=$(grep ^To: $TMPFILE | gawk '{print $2}') # search To field, output only mail-id part
perl -pi -e 's/To.*/To: 91999999999/' $TMPFILE;; # Replace mail id with mobile no.
FROM=$(grep From: $TMPFILE |gawk -F":" '{print $2}') # Get the From machine name
echo "from $FROM" >> $TMPFILE # Push the line "from sender-name" to the TMPFILE
cp $TMPFILE $FILE # Move the contents of TMPFILE to FILE
rm $TMPFILE # Delete TMPFILE



END of story. Start smsd in your system. put some mail in the /var/spool/outgoing folder , pay your mobile bill ;) and pray for the sms alerts to come :).
Contact me for any doubts.
___________________________________________________________________________

--
Thanks and Regards
Nabeel Moidu
Red Hat Inc.
Pune, India

If we don't believe in freedom of expression for people we despise, we don't believe in it at all. Noam Chomsky

Tuesday, August 08, 2006

Xen configuration

For those who have trouble on installing a CentOS VM on xen on Debian or Ubuntu , this page has a few helpful hints
http://www.tapodi.net/~jda/blog/archive/2006_05_01_index.html

Friday, August 04, 2006

Xen and virtualization

I have been working on Xen and virtualization for some time now and its been really impressive. Although it was a bit tough to get started and the concepts really took some time to get into my head , now it looks fine . I have got an FC3 xen kernel as a Guest OS (DomU) on an FC5 xen kernel. Things were pretty straight forward in FC5 . The networking and virtual disk concepts are a bit complicated for a starter , but finally what you get is an impressively efficient virtual OS running on top of your Host OS and you can hardly notice the performance difference.Nice work from Cambridge University. I'd certainly like to go deeper into the technology.

By the way I recently came across a good pasting site that you can use to paste large text that you would want to avoid directly pasting on a yahoo chat or IRC forum. http://rafb.net/paste/

Friday, June 23, 2006

Anti virus plays villain

I recently had a bad time with my CEO's laptop(Its on M$ XP.As of now I can't even dream about having it on linux.But at least I am happy he admires Mozilla Thunderbird after using it).
It was showing a strange behaviour. The wireless network gets connected for a few seconds and then it immediately gets off from the network. When I try reconnecting it, it again repeats this same behaviour.I start a ping and the first few packets , say 12 or 15 of them give a response even if I try www.google.com if its done immediately after a reconnect to the wireless network , but then after a few seconds it even stops pinging to the gateway ( the wireless AP). I couldn't think of any firewall that would block any pattern of traffic only after a few seconds .

Well, finally it turned out to be an issue with the anti virus software installed , or rather a virus in the machine. The explanation I can think of is like this.

There's a virus in the system which the anti-virus seems to detect only after the network comes up and there's some regular interval when the anti virus software polls something to detect it and the moment it identifies the virus , it's inbuilt firewall cuts off the machine from the network.

If anyone has any better ideas , please suggest.

Wednesday, June 21, 2006

Working on command line tools with proxy settings

In situations where you have a proxy and you need to use command line tools like wget going through the proxy , add the following commands

export http_proxy="http://192.168.1.10:3128"
export ftp_proxy="http://192.168.1.10:3128"

If you need authentication on it in wget,add

wget --proxy-user "Domain\username" --proxy-passwd "pass123" http://mirror.kernel.org/linux.iso

Altenatively, you may encode the username/password in the http_proxy variable:

export http_proxy="http://username:password@192.168.1.10:3128"
export ftp_proxy="http://username:password@192.168.1.10:3128"

Monday, June 12, 2006

Linux Netfilter is better than PIX

Well, in some aspects.........
The other day I was trying to migrate a Linux Netfilter based firewall onto a Cisco PIX device.
I really felt pity for PIX. The GUI was very ill designed , many things were just so bad in the GUI that I decided to switch over to its CLI. I tried adding a new NAT rule , it went wrong and then when I tried to delete it it started giving errors.When I did the same with the CLI , it worked well.When I tried to change the interface IP of the mgmt interface , it said the dhcp server is in a different range so you cant change it.Vice versa it the dhcp said the interface ip was on a diff subnet. Finally the CLI worked.
Then to the rules .I don't know why Cisco doesn't feel that two external IPs should not be mapped to an internal IP. Iptables just flawlessly allows it.I've really lost the big impression I had about PIX.Though its better than the Checkpoint Firewall-1 that I have used on Nortel Contivity boxes it still doesn't have many feature that Netfilter has. Well it does have a few that Netfilter doesn't have too...But then PIX is supposed to be best in the market ....
Well , it didn't convince me.............

Sunday, May 28, 2006

Dragging windows in linux

On many occasions in linux , I have come across the situation where the window size is bigger thatn the screen size so in effect , i can't see the ok or apply buttons at the bottom .
In such cases , you can use the alt + mouse left click combination and press the arrow keys to drag the window up and down .
Hope it helps

Monday, May 22, 2006

Brainbench Job role

I didn't notice till recently that Brainbench had job role certifications that was given if a selected set of papers was cleared.Well, I set my sights on three of the available ones.
Network Administrator, Linux Administrator, Unix Administrator.
Finally cleared Network Administrator.The other two are still pending.Need to clear an elective from C , Bash , Perl , Python .
I think Bash or C might be my choice.
If that is also cleared , I will get the latter two job roles also.
I hope I can do it before the Games ends this 31st.

Wednesday, May 17, 2006

Some more games with Awk

To rename all files in current directory (append .bak to all of them):
ls -l | awk '{print "mv "$1" "$1".new"}' | sh

Thats doing an ls of all files , passing each name to awk as argument , renaming the awk input and passing the whole formatted output to shell

1. Renaming within the name:
ls -1 *name1* | awk '{print "mv "$1" "$1}' | sed s/name1/name2/2 | sh

2. remove only files:
ls -l * | grep -v drwx | awk '{print "rm "$9}' | sh
or with awk alone:
ls -l|awk '$1!~/^drwx/{print $9}'|xargs rm
Be careful when trying this out in your home directory. We remove files!

3. remove only directories
ls -l | grep '^d' | awk '{print "rm -r "$9}' | sh
or
ls -p | grep /$ | wk '{print "rm -r "$1}'
or with awk alone:
ls -l|awk '$1~/^d.*x/{print $9}'|xargs rm -r
Be careful when trying this out in your home directory. We remove things!

4. killing processes by name (in this example we kill the process called netscape):
kill `ps auxww | grep netscape | egrep -v grep | awk '{print $2}'`
or with awk alone:
ps auxww | awk '$0~/netscape/&&$0!~/awk/{print $2}' |xargs kill
It has to be adjusted to fit the ps command on whatever unix system you are on. Basically it is: "If the process is called netscape and it is not called 'grep netscape' (or awk) then print the pid"

Tuesday, May 16, 2006

Today's catch

I was busy most of the day with some networking issue at office. But I took some time out later at night to write at least one exam .So the catch of the day is

Networking Concepts.

I have set my sights on few others.Will have to wait till tomorrow for that.....

Monday, May 15, 2006

Brainbench games

Well ,Happy news for those who are looking out for a certification to add to your resume...
the famous online certification site Brainbench.com has started their brainbench games for this year.Its the best opportunity to write their exams for free online.Normally you get to write only a few for free and for the rest you need to pay.
I attempted the following today and cleared them
1)Information Technology Security Fundamentals
2)Network Technical Support
3)Internet Technology Fundamentals
4)Linux Administration - Redhat

That takes my Brainbench tally to 8 certifications.
Well it seems there is a prize for each country that has the most no. of certificate earners.
Check out www.brainbench.com for more...........

My younger brother receiving a prize


Thats him shaking hands with the principal

Pronouncing "Linux"

I've seen many people pronouncing Linux in many different ways.
Some say it with li as in liar
some with the li as in limit
some with the nu as in nook
Well going by what Torvalds says
http://www.paul.sladen.org/pronunciation/torvalds-says-linux.wav

I'll go by that

Thursday, May 11, 2006

What Shorewall could and Nortel Contivity couldn't

I happened to have a strange issue.I had an IP to which I had done a layer of NATting so that an IP w.x.y.z would see to my network users as a.b.c.d. I used Nortel Contivity CSF/NAT software for this.
But whenever we did an FTP to the natted IP , the initial connection got established but after that the data connection was never established.It dropped connection whenever a data connection or passive mode was requested.I checked the rules at my end thoroughly , opened up the required ports , ensured that at the other end also everything was open.But nothing worked.Finally I decided to do a packet capture and set an ethereal capture with the filter on ftp port alone.
To my wonder the PORT raw FTP command was giving the ip a.b.c.d to the ftp server at w.x.y.z which the server was not aware since I was doing a NAT.
The problem was detected, but earlier this used to work when I did the same using Shorewall.
I read the documentation of Shorewall and understood that Linux was aware of this issue and hence there was a kernel module ip_nat_ftp which took care of modifying PORT and PASV commands in case of a nat.Shorewall automatically loads this module .Thats why it used to work earlier.
When contacted Nortel said its a known bug with their firmware version which they will fix in their next update.
Perhaps if their code was open, it might have got noticed a long back .................
Am I right????????

Wednesday, May 10, 2006

A few cool vim tips

The "*" key will search for the word from the current cursor position to EOF
The "#" key will search for the word from the current cursor position to the top of the file.

/^[A-M]\+/ : search for lines beginning with one or more A-M
/you\|me : search for YOU OR ME

/\<\d\d\d\d\> : Search for exactly 4 digit numbers
/\<\d\{4}\> : same thing

:s%/,/\r/gc : To find and replace all commas with a new line

/^\n\{3} : find 3 empty lines
:%s/^\n\{3}// : delete blocks of 3 empty lines

:%s/^\(.*\)\n\1$/\1/ : delete duplicate lines

" Recording (BEST TIP of ALL)
qq # record to q
your complex series of commands
q # end recording
@q to execute
@@ to Repeat
5@@ to Repeat 5 times

Thats it for now.Rest later

Tuesday, May 09, 2006

Connection drops when TTL changes!!!

I had a very strange issue today.There was a linux server that had been working for some time and suddenly the developer team suddenly started facing connection drops.they also noticed that whenever the ping ttl was 63 it was working fine. When it switched to 127 it started dropping.
I was left clueless because in /proc/sys/net/ipv4/ip_default_ttl was 64 only and there was no reason why it showed 127 in the ping .
Well finally the problem was somebody else had given a new windows machine the same ip .Whenever traffic hit the windows machine it was returning 127 as the TTL and hence all connections to services on the linux server was dropping.
The ip was then changed on the new machine and then the services connected happily ever after...............................

At work



Sunday, May 07, 2006

Some occasions where you can replace awk with cut

Let me tell you first that I love awk and its my favourite scripting language.But in case you just have a one time simple requirement for column processing and you don't know awk , in some cases you can fulfil the requirement with cat and cut

cat inputfile | cut -f 6 -d ' '
where the sixth column would be output when space is the delimiter.

the awk equivalent would be
awk -F ' { print $6 } ' inputfile

"And yet they said awk is difficult
But Awk is a wonderful tool"

Saturday, May 06, 2006

A new great link

I got this one from my favourite linux support forum
linuxquestions.org

This guy has put up a large no of wonderful howto's .Probably if I had got this five months back I could have avoided my company having to pay Redmond a huge amount for M$ Exchange.Well in case there is anyone else right now in my situation its all right here.Have a look.Great work Paul
http://www.yourhowto.org

And one new thing that i learnt
If you are pretty irritated by the password prompt every time you type sudo
add an option NOPASSWD: ALL this to the visudo config file line where you have specified your user rights .The ALL above is for all commands you can restrict it according to your needs

Thursday, May 04, 2006

Some M$ stuff

I am not suppose to be posting Redmond stuff here, but I feel this might be helpful to those *nix users who are used to configuring everything from the command line when they are forced to do something on a M$ system
To use a command line to set IP address information on a Windows NIC :-
Windows Server 2003 and Windows XP provide the Netsh utility, which, among its many capabilities, can configure the IP properties of NICs. To set a static IP address, use this format:
netsh interface ip set address local static
as in the following example:
netsh interface ip set address local static 192.168.1.15 255.255.255.0 192.168.1.1 1
(Some command lines wrap to two lines here because of space constraints.)
To set a client's NIC DNS settings, run this command:
netsh interface ip set dns local static 192.168.1.150 primary
To set a client back to DHCP, run these commands:
netsh interface ip set address local source=dhcp
netsh interface ip set dns local source=dhcp

Tuesday, May 02, 2006

Partition deletion and grub problems

I recently deleted some partitions from my disk using fdisk , and they had nothing to do with my active OS , but at my next reboot , my system started giving kernel panic.
The problem was that the deleted partitions were like hda5, hda6 etc and the partition where my OS was loaded was something like hda10,hda11 etc.Once the others were deleted , the partitions got renamed while menu.lst and fstab was as per the old numbering of the partitions.
I went into single user mode , edited grub and fstab , and rebooted , but then on it got stuck at grub prompt.
When i entered the parameters for root, kernel and initrd in grub and gave boot , it worked , but again at reboot it stood at grub.I tried rebooting after ensuring all changes were properly affected in grub.conf , menu.lst and in fstab(I use SUSE at home) but it still got stuck at grub.every time I entered the parameters and gave the boot command it worked ,but when the same thing was written in menu.lst it did not accept it.
Finally I reinstalled grub from the normal prompt after booting from grub and rebooted and things were back to normal.
Now my system works fine.

SELinux (t)errors

One of my friends had a strange experience.He had a script stored inside the Apache document root and it could not be executed when the script was called directly using " ./script ".The executable permissions and all were fine but there was no way to run it there.But when the same script was called with "bash script "
It worked fine. Again if the script was copied somewhere else outside the Apache doc root it would work when directly executed also. The strace showed that open(/dev/tty) was returning a failure return code only when executed from the apache doc root. The strace o/p of both successful and unsuccessful executions of the script were put to diff and all the troubles seemed to begin from there.A lot of head scratching later we saw that Selinux was enabled on the box and that was the cause for all this.It was putting the Apache doc root in a chroot jail and was not allowing any script to be executed there.
Then changed the setting in /etc/selinux/config from enforcing to disabled and
echo 0 > /selinux/enforce
and lo things were back to normal

Sunday, April 23, 2006

Firewall upgrade

I had upgraded my Nortel Contivity router with its latest firmware and all of a sudden traffic seemed to reach only my ISP's gateway but not beyond.Initially I thought it was the ISP's issue but then they confirmed that there was no issue on their side.I had a look at my routing table and the default gateway was set to the next hop of one of our serial links .But in my configuration for the router I had not configured it like that anywhere .The ISP gateway was in the same subnet as my public ip so that was the reason why their gateway was reachable but not the other destinations.I searched through the static route entries and the default gateway specifications and saw a new check box to verify public default route .I checked it and then refreshed the routing table.That did not help.
Next I thought of checking out the interface config of the serial links and there stood a new check box for default route .It was not there in the older version of the GUI for the firewall. It caused that interface to be the default route and hence the other entry where I had specified the public default route was not being effective.Well I unchecked it and things started working fine.

A few but very simple ones

Check out this one
cp /etc/httpd/conf/httpd.conf {,.bak}
would substitute
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
Now that's a pretty simple one right ?

To see the details about a file - i.e. its access time , size , blocks , inode etc..
stat filename

A cool link from Stanford University
Here's a pretty impressive collection of network monitoring tools for any network admin
http://www.slac.stanford.edu/xorg/nmtf/nmtf-tools.html

Wednesday, April 05, 2006

A few new tips

To identify if the processor is 32 bit or 64 bit ( I guess the OS will also have to be corresponding)
use uname -i or getconf LONG_BIT

To identify processes using files or sockets (will come handy esp when you are unable to unmount disks)
fuser port/type eg fuser 21/tcp will give the process ids using ftp on your machine
fuser -km /home kills all processes accessing the file system /home in any way.
Alternatively you could also use lsof and then pipe it to grep to find the file or process you are looking for

To print real and effective UIDs and GIDs of a user use
id username

In case you get these errors for yum while attempting multiple mirrors
[Errno -1] Metadata file does not match checksum
give
yum clean metadata
and if that doesn't work then give
yum clean all
then try again

To know the exit status of the last process executed
echo $?

Wednesday, March 29, 2006

IPSEC from Nortel contivity to Juniper netscreen

I was having difficulties in getting an IPSEC tunnel shifted from a Cisco VPN Concentrator onto a Nortel Contivity router . Well it turned out that there were lots of options that needed to be changed with respect to the encryption settings in the Contivity.The default settings for each manufacturer is quite different.Anyway I got a document to configure the tunnel to a Juniper Netscreen (That was the other endpoint) from a Nortel Contivity device and once the settings were done , it worked fine.
I was also able to configure a User tunnel on the Contivity .It was rather simple , I just created a user account in the profiles -> users section of the gui for it and then assigned a IP address pool for the user and lo that did it.The connection was established . Then I had to open the firewall rules for people accessing the network through the tunnel.

Tuesday, March 28, 2006

Packet drops on an RF link

This has been bugging me for so many days now. A small percentage of packet drops and remote connections become a nightmare.Well this time it seems the signals from the RF transmitter on top of the ISP's tower were weak because the alignment of the transmitter had changed and the signal strength to our ISP base station had become low and thus the packet drops.
The ISP guys aligned the transmitter and now the link is fine
Well on other occasions the reasons for packet drops were duplex setting mismatch, choking etc

Samba suddenly stopped working

My Samba server with ADS authentication suddenly stopped working .
When I gave wbinfo -u and getent passwd it was all working fine.
Then i tried kinit username@domain.tld and it gave the error
kinit(v5): Cannot find KDC for requested realm while getting initial credentials
I set dns_lookup_kdc = true in krb5.conf
Next it gave the error
kinit(v5): Clock skew too great while getting initial credentials
For some reason the ntp synchronization with my Windows AD had stopped.
I went to system-config-time and reconfigured the ntp server as the AD and it worked.
Well later I figured out that the first error was because I gave lower case in the domain name in the kinit statement and the actual problem was not that.Anyway with the dns_lookup_kdc = true in the krb5.conf lower case also seems to work....................:-)

Monday, March 27, 2006

Misc Tips for Linux

The First Collection
To sort the union of two files removing duplicate lines. Suppose a and b contain the files. Do just this:
cat a b | sort -u -k 2
-u means unique, -k 2 selects the second field as sorting key.

Need to "watch" everything a user does? The following watches donkey.
$ watch lsof -u donkey
Or, to see what in going on in directory "/work/junk"
$ watch lsof +D /work/junk

To view text output of a binary file
strings /bin/ls

strace can also be used to trace an already started program.
Usage: strace -p pid (where pid is the process id of the program)

To find files opened by a process
ls -al /proc/process-id/fd/

*Find package which gives library
rpm -q --whatprovides /usr/lib/libreadline.so.4

Files being used by diff processes
/usr/sbin/lsof
to check how much swap is under use type "cat /proc/meminfo" at a console.

MOUNTS
mount -t smbfs -o workgroup=domain.tld,uid=user,password=password //192.168.21.14/share /mnt/mountpoint

GUI Problems
* panel disappears suddenly - killall -9 panel ; /usr/bin/gnome-panel ;

CREATE A SWAP FILE INSTEAD OF PARTITION
# dd if=/dev/zero of=swapfile bs=1024 count=65536
---> this creates a 64Mb file with the name "swapfile"
# mkswap swapfile ---> to make it a swap file
# swapon swapfile ----> this will add the file as a swapfile
# cat /proc/meminfo ---> to check the new swap size
If you are done using the swap file, you can swapoff the file:
# swapoff swapfile ----> to remove the swap file

Using a CORAID box as LVM :
Include this line in /etc/lvm2/lvm.conf
under the devices section
types = [ "aoe" ,16 ]
modprobe aoe
vgscan
vgchange -a y

In the name of Allah ,Most Gracious , Most merciful

I am not a regular diary writer and so I wasn't much interested in blogging but then I thought OK I will post on this everyday whatever troubleshooting I do in my work and some misc tips - might be handy for me later or for somebody else.And some other thoughts that come across my mind during my day's work or while browsing the net.

If at all any of it helps you at any point of time , please put in a comment in here.
If you have got any doubts about it also , feel free to put it across to me ,we'll sit and sort it out.
And of course If you see any mistakes please point that out also.

I will begin by putting up a few of my favourite tips that I have compiled over the past year