Thursday, May 24, 2007

Getting your system information

You may need to get the system information in testing projects.
There is a tool which gives your system information.

Here are the steps to install the tool and get info
1) Download the rpm suits for your OS
http://dag.wieers.com/rpm/packages/lshw/
2) Login as a superuser (root)
3) Install the rpm
4) type $lshw -html > sysInfo.html to get the system information in HTML format

You can used following commands to get some useful network information of your system .

cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep GATEWAY
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep NETMASK

There is a utility called 'lshw' that will gather and display this info for you.
It can generate system information in html format too.

(lshw -html > sysInfo.html)


The details of the tool is available @
http://ezix.org/project/wiki/HardwareLiSter

There is a list of rpms which support your OS.

You can get machine architecture by using command

$ arch

Shell Arithmetics, Date and the read statement

1. Shell Arithmetics is used to perform arithmetic operations.

Syntax:
expr op1 math-operator op2

Given below are some examples that you can try out.
$ expr 10 / 2 
$ expr 2 - 1
$ expr 2 - 10
$ expr 13 + 1
$ expr 20 \* 3
$ expr 20 %3

Note: There should be spaces between as shown in the Syntax listed above, if not it would be displayed as characters
e.g. $ expr 13+1 would be processed and displayed as 13+1 not 14

2. Printing current system date.

Use the following command to print the current system date.

$ echo "Today is `date`".  

Note: if you type it as shown below the system date will not be displayed only the text will be displayed. So include the word date withing single quotes.
$ echo "Today is date"  

3. read statement
Used to get input from keyboard and store into a variable.

Type the following in a shell script and test the output
$ echo "Your first name please:"
$ read fname
$ echo "Hello $fname, Welcome to BeyondM!"



Sunday, May 20, 2007

Thursday, May 17, 2007

New ways to compress and uncompress a file/folder.

Few ways to compress and uncompress a file/folder.
As my experience it is better to use tar.bz or tar.bz2 when you really need to make free disk spaces.



.tar.bz2
UNCOMPRESS
tar jxvf FileName.tar.bz2
COMPRESS
tar jcvf FileName.tar.bz2 DirName

.bz
UNCOMPRESS
bzip2 -d FileName.bz
OR
bunzip2 FileName.bz
COMPRESS
unknown


.tar.bz
UNCOMPRESS
tar jxvf FileName.tar.bz
COMPRESS
tar cfvpj .tar.bz

.tar
UNCOMPRESS
tar xvf FileName.tar
COMPRESS
tar cvf FileName.tar DirName

.gz
UNCOMPRESS
gunzip FileName.gz
OR
gzip -d FileName.gz
COMPRESS
gzip FileName

.tar.gz
UNCOMPRESS
tar zxvf FileName.tar.gz
COMPRESS
tar zcvf FileName.tar.gz DirName

.bz2
UNCOMPRESS
bzip2 -d FileName.bz2
OR
bunzip2 FileName.bz2
COMPRESS
bzip2 -z FileName


.Z
UNCOMPRESS
uncompress FileName.Z
COMPRESS
compress FileName

.tar.Z
UNCOMPRESS
tar Zxvf FileName.tar.Z
COMPRESS
tar Zcvf FileName.tar.Z DirName

.tgz
UNCOMPRESS
tar zxvf FileName.tgz
COMPRESS
unknown

.tar.tgz
UNCOMPRESS
tar zxvf FileName.tar.tgz
COMPRESS
tar zcvf FileName.tar.tgz FileName

.zip
UNCOMPRESS
unzip FileName.zip
COMPRESS
zip FileName.zip DirName

.rar
INSTALL
RAR : http://www.rarsoft.com/download.htm
[root@www2 tmp]# cp rar_static /usr/bin/rar UNCOMPRESS rar a FileName.rar COMPRESS rar e FileName.rar

.lha
INSTALL
lha : http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/
[root@www2 tmp]# cp lha /usr/bin/
UNCOMPRESS
lha -e FileName.lha
COMPRESS
lha -a FileName.lha FileName

.rpm
UNCOMPRESS
rpm2cpio FileName.rpm | cpio -div

.deb
UNCOMPRESS
dpkg -x FileName.deb

Wednesday, May 09, 2007

Using mysqldump to backup your data

You may required to get a backup of your database , tables or get database structure and upload data another database. You can use tool mysqldump for these tasks.

The tool is located @ {MySQLInstallDir}/bin eg. /usr/local/mysql/bin

Here are few useful commands

1) Get a backup of entire database with create statement

$ mysqldump [DBName]

2) Get a backup of a database's data
$ mysqldump -t [DBName]


3) Get structure of a known table
$ mysqldump -d [DBName] [TableName]

4) Get data in a table
$ mysqldump -t [DBName] [TableName]


Use option --compact for less comment
You may need to re-direct the output to a file using ">" command at the end with a file name

Improve Your Reporting Skills

Study bug reports in the tracking system for ideas on how to improve you’re reporting, for examples

  • Compare the bug reports that were fixed and not fixed. Look for differences in the way they were reported. If you want yours fixed, report them like the ones that historically do get fixed.
  • Read programmers (and others) answers to bug reports. What makes them confused? Angry? Unreceptive? Appreciative?
  • Have a look at this http://issues.apache.org/bugwritinghelp.html
  • If defect assigned party (developers, tech writer) ask more details you should improve your reporting skills.

Martin Fowlers Article on Stand-up meetings

We need to check whether we understand the purpose of stand-up meetings and use them effectively. There's an excellent article by Martin Fowler at:
http://martinfowler.com/articles/itsNotJustStandingUp.html

Especially look at the section named: "Smells are about when things are going wrong".