Monday, November 24, 2008

Check Hareware in Linux

Here're the commands:

For getting CPU, memory, paging, just "cat" the /proc files:
  • cat /proc/cpuinfo
  • cat /proc/meminfo
  • cat /proc/swaps
For getting "lower level" information such as PCI, USB:
  • lspci (list PCI)
  • lsusb (list USB devices)
  • lshw
More:
  • lsdev
  • dmidecode
  • biosdecode
  • vpddecode

How to check SAS raid disks in HP-UX (IA64)

Find out the sas device (usually /dev/sasd0) and use "sasmgr". See below example:

# sasmgr get_info -D /dev/sasd0 -q raid


Sat Sep 13 16:39:50 2008

---------- PHYSICAL DRIVES ----------
LUN dsf SAS Address Enclosure Bay Size(MB)

/dev/rdsk/c4t1d0 0x5000c5000a505f61 1 14 140014
/dev/rdsk/c4t3d0 0x5000c5000a5043ad 1 11 140014
/dev/rdsk/c4t4d0 0x5000c5000a505e8d 1 12 140014
/dev/rdsk/c4t5d0 0x5000c5000a50581d 1 13 140014

---------- LOGICAL DRIVE 12 ----------

Raid Level : RAID 1
Volume sas address : 0x9e5dcd189757869
Raid State : OPTIMAL
Raid Status Flag : ENABLED
Raid Size : 139136
Rebuild Rate : 20.00 %
Rebuild Progress : 100.00 %

Participating Physical Drive(s) :
SAS Address Enc Bay Size(MB) Type State

0x5000c500092f9689 1 9 140014 PRIMARY ONLINE
0x5000c500092f9d41 1 10 140014 SECONDARY ONLINE

HP-UX hardware info (IA64)

Just run "machinfo" !! (/usr/contrib/bin/machinfo)

In fact, CPU, Memory and serial number can be obtained.


#machinfo
CPU info:
Number of CPUs = 2
Clock speed = 1666 MHz
Bus speed = 666 MT/s
CPUID registers
vendor information = "GenuineIntel"
processor serial number = 0x0000000000000000
processor version info = 0x0000000020010104
architecture revision: 0
processor family: 32 Intel(R) Itanium 2 9100 series
processor model: 1 Intel(R) Itanium 2 9100 series
processor revision: 1 Stepping A1
largest CPUID reg: 4
processor capabilities = 0x0000000000000005
implements long branch: 1
implements 16-byte atomic operations: 1
Bus features
implemented = 0xbdf0000020000000
selected = 0x0000000000000000
Cache info (per core):
L1 Instruction: size = 16 KB, associativity = 4
L1 Data: size = 16 KB, associativity = 4
L2 Instruction: size = 1024 KB, associativity = 8
L2 Data: size = 256 KB, associativity = 8
L3 Unified: size = 9216 KB, associativity = 9
Memory = 16350 MB (15.966797 GB)
Firmware info:
Firmware revision = 04.03
FP SWA driver revision: 1.18
IPMI is supported on this system.
BMC version: 5.23
Platform info:
model string = "ia64 hp server rx3600"
machine id number = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
machine serial number = xxxxxxxxxx
OS info:
sysname = HP-UX
nodename = hptest
release = B.11.23
version = U (unlimited-user license)
machine = ia64
idnumber = xxxxxxxxxxxxx
vmunix _release_version:

AIX Static Route Admin

To add a static route (permanently)

chdev -l inet0 -a route="host,-hopcount,0,,-if,(interface),,(destination),(gateway)"


To remove a static route (permanently):

chdev -l inet0 -a delroute="host,,(destination),(gateway)″

Monday, February 25, 2008

Using Truecrypt to protect your data

In Hong Kong the "pron" photos topic is still very hot. It showed the limitation and contradiction between ethics, Law system and Information Technology. As a so called "IT person", I just want to point out that, if the photo owner had kept the photos well, nothing could have happened. Hence, it is very important for us to protect our personal data.

So how to protect and secure our data? At least we have to achieve the following things:
1. Only the owner can access the data
2. Even the data was stolen, the data still need to be decrypted

In order to implement the above points, the simplest way is to zip the data files with a password. In normal case other people would not access the access so easily. However, if you have a lots of data, just like Mr. Chan who owners thousands of photos, zipping files will be quite trouble. So it is recommended to use a free encryption tool "truecrypt", which can protect your data in an easy and secure way.

Truecrypt is different from Zip, we have to create a blank file and encrypt it (Using password or a keyfile), then mount it as a Windows drive or Linux mount point for storing your sensitive data. That encrypted file can be named or sized as you like, very flexible. Even though your hard disk is stolen, nobody will know which file can be mounted. In addition, you can also encrypt a partition rather than a file, which makes the hackers have a hard time.

There is also a "hidden mode", which is a encrypted area inside the file or partition, but with another password or keyfile. So in some situation you are forced to tell the password, you can just give the password of the "outer" part. As nobody can ensure the existence of the hidden part, your most important data will not be exposed.

Remember, do protected your important data !

Ref:
Truecrypt offical site
Truecrypt Tutorial in Chinese