Monday, December 3, 2007

cool stuffs

tail -100 /var/log/messages | tee /var/log/messages

find /olddir -depth | cpio -pdvm ./newdir

[root@abc123 ~]# dumpe2fs /dev/cciss/c0d0p9
dumpe2fs 1.37 (21-Mar-2005)
Filesystem volume name:
Last mounted on:
Filesystem UUID: a525996f-d183-45bc-bb39-1dc4d5d82825
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
Default mount options: (none)
...


cool.

Tuesday, September 11, 2007

Bored

I'm bored and lazy to write.

read more...

Thursday, August 23, 2007

HP-UX: Processors

[ROOT abc24]usr/sam # /usr/sbin/diag/contrib/pdcinfo -no_banner | grep "CPU("
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
[ROOT abc24]/tmp # echo "selclass qualifier cpu;info;wait;infolog" | cstm > /tmp/cpuinfo

read more...

Wednesday, August 22, 2007

Commandszz

One command looks like interesting, worth to look up for this:
pax - Extracts, writes, and lists archive files; copies files and directory hierarchies

read more...

Tuesday, August 21, 2007

HP-UX, bdf, du and ...

If you ever encounter a file system full, say, at this particular partition:
[ROOT gitu2]Z24/X41 # uname -a
HP-UX gitu2 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT gitu2]Z24/X41 # bdf /usr/sap/Z24/X41
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol30 4620288 4610752 9038 100% /usr/sap/Z24/X41
[ROOT gitu2]Z24/X41#


and you have been trimming, deleting files like crazy, say, you've delete a 1.7G file but when you issue bdf, the utilization still at 100%. But when you checked with du, it shows the current utilization on that particular partition/directory has been reduced. WTF?!

read more...

Thursday, August 16, 2007

Nifty...

Are you a Firefox fan? You might wanna try this: Roll Your Own Firefox™ Search Bar

read more...

Monday, August 13, 2007

Mari Tolak Beskal Session #1: FRIM "Dream Trail"

Yesterday my friend and I went to our first Bash (bike hash) at FRIM Dream Trail. Later lah full details.

read more...

Lesson Learned

Spending on more that 13 hrs in the office last Saturday gave us some real good lessons.

read more...

Friday, August 10, 2007

Linux "grep -A1 -B1" in HP-UX

cat syslog.*.gz | gzip -d - | sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h

The cat syslog.*.gz | gzip -d - can also be replaced by using this command: gzcat < syslog.*.gz

HP-UX: kthread: table is full

If you ever encounter this error in dmesg or syslog.log
[root abc12]home/root # dmesg | tail
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
kthread: table is full
[root abc12]home/root #
[root abc12]home/root # cat /var/adm/syslog/syslog.log | grep kthread
Aug 9 21:37:12 abc12 vmunix: kthread: table is full
Aug 9 21:37:14 abc12 vmunix: kthread: table is full
Aug 10 14:07:18 abc12 vmunix: kthread: table is full
Aug 10 14:07:20 abc12 vmunix: kthread: table is full
[root abc12]home/root #

Parameter             Current Dyn Planned                    Module     Version
maxusers 200 - 200

[root abc12]home/root #

*2nd option tu nampak cam terrer la sikit

If you wanna choose a less-headache version, use SAM. Don't know how to use SAM? Eat yourself.

read more...

Removing blank lines using grep

When you have something like this:
[root abcux]/tmp # cat lines.txt
line 1

line 3

line 4




line 9


line 10

#line 12


#line 15
line 16

[root abcux]/tmp #


but you want to exclude the blank lines and line starting with "#", do this...

read more...

Thursday, August 9, 2007

UNIX God

Interesting story! Must read!!

Wednesday, August 8, 2007

Command History

Linux (BASH):
1. At the terminal, press CTRL+r and type in your command to search, i.e. vi (thanks yoe)

HP-UX (POSIX):
1. At the terminal, press ESC or > arrow and press k for up or j for down.
2. You can search your command history by pressing ESC key and / followed by your command and press ENTER.

Geddit?

Monday, August 6, 2007

HP-UX Stuffs

1. List installed HP-UX patches
swlist -l product 'PH??_*'

2. ioscan command hang/slow.
Check for zombie processes of ioscan, try to kill 'em (if you know how to kill a ghost), or kill PPID (make sure PPID != 1 !!)

Thursday, August 2, 2007

New toy

Wednesday, August 1, 2007

Human Stupidity

I rest my case.

File name completion in HP-UX

Since HP-UX using POSIX shell, the file name completion is different than Linux's.

To do a file name completion, simply press ESC and =
Example:
[ux]home/saya $ cd .s<ESC>=
1) .sh_history
2) .ssh/
[ux]home/saya $ cd .s


It will list down possible filename/directory available in the pwd. Note that a directory will have trailing char "/"

Pathname Shell
shBourne shell
cshC shell
tcshTC shell
kshKorn shell
bashBourne Again SHell


--- Update 22 August 2007
Boleh jugak wat camnih (ESC twice):
[ux]home/saya$ cat abc<ESC><ESC>
[ux]home/saya$ cat abcdef.txt
saya suka makan nasik
[ux]home/saya$

read more...

SSH weirdness

Since this is my first time encounter this type of SSH error, so it was weird.

abc123 % ssh def456
Secure connection to def456 refused; reverting to insecure method.
Using rsh. WARNING: Connection will not be encrypted.
Password:


I was like, wtf?

read more...

Tuesday, July 31, 2007

LVM

[ROOT abc123]home/root # uname -a
HP-UX abc123 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT abc123]home/root # lvextend -L 600 /dev/vgs12xyz/lvxyz
[ROOT abc123]home/root # fsadm -F vxfs -b $((600*1024)) /db99/S99/db


Note: If you encounter "errno 28" then you need to free up some space before extending the fs

Monday, July 30, 2007

SunOS: Route delete problem

If you ever encouter problem deleting routing in SunOS, make sure you specify the netmask.

read more...

Friday, July 27, 2007

..

I must learn to be more confident in decision making.

read more...

Monday, July 23, 2007

Still... haven't started my engine..

For the past 2 weeks, I've done nothing but trained myself to familiarize with new surroundings, new tasks that I'm gonna be in deep shit later, and finding the right food(s) to eat when it is time to eat.

I would say, I enjoy the every bit of that moment, saving it up for the future.

read more...

Sunday, July 22, 2007

Read-More hacks

Got it from here.

read more...

300 new servers? By next Tuesday?




Advice to employees on the proper use of the System Administrator's valuable time

(In following examples, we will substitute the name "Ted" as the System Administrator)

* Make sure to save all your MP3 files on your network drive. No sense in wasting valuable space on your local drive! Plus, Ted loves browsing through 100+ GB of music files while he backs up the servers.
* Play with all the wires you can find. If you can't find enough, open something up to expose them. After you have finished, and nothing works anymore, put it all back together and call Ted. Deny that you touched anything and that it was working perfectly only five minutes ago. Ted just loves a good mystery. For added effect you can keep looking over his shoulder and ask what each wire is for.

read more...

Wednesday, July 11, 2007

Gentlemen, start your engines!

Well, basically I haven't started mine. Just got my new laptop on Monday and had been messing around this new gadget for 2 days already. But today is even better, I started to read, alot. So, don't expect any intelligent post(s) for today.

The new environment is, of course, different. But kinda like it here. Hopefully this gonna be my next long stop.

There's a lot of new things that I need to digest real quick and pray to God my brain won't explode. Those 'things' are most welcome by my brain, maybe because I'm new here, or maybe because of my willingness to accept that 'things'. I've been waiting for a very long time to learn that new 'things'!! Have you ever seen so damn many 'things' in one para? I know I did.

New friends, new workplace, new cubicle, new laptop, and (soon) new headache(s).

Oo-lala.

Sunday, July 8, 2007

The new beginning

Well, last Friday was my last day at SXXX. I missed my colleagues already. I missed the sweet old days I had with em and yah, the bitter days. But, a man's gotta do what a man's gotta do.

Tomorrow will be the new era of my life. I'm gonna start doing system administration, the one that has been one of my passion all this time. All that I hope is that my passion will eventually lead me somewhere far.

I'm not the type who has a lot of idea to write/type, especially when I'm started to write, so I'm gonna stop right here, for today of course.

Wish me luck, and God Bless you all.

Tuesday, July 3, 2007

awk notes

AWK syntax:
awk [-Fs] "program" [file1 file2...] # commands come from DOS cmdline
awk 'program{print "foo"}' file1 # single quotes around double quotes
# NB: Don't use single quotes alone if the embedded info will contain the
# vertical bar or redirection arrows! Either use double quotes, or (if
# using 4DOS) use backticks around the single quotes: `'NF>1'`

# NB: since awk will accept single quotes around arguments from the
# DOS command line, this means that DOS filenames which contain a
# single quote cannot be found by awk, even though they are legal names
# under MS-DOS. To get awk to find a file named foo'bar, the name must
# be entered as foo"'"bar.

awk [-Fs] -f pgmfile [file1 file2...] # commands come from DOS file

If file1 is omitted, input comes from stdin (console).
Option -Fz sets the field separator FS to letter "z".

AWK notes:
"pattern {action}"
if {action} is omitted, {print $0} is assumed
if "pattern" is omitted, each line is selected for {action}.

Fields are separated by 1 or more spaces or tabs: "field1 field2"
If the commands come from a file, the quotes below can be omitted.

read more...

sed and awk notes

Some useful notes:

Chart of similar operations with sed and awk
--------------------------------------------

string
======

sed "s/from/to/" awk '{sub("from","to"); print}'

sed "s/from/to/g" awk '{gsub("from","to"); print}'

sed "s/from/to/3" awk '{$0=gensub("from","to",3); print}'


regex
=====

sed "s/reg.*$/_&_/" awk '{sub(/reg.*$/, "_&_"); print}'

sed "s/reg[ex]/YY/g" awk '{gsub(/reg[ex]/, "YY"); print}'

sed "s/reg[ex]/ZZ/4" awk '{$0=gensub(/reg[ex]/, "ZZ", 4); print}'

Taken from: http://www.student.northpark.edu/pemente/awk/awk_sed.txt

read more...

Monday, July 2, 2007

marriages

Lately, I received a lot of marriage invitations.. yeah of course, it's my friends that are getting married. Here some interesting excerpt of the ym conversation I just had with my friend:



Hehe.

read more...

Wednesday, June 27, 2007

yet another blog by another *NIX admin

The new beginning...

So far, I don't have any good idea what to write, so don't expect any intelligent post for the next couple of days (or maybe months!).

Stay tune for more updates!