GOOGLE Search

Google
 

Wednesday, December 26, 2007

Linux Tip No. 4: Sorting the Biggest Directory

This command will show the biggest directory.

[root@nuxmachine admin]# du -Sh | sort -n
4.0K ./backup
9.8M ./backup/web
11G ./backup/home
16K ./.ssh
28K ./backup/Dovecot
28K ./backup/users/last-full
36K .
36K ./backup/users
40K ./backup-sh
328K ./backup/Postfix
628K ./backup/MailScanner

Monday, December 17, 2007

Linux Tip No. 3: How to Check NIC Settings in Tru64

How to Check NIC Speed and Negotiation

#hwmgr get attr -cat network | grep -E "name|speed|duplex"

Thursday, December 13, 2007

Linux Tip No. 2: Combining Tail and Awk

- you can use this command to provide a nice output of logs.

Command:
>tail -f logs.log | grep -e "word" | awk '{ print $12 "\t" $13' }'

"word" - any line containing "word" will be captured
$12 - column 12
"\t" - space

Tuesday, December 11, 2007

How To: Foward Tape Content in Tru64

How To: Forward Tape Content in Tru64

root@machine01:/home/data/backup/databases# mt fsf 1
root@machine01:/home/data/backup/databases# vrestore -t -f /dev/ntape/tape0
vrestore: Date of the vdump save-set: Mon Nov 5 22:22:07 2007
vrestore: Save-set source directory : /home/data/backup/
vrestore: Target directory : /usr1/data/backup/

Tuesday, December 4, 2007

Devices on AIX

Devices on AIX

Devices Information on AIX

1.List all devices on a system
lsdev
Device states are: Undefined; Supported Device, Defined; Not usable
(once seen), Available; Usable

2.List all disk devices on a system (Some other devices are: adapter,
driver, logical volume, processor)
lsdev -Cc disk

3.List all customized (existing) device classes (-P for complete list)
lsdev -C -r class

4.Remove hdisk5
rmdev -dl hdisk5

5.Get device address of hdisk1
getconf DISK DEVNAME hdisk1 or bootinfo -o hdisk1

6.Get the size (in MB) of hdisk1
getconf DISK SIZE hdisk1 or bootinfo -s hdisk1

7.Find the slot of a PCI Ethernet adapter
lsslot -c pci -l ent0

8.Find the (virtual) location of an Ethernet adapter
lscfg -l ent1

9.Find the location codes of all devices in the system
lscfg

10.List all MPIO paths for hdisk0
lspath -l hdisk0

11.Find the WWN of the fcs0 HBA adapter
lscfg -vl fcs0 | grep Network

12.Temporarily change console output to /console.out
swcons /console.out (Use swcons to change back.)

Monday, December 3, 2007

Router: Traffic Shaping

Traffic Shaping

class-map match-any IB-11.70
match access-group name IB-11.70
!
class-map match-any OB-11.70
match access-group name OB-11.70
!
!
policy-map To-Public
class OB-11.70
shape average 256000
!
policy-map To-Lan
class IB-11.70
shape average 256000
!
!
interface FastEthernet0
description ***LAN side***
ip address 20.18.11.65 255.255.255.224
service-policy output To-Lan
speed auto
!
interface Serial0
description *** To Public Serial 2/1 ***
bandwidth 2000000
ip address 20.18.11.98 255.255.255.252
service-policy output To-Public
load-interval 30
clockrate 2000000
!
ip route 0.0.0.0 0.0.0.0 20.18.11.97
!
!
ip access-list extended IB-11.70
permit ip any host 20.18.11.70
ip access-list extended OB-11.70
permit ip host 20.18.11.70 any

Note:
The service is always in the OUTPUT policy.
Service Policy To-LAN is inbound of LAN.
Service Pplicy To-Public is outbound of LAN.

Linux Tip No. 1: Change Timezone

Change Timezone on AIX
chtz (timezone eg GMT0BST) - Changes the timezone in /etc/environment file