Pages

Thursday, July 7, 2011

Project in hand!

Busy with a project to computerize my Tailor's stitching process. Using VB and sql for the project since they are both free software's.
Requirements:
1. Billing
2. Record and store the data of customers
3. Print the bill

Monday, April 25, 2011

Four people on a bridge

Four people need to cross a bridge at night. They have only one torch and the bridge is too dangerous to cross without one. The bridge is strong enough only to support two people at a time. Not all people take the same time to cross the bridge. Time for each person: 1 min, 2 mins, 7 mins, 10 mins. What is the minimum time needed for all four of them to cross the bridge?
Answer : 10 mins.
A and D crosses the bridge. D holds the torch.
In one minute A crosses the bridge.
B starts to cross the bridge. B finishes it two minutes.
C starts to cross the bridge. Takes 7 minutes to finish. Mean while, A also finishes crossing the bridge.
Minimum time need for all : 10 minutes.
Ping me if you have interesting puzzles with you.

Friday, March 18, 2011

How to check for hardware errors in Aix?

If the system has crashed or automaticall rebooted, the  following needs to be checked
1) sysdumpdev -L => This will list if any dump files are present. If so, this needs to be sent to the IBM engineer.

2) errpt => To check for the error logs

3) errpt -a -j identifier => Once you find out what is causing the error message use this command. This will tell you whether the error is a permanent one or a temporary and what are the probable causes for the error.

4) diag - This needs to be run ONLY when required. It is not recommended to run this script unnecessarily, especially if the system has not crashed or rebooted automatically.

5)  snap => => This command gathers system configuration information and compresses the information into tar file.

6) snap -r => This will delete the previous snaps if any

7) snap -gcb => This will create the compressed file ( uses the ouput of lslpp -hBc command which is required to recreate exact OS environment, it gathers SSA information as well )

 

TFTP

What is TFTP?

Saturday, February 26, 2011

How to detect newly added VM disk to Redhat 5.5?

Before Addition:

[root@unixhost ]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM
[root@unixhost]#

After Adding the disk from VM end

1) Run the following command:

#echo "- - -" > /sys/class/scsi_host/host0/scan
#fdisk -l


[root@unixhost]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@unixhost]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
[root@unixhost]#



SDB - The new disk is detected now.

Sunday, February 20, 2011

Tcpdump

Inorder to collect the network stats between two boxes:

#tcpdump -w /tmp/tcpdump.out dst unixhst01 and tcp port 22

Reading the file

#tcpdump -tttnr /tmp/tcpdump.out | more

=> Destination Machine - unixhst01
=> Port - 22 ( SSH )

Stat Collection

Ever been bugged by Apps team to pull up stats in a jiffy while they do the performance testing? Here is the solution to it.

Stats for CPU, MEM & IOSTAT :

A) If stats needs to be collected in seconds. The following collects logs every two seconds.

# vi stats.ksh
while [ true ]
do
sleep 2
iostat -t >> /sheenz_perf/iostat.test.out
sar >> /sheenz_perf/sar.test.out
mpstat >> /sheenz_perf/mpstat.out
done
:wq!

B) If stats needs to be collected in minutes. Cron is set for 5 minutes.

#vi stats.ksh
iostat -t >> /sheenz_perf/iostat.test.out
sar >> /sheenz_perf/sar.test.out
mpstat >> /sheenz_perf/mpstat.out
:wq!
#crontab -e
5,10,15,20,25,30,35,40,45,50,55 * * * * /stats.ksh
:wq!