Archive for April, 2007

Checking 3ware drives in Linux 

Where n should be the unit number of the drive is question (0,1,2,3,etc) and /dev/sda should be replaced with the logical drive path:
smartctl -a -d 3ware,n /dev/sda

Iptables Port Redirection 

How to redirect to another port on the same server:
iptables -t nat -A PREROUTING -p tcp -i eth0 -d $SERVER –dport 25 -j DNAT –to $SERVER:2525
Redirect a port to another server ($SERVER2):
iptables -t nat -A PREROUTING -p tcp -i eth0 -d $SERVER1 –dport 25 -j DNAT –to $SERVER2:25
iptables -A FORWARD -p tcp -i eth0 -d [...]

Translation from gigabytes to kilobytes 

1 GB = 1048576 kilobytes
2 GB = 2097152 kilobytes
3 GB = 3145728 kilobytes
4 GB = 4194304 kilobytes
5 GB = 5242880 kilobytes
6 GB = 6291456 kilobytes

Power requirements for Dell servers 

Dell PowerEdge 1550
Total Power (Watts): 317
Total Power (VA): 453
Total Thermal (BTU/hr): 1083
Dell PowerEdge 1650
Total Power (Watts): 206
Total Power (VA): 294
Total Thermal (BTU/hr): 704
Dell PowerEdge 1850
Total Power (Watts): 287
Total Power (VA): 410
Total Thermal (BTU/hr): 980
Dell PowerEdge 1950
Total Power (Watts): 317
Total Power (VA): 453
Total Thermal (BTU/hr): 1083
Dell PowerEdge 2650
Total Power (Watts): 267
Total Power (VA): 381
Total Thermal (BTU/hr): [...]

List open files 

This command lists regular files that are open by running processes:
lsof -n | grep REG
Or just grep for the file you are looking for:
lsof -n | grep $filename