Monday, May 18, 2009

How to list Open Files?

Perl One liner
lsof | perl -lane '$x{"$F[0]:$F[1]"}++; END { print "$x{$_}\t$_" for sort {$x{$a}<=>$x{$b}} keys %x}'

Bash Command

lsof | awk '{print $2}' | sort -n | uniq -c | sort -n|tail -n 20


Friday, May 1, 2009

Bulls broke my heart!!

It was great game last night b/w celtics and bulls!!! It was s the 4th game with OT. Boston blew a decent lead on 4th qtr.  Rondo missed couple of free thorws and Brad Miller made open 3 which closed the gap. Ray Allen was awefullly good, and made 51.  PP, Perkins, Glen Davis all fouled out. On the final play, Rose blocked Rondo which sealed the game. 

I hate Jkim Noah!! Never in my life thought I wud hate that name that much!!

Next game on Garden. I guess Boston will win the series and host Orlando.

I picked Celtics, Nuggets, Mavs and Hawks to win the series. So far I am 2-0. I have no doubt Hawks will seal the deal, but not very sure about Celtics though.  

Happy Hoops!!


Friday, April 24, 2009

How to Determine RPM Architecture?

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' rpm name

How to Block an IP using IPTABLES?

As a root, 

iptables -I INPUT -s 196.3.164.40 -j DROP

How to verify?

iptables -L



Friday, December 19, 2008

How to Extract Files from an RPM?

I was working on an Infiniband Configuration(RHEL4U4), and successfully managed to screw up my initscripts rpm which has all the init scripts and network interface related scripts. This is how I restored the original files.

1. How to verify if a particular RPM is corrupted or modified?

#rpm -q --verify initscripts

2. How to restore orginal files from original RPM?

#rpm2cpio initscripts-7.93.25.EL-1.rpmcpio -ivd ( All files extracted to current directroy)
#rpm2cpio initscripts-7.93.25.EL-1.rpmcpio -ivd /etc/rc.sysinit (Extracts a single File)

Saturday, May 31, 2008

How to mount an ISO file in Solaris and Linux?

Solaris:-

You want to mount an iso called solaris.iso.

lofiadm -a /solaris.iso /dev/lofi/1
mkdir /mnt/iso1
mount -F hsfs -o ro /dev/lofi/1 /mnt /iso1

To UnMount,

umount /mnt/iso1
lofiadm -d /dev/lofi/1


Linux:-

You want to mount an iso called Linux.iso.

mkdir /mnt/iso1
mount -o loop,ro /root/Linux.iso /mnt/iso1

To UnMount

umount /mnt/iso1

That's it.

First eSh*t!

Just another dude dumps eSh*t on web!!

Cheers, Yo Man!