Skip to main content

Posts

Showing posts with the label tips

Dig that!

Here are some handy ‘dig’ commands to verify DNS records: Do a hostname lookup # dig www.google.com ; <<>> DiG 9.4.1 <<>> www.google.com ;; global options:  printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 76 ;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.google.com.                        IN      A ;; ANSWER SECTION: www.google.com.         84790   IN      CNAME   www.l.google.com. www.l.google.com.       259     IN      A       209.85.148.104 www.l.google.com.       259     IN  ...

AIX file system group

Group a bunch of file systems together using mount group option:                            Add an Enhanced Journaled File System Type or select values in entry fields. Press Enter AFTER making all desired changes.                                                         [Entry Fields]   Volume group name                                   datavg   SIZE of file system           Unit Size     ...

AIX: kill all the processes started b...

AIX: kill all the processes started by an user You can kill all the processes started by an specific user using the following methods: 1.  login as the user (su if you are a root) and execute killall 2.  form the kill command using a ps/awk/ksh combination       ps -u <user> | awk '{print "kill -9 "$2""}' | ksh 3.  use xargs to do the same      ps -u <user> | awk '{print $2}' | xargs -t kill -9 I prefer the (3) as it takes care of long listing of processes and it does the executes on kill command for all the processes. Additional notes: find . -name "*.bak" -print0 | xargs -0 -I file  mv file ~/old.files

Resetting gnome-panel in ubuntu

Resetting gnome-panel in ubuntu While trying to customize the gnome panel on ubuntu I lost access to the panel (after enabling the auto-hide feature).  After trying several things to reset the gnome panel to its original setting (or disable the auto-hide), nothing brought the panel back.  Finally, figured out a way to reset everything to the factory defaults for the gnome-panel with a single command:  gconftool-2 --recursive-unset /apps/panel Also restarted the gnome-panel by killing it from the command prompt killall gnome-panel

Cryptographic Sum Command

Users often use the sum command to generate a checksum to verify the integrity of a file. However, it is possible for two distinct files to generate the same checksum. A cryptographic sum command, csum , has been implemented in AIX 5L Version 5.3 that offers a more reliable tool to verify file integrity. This command allows users to generate message digests using the AIX Cryptographic Library. The new, cryptographic, checksum is considered more secure than the old mechanism. While it is reasonably straightforward to construct data that will match the checksum generated by the sum command; it is computationally infeasible to construct data to generate a known cryptographic checksum, as provided by csum . csum allows users the option to select the algorithm that they prefer, including both MD5 and SHA-1, which are considered secure. It is estimated that the order of 2**64 operations would be required to derive two different files, which generate the same MD5 message digest. Also, t...

RAM disk in AIX

RAM disk in AIX AIX provides 'mkramdisk' command for producing a disk that resides in the RAM for very high I/O intensive applications like database. Here is a simple set of commands to create a ramdisk and a filesystem on top of it: create a RAM disk specifying the size          # mkramdisk 5G The system will assign the available RAM disk.  Since this is the first one, it will be called as ramdisk0 Check for the new disk         # ls -l /dev | grep -i ram If there isn't sufficient available memory, the mkramdisk command will warn about the same during the creation. Create and mount a filesystem on top of the ram disk     # mkfs -V jfs2 -o log=INLINE /dev/ramdisk0     # mkdir -p /ramdisk0     # mount -V jfs2 -o log=INLINE /dev/ramdisk0 /ramdisk0 The new filesystem will now be available like any other FS.   To remove a ram disk, unmount/remove the filesystem and us...

Convert Epoch Time in AIX

One of the frequent conversion I do on UNIX is to and from epoch time to regular date time. Epoch time is the number of seconds elassed since midnight 1970 till now. It is widely used in the UNIX operating systems to represent timestamp for an event etc. For example, it is used to store the last time a password was changed by a user, which will be used by the OS to lock the user if the password has expired. As a unix administrator, we have to frequently convert this information to and from epoch time to find out when was the last time the password was changed for a particular user. There are many online sites available for this conversions. But most of the time we will be needing this to incorporate in a script run from the system where you cannot access online resources. Here are some of the 'one liners' we can use to convert to and from epoch time: 1. Print curent epoch time: date +%s perl -e 'print time' 2. Convert regular time to epoch time: date +%s -d...

AIX NTP Configuration

NTP is used to synchronize time between a client and time server. To enable NTP on AIX server, Uncomment the xntpd line in rc.tcpip update /etc/ntp.conf file with the time server information start xntpd manually by with startsrc command startsrc -s xntpd Verify if the xntpd has started correctly lssrc -s xntpd To list all the NTP information, use lssrc with long listing lssrc -ls xntpd Other tools available for debugging NTP: ntpdate - syncs date with timeserver ntpq - query ntp server for information ntptrace - trace ntp communication