Archive for the 'AIX' Category

Extract an RPM

April 04th, 2008 | Category: AIX, Linux, Opensource

This is one of those things I only do occasionally, so here’s a note on how to do it.

rpm2cpio rpmarchive.rpm | cpio -idmv

This should extract the entire rpm into the current dir, so make sure you are in a clean dir before you do this. The rpm2cpio command should be available on any distro that uses rpm.

No comments

Found: Unix/Linux Gold

November 16th, 2006 | Category: AIX, Linux, Opensource

I stumbled upon this invaluable gem:

http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm

It is a page of over 200 tips and tricks for all sorts of *nix and opensource goodies, like this:


TIP 70:

Generating Random Numbers.

$ od -vAn -N4 -tu4 < /dev/urandom
3905158199

This guide is full of stuff that you may only do occasionally but you can never remember how to do it (like configuring Spamassassin (tip 92)). There’s also a lot of handy shell programming hacks, like this:


TIP 179:

history - bash command to get a history of all commands typed. But, here is a way
that you can get date and time listed as well.

$ HISTTIMEFORMAT="%y/%m/%d %T "

Defining the environment variable above give you the date/time info when you
execute history:

$ history
...
175 05/06/30 12:51:46 grep '141.162.' mout > mout2
176 05/06/30 12:51:48 e mout2
177 05/06/30 12:56:59 ls
178 05/06/30 12:57:02 ls
179 05/06/30 12:57:39 ls
180 05/06/30 12:57:49 ls -l
181 05/06/30 13:01:10 history
182 05/06/30 13:01:20 HISTTIMEFORMAT="%y/%m/%d %T "
183 05/06/30 13:01:23 history
...

Learn it! Live it! Love it!

Whatever.

No comments

Easiest way to get Vim colors in AIX

December 29th, 2005 | Category: AIX, Opensource

Put this in your .vimrc:

:if has("terminfo")
: set t_Co=16
: set t_AB=Esc[%?%p1%{8}%< %t%p1%{40}%+%e%p1%{92}%+%;%dm
: set t_AF=Esc[%?%p1%{8}%< %t%p1%{30}%+%e%p1%{82}%+%;%dm
:else
: set t_Co=16
: set t_Sf=Esc[3%dm
: set t_Sb=Esc[4%dm
:endif

(Note: the Esc’s should be replaced with a real Esc (Ctrl-v Esc).)

This should give you sixteen-color support if you are using an xterm (or a derivative, like rxvt, konsole, etc.) that supports color (the standard xterm in AIX 5.3 does not appear to support color). At least it did for me in the 30 seconds I took to test it. You can also change TERM:

TERM=xterm-color (only supports eight colors)
or
TERM=xterm-16color

If you make these changes to TERM though, you will most likely run into problems with other tools (like man and telnet) that won’t know about this terminal type, unless you update the terminfo database. The .vimrc code is courtesy of the excellent help in vim.

No comments

Find which CD a fileset is on

December 03rd, 2004 | Category: AIX

Need to load a base AIX fileset and don’t remember which CD it is on? Check the ‘.toc’ file in:

/<mounted cdrom dir>/usr/sys/mvCD/.toc

For example, if I vi the ‘.toc’ file and search for ‘bos.clvm’, I see something like this:

vol%3/bos.clvm 4 R I bos.clvm {
bos.clvm.enh 05.02.0000.0030 1 b B en_US Enhanced Concurrent Logical Volume Manager

So now I know that I need to load ‘volume 3′ for the fileset ‘bos.clvm.enh’.

No comments