30 Best Sources For Linux / *BSD / Unix Documentation On the Web

Posted on in Categories Debian Linux, FreeBSD, HP-UX, Linux, Linux distribution, OpenBSD, RedHat/Fedora Linux, Ubuntu Linux, UNIX last updated December 21, 2011

Man pages are written by sys-admin and developers for IT techs, and are intended more as a reference than as a how to. Man pages are very useful for people who are already familiar with Linux, Unix, and BSD operating systems. Use man pages when you just need to know the syntax for particular commands or configuration file, but they are not helpful for new Linux users. Man pages are not good for learning something new for the first time. Here are thirty best documentation sites on the web for learning Linux and Unix like operating systems.

Print / Select a paper size other than A4 when using lp command line utility

Posted on in Categories CentOS, Debian Linux, Hardware, Howto, HP-UX, Linux, OpenBSD, Shell scripting, Suse Linux, Tuning, Ubuntu Linux, UNIX last updated December 21, 2007

Under Linux / UNIX you use lp command to print files from command prompt. lp is quite useful when GUI is not installed on Linux box to print files. The lp command is simply a front end command that calls the lpr command with appropriate options. Its main use is to allow the running of precompiled binary programs and scripts that assume that the lp command is the official printing command.

Changing papa size is very easy under GUI environment. But how do you change paper size under command prompt?
By default lp print to A4 paper size. However sometime you need to print to different paper size from command prompt such as A3 or A5. To print to A3 size, enter:
$ lp -o media=A3 /path/to/file
Where,

  • -o media=size : Sets the page size to size. Most printers support at least the size names “a4”, “letter”, and “legal”.

Other useful examples

Print a double-sided legal document to a printer called “hpljf2”:
$ lp -d hpljf2 -o media=legal -o sides=two-sided-long-edge /path/to/file
Print an image across 4 pages using a printer called “epd2”:
$ lp -d epd2 -o scaling=200 filename
Print a text file with 12 characters per inch, 8 lines per inch, and a 1 inch left margin to a printer called “lpodc2”:
$ lp -d lpodc2 -o cpi=12 -o lpi=8 -o page-left=72 ~/info.txt

To know more about lp option, enter:
$ man lp

Please note that you need to configure print using CUPS configuration file /etc/cups/cupsd.conf or web based tool located at http://localhost:631/
Linux / UNIX CUPS HP printer at http://localhost:631/
(Fig 01: My CUPS Configuration, showing HP PhotoSmart Printer )

Linux Success Story: New York Stock Exchange Moves to Linux

Posted on in Categories Business, Hardware, High performance computing, HP-UX, Linux, News last updated December 15, 2007
Linux Success Story: New York Stock Exchange Moves to Linux

The New York Stock Exchange (NYSE), is the largest stock exchange in the world. NYSE wants to move away from proprietary platforms, so they selected HP hardware with Linux.

NYSE is investing heavily in x86-based Linux systems and blade servers as it builds out the NYSE Hybrid Market trading system that it launched last year. Flexibility and lower cost are among the goals. But one of the things that NYSE Euronext CIO Steve Rubinow says he most wants from the new computing architecture is technology independence. The NYSE has installed about 200 of HP’s ProLiant DL585 four-processor servers and 400 of its ProLiant BL685c blades, all running Linux and based on dual-core Opteron processors from Advanced Micro Devices Inc.

=> New York Stock Exchange Moves to Linux (Image credit: Wikipedia)

HP-UX: How Do I configure routing or add route?

Posted on in Categories Howto, HP-UX, Sys admin, Tips, UNIX last updated October 29, 2005

You can use route command to configure routing. Syntax is as follows:
route add net {network-address} netmask {subnet} {router-address}

Let us assume your router address is 192.168.1.254 and network ID is 192.168.1.0/24, then you can type route command as follows:
# route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.254

OR

To add a default route:
# route add default 192.168.1.254

Verify that (display) routing table is updated (display routing table):
# netstat -nr

Test it i.e. try to ping or send nslookup request:
# ping mycorp.com

To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f

However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file – /etc/rc.config.d/netconf. To add default router/gateway 192.168.1.254:
# vi /etc/rc.config.d/netconf

Add or modify following entries

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

Reboot HP-UX system/server to take effect
# shutdown -ry 0

HP-UX Booting from a system recovery Tape

Posted on in Categories Backup, HP-UX, UNIX last updated October 25, 2005

Recently one of our HP-UX servers went down and it needed recovery. Since I’m new to HP UX one of our senior UNIX admin pointed me that they have a system recovery tape. After going through our internal docs and other resources, I was able to recover system 🙂

Here is what I did…

First I had put recovery tape into the tape driver

As soon as system started (auto boot) I had to interrupt the autoboot sequence (press ESC key) and load tape into driver
Next I had type ‘search ipl‘ command so that it will search for my recovery tape driver
> search ipl

It will give output of different devices such as Random access media, look for Sequential Access Media (and its path number or hw path).
Here is what I typed to boot from tape (in my system

> boot 8/16/5.0
OR
> boot p2

Replace 8/16/5.0 or p2 with your actual tape drive h/w path. Once booting started, it will automatically restore it.

It took almost an hour to recover but it did the job. This tape made my system bootable. Next task was to restore all data from full and incremental backup and install needed additional software. I had typed following command on HP-UX box to restore all files and directory:

# frecover –f /dev/rmt/0m –rv

This emergency came around 5pm evening last Friday. I was just closing for that day and I was about to go home. I had spent 4 hours to restore box and other stuff.

Well good news it that my diwali holidays starts from coming Friday and it will lasted until November 7, 2005 :). I really need a break guys :D.