Linux and Unix like operating systems comes with z* commands. These commands allow you to read gzip compressed text files using zless, zcat, zmore and friends commands. The gzip command reduces the size of the files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modification times. z* commands has some cool usage too; such as display the current time in different zonename.
I have already written a shell script to check/monitor domain renew / expiration date here. Now I have modified matty’s domain-check script to support additional C/TLDs .in, .biz, .org and .info domains. I’ve also added 5 seconds delay to avoid whois server rejecting the query. This script checks to see if a domain has expired. It can be run in interactive and batch mode and provides facilities to alarm if a domain is about to expire in advance.
I am little surprised to find that Ubuntu Linux skips development man pages by default on cloud-based images. A quick search using apt-cache pointed out that I need to install the manpages-dev package on a Ubuntu Linux. It includes manual pages about using GNU/Linux for development. The manpages-posix-dev package includes manual pages about using a POSIX system for development. The man-db package is the on-line manual page i.e. actual man command to view man pages on a Ubuntu or Debian Linux.
Install development man pages on Ubuntu/Debian Linux
Type the following apt-get command to install various packages to view man pages for C standard library functions in Ubuntu or Debian system: $ sudo apt-get install manpages-dev man-db manpages-posix-dev Sample outputs:
How do I view man pages?
To view library calls (functions within program libraries), enter: $ man 3 function-name $ man 3 putc $ man 3 strlen $ man 3 printf $ man 3 scanf $ man 2 execve $ man 2 fork The number 3 or 2 indicates the section numbers of the manual as follows:
2 : System calls (functions provided by the kernel)
3 : Library calls (functions within program libraries)
You need to verify that that downloaded Linux DVD or ISO images are intact before you burn and use them. This is security feature. But how do you verify ISO images?
Answer is quite simple use md5sum command to compute and check MD5 message digest.
Why verify ISO images?
a) To protect yourself b) Verify that a file has not changed as a result of file transfer, disk error, cracker attacks, etc.
How does it work?
When you run md5sum command on ISO file, you get checksum (or hash) on screen. You need to compare this checksum with original. It works as a compact digital fingerprint of a file. You can then compare the MD5 hash of your download ISO file, to the known good hash of the file you are checking. If the two values match, you are safe and use the ISO image.
Let us download FreeBSD ISO image: $ cd /tmp $ wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/6.2/6.2-RELEASE-i386-bootonly.iso
Next download MD5 checksum: $ wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/6.2/CHECKSUM.MD5
Bash / CSH shell offers command history feature. Most of you may be aware and using of UP / DOWN arrow keys to recall previous commands. History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous ommand into the current input line, or fix errors in previous commands quickly.
To repeat last command that started with bar word type i.e. refer to the most recent command starting with string bar): ! bar
For example, let us run lighttpd to test config file: # /usr/sbin/lighttpd -t -f /jail/usr/local/etc/lighttpd/lighttpd.conf Output:
Type few commands: # pwd # date Now to repeat last command that started with lighttpd word type # !lighttpd Output:
lighttpd -t -f /jail/usr/local/etc/lighttpd/lighttpd.conf
Want to refer to the previous command, just enter !!
If you are running Dell PowerEdge 2950 server or HP ProLiant BL480c G1 server and upgraded from old version to latest Red Hat Enterprise Linux ES release 4.5 (Nahant Update 5) you will notice that ordering of your NIC devices changed.
Fix problem before upgrade:
Before running upgrade via up2date command open /etc/sysconfig/network-scripts/ifcfg-eth0 file (for NIC 0) and add line HWADDR=My-MAC-ADDRESS
Now proceed to upgrade using up2date -u # up2date -u
Howto fix problem after upgrade:
However chances are very high that after running up2date -u command (i.e. after upgrade) you may notice the problem. Don’t panic. Open grub.conf file: # vi /etc/grub.conf
Find out current kernel line: kernel /vmlinuz-2.6.9-55.ELsmp ro root=LABEL=/ console=tty0 console=ttyS1,19200n8
Replace as follows: kernel /vmlinuz-2.6.9-55.ELsmp ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 pci=nobfsort
The pci=nobfsort option restore the original Kernel 2.6 ordering.
A final note
This problem is not Redhat specific. It can occurred on Suse or any other Linux distribution. Please see Linux enumeration of NICs solution published by Dell for more information.
/etc/shadow stores actual password in encrypted format for userâ€™s account with additional properties related to user password.
The password expiration information for a user is contained in the last 6 fields. Password expiration for a select user can be disabled by editing the /etc/shadow file
However I recommend using chage command. The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.
To list current aging type chage command as follows: # chage -l vivek Output:
Last password change : May 22, 2007
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
To disable password aging / expiration for user foo, type command as follows and set: Minimum Password Age to 0 Maximum Password Age to 99999 Password Inactive to -1 Account Expiration Date to -1 Interactive mode command: # chage username OR # chage -I -1 -m 0 -M 99999 -E -1 username