Wednesday, September 9, 2009

The hint of extracting tarball

I created a directory called, file. Then, i touched 3 dummy files, file1, file2, file3.

[root@rhel54-1 file]# ls
file1 file2 file3

when i zip those file. I choose two different ways, one with gzip compression and one without

[root@rhel54-1 ~]# tar -cvf file.tar.gz file/
file/
file/file2
file/file3
file/file1


[root@rhel54-1 ~]# tar -zcvf file.tgz file
file/
file/file2
file/file3
file/file1

[root@rhel54-1 ~]# tar -jcvf file.tar file
file/
file/file2
file/file3
file/file1


I have three tarball files right now. Then, I do a file command on my tarballs file

[root@rhel54-1 ~]# file file.tar.gz
file.tar.gz: POSIX tar archive

[root@rhel54-1 ~]# file file.tgz
file.tgz: gzip compressed data, from Unix, last modified: Thu Sep 10 10:27:48 2009

[root@rhel54-1 ~]# file file.tar
file.tar: bzip2 compressed data, block size = 900k

Cool. I have three different formats. POSIX tar archive, and gzip and bzip2 file.

So, when i extract the tarballs. i will prompt in the command.
1. tar -zvxf for gzip tarball
2. tar -xvf for POSIX tar archive
3. tar -jvxf for bzip2 tarball

Obviously, the size of those tarballs also varying.

[root@rhel54-1 ~]# ls -sh file.*
4.0K file.tar 12K file.tar.gz 4.0K file.tgz

gzip and bzip2 is much more better than POSIX tarball.

Thursday, June 11, 2009

love tai ji

Tuesday, June 9, 2009

RPM packaging

NUM_RPM_INSTANCE == 1 is a normal installation

NUM_RPM_INSTANCE == 2 is a normal upgrading

NUM_RPM_INSTANCE == 0 is a normal uninstallation

Here are the actual values passed during an install:

Run %pre of new package (1)
Install new files
Run %post of new package (1)

Here are the values passed during an upgrade:

Run %pre of new package (2)
Install new files
Run %post of new package (2)
Run %preun of old package (1)
Delete any old files not overwritten by newer ones
Run %postun of old package (1)

Here are the values passed during a delete:

Run %preun of old package (0)
Delete files
Run %postun of old package (0)

Monday, June 1, 2009

Getting GREP on some colors

export GREP_COLOR='1;32'

Monday, May 11, 2009

Regexp lesson 2

Regular expression lesson 2

[ and ] is a define a character set, everything between them is part of the set, and any one of the set members must match (but not all).

Multiple ranges may be combined in a single set. For example, the following pattern matches any alphanumeric character in uppercase or lowercase, but not anything that is neither a digit nor an alphabetic character:

[A-Za-z0-9]

This pattern is shorthand for
[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890]


TEXT
abbreviated as RegEx or regex

REGEXP
[Rr]eg[Ee]x

RESULT
abbreviated as RegEx or regex

Regexp lesson 1

Regular expression lesson 1

.
matches any character. \is used to escape characters and to start special character sequences.

TEXT

sales1.xls

orders3.xls

sales2.xls

sales3.xls

apac1.xls

europe2.xls

na1.xls

na2.xls

sa1.xls

REGEXP
.a.\.xls

RESULT
sales1.xls

orders3.xls

sales2.xls

sales3.xls

apac1.xls

europe2.xls

na1.xls

na2.xls

sa1.xls


TEXT
sales1.xls

orders3.xls

sales2.xls

sales3.xls

apac1.xls

europe2.xls

na1.xls

na2.xls

sa1.xls

ca1.xls


REGEXP
[ns]a.\.xls


RESULT
sales1.xls

orders3.xls

sales2.xls

sales3.xls

apac1.xls

europe2.xls

na1.xls

na2.xls

sa1.xls

ca1.xls

Highlighting matching on regexp

hi all,

If you wish to declare a environment variable to have regular expression operates with grep where the standard output showing the colors, in fact, you can!

export GREP_OPTIONS='--color=auto'

Have fun.

yen_onn_hiu@nasilemak:~/regexp> grep .a.. text1
sales1.xls
sales2.xls
sales3.xls
apac1.xls
na1.xls
na2.xls
sa1.xls

Thursday, May 7, 2009

VAS troubleshooting skills

Yesterday, I have been spending times to debug the vastool. That's give me error when prompting the id of the account.

End up, I did a "vas merge" to get all the vas cache load into the /etc/passwd and /etc/group. That's pain. But, It works temporarily.

Here are the bunch of vas command for troubleshooting.

1. To check on the user access

vastool user checkaccess [account_name]

2. To get the vastool status result

ftp://ftp.vintela.com/vas/support/vas_status.sh.gz

To get the vastool snapshot

/opt/quest/libexec/vas/scripts/vas_snapshot.sh

3. To flush the cache

vastool flush

4. To check is vas

vastool isvas user [account name]

5. Test AD connection and user password
vastool kinit [account_name]

6. Test VAS service access control (assuming your using sshd)
vastool user checkaccess -s sshd [acount_name]

7. Check authentication logs
1) Add the words "debug" and "trace" to the end of all pam_vas lines in /etc/pam.d/system-auth
2) Add "*.debug /var/log/debug" to /etc/syslog.conf
3) Restart syslog daemon
4) Attempt login
5) Look at output in /var/log/debug for indication/reason of failure

8. You can also turn on vasd debug if desired
1) vastool configure vas vasd debug-level 3

Tuesday, March 3, 2009

vmware way of discovering lun

In order to list a vmware lun, please do this.

[root@testdev01 volumes]# esxcfg-mpath -l
Disk vmhba1:0:16 /dev/sdr (204800MB) has 4 paths and policy of Most Recently Used FC 10:0.0 10000000c9610905<->5006016941e02f2b vmhba1:0:16 Standby FC 10:0.0 10000000c9610905<->5006016141e02f2b vmhba1:1:16 On active FC 14:0.0 10000000c96106fc<->5006016041e02f2b vmhba2:0:16 On FC 14:0.0 10000000c96106fc<->5006016841e02f2b vmhba2:1:16 Standby preferred

Disk vmhba1:0:17 /dev/sds (204800MB) has 4 paths and policy of Most Recently Used FC 10:0.0 10000000c9610905<->5006016941e02f2b vmhba1:0:17 Standby FC 10:0.0 10000000c9610905<->5006016141e02f2b vmhba1:1:17 On active FC 14:0.0 10000000c96106fc<->5006016041e02f2b vmhba2:0:17 On FC 14:0.0 10000000c96106fc<->5006016841e02f2b vmhba2:1:17 Standby preferred

Disk vmhba1:0:18 /dev/sdt (204800MB) has 4 paths and policy of Most Recently Used FC 10:0.0 10000000c9610905<->5006016941e02f2b vmhba1:0:18 Standby FC 10:0.0 10000000c9610905<->5006016141e02f2b vmhba1:1:18 On active FC 14:0.0 10000000c96106fc<->5006016041e02f2b vmhba2:0:18 On FC 14:0.0 10000000c96106fc<->5006016841e02f2b vmhba2:1:18 Standby preferred

Tuesday, February 10, 2009

Discovering HBA information from RHEL3 and SLES10

If you wish to retrieve information on HBAs on RHEL3 or SLES10 SP1. Basically, here is the path that you are looking for.

RHEL3: /proc/scsi/lpfc/
SLES10 SP1: /sys/class/fc_host/

As for the SLES10 SP2 : /sys/class/scsi_host/

There are bunch of information like HBA model, firmware, speed, port_state and WWN.