Blogging with attitude! You jump I watch!

22Feb/100

Yes fear systemadmins! as they come in many forms and sizes!

images credit goes to xkcd.com!

22Jan/090

Moving your GPG keys to another machine

It pretty straight forward step, the only thing you need to do is copy the *.gpg files (pubring.gpg;secring.gpg; trustdb.gpg; and trustedkeys.gpg, if it exists) along with gpg.conf from the GnuPG home directory (usually ~/.gnupg or C:\Documents and Settings\YOURUSERNAME\Application Data\gnupg) on the current machine to the new machine.

if you are moving it from linux to windows machine you can skip the gpg.conf files

:cayo: :06:

26Aug/080

/bin/rm: Argument list too long.

Have you ever encountered this particular messages? don't know what to do with it? I used to get this a lot on some of the freeBSD server that I maintain, mostly cause when I try to delete the sendmail queue's, my sendmail realy like to fill up the /var/spool partition :p so from time to time I have to delete it manually, but the thing is the folder contain to many files when I try to rm -fr * nasty "/bin/rm: Argument list too long." show up. Well the solution is fairly simple (for me that is) for me just use some shell script magic:

1st I make sure I'm in the /var/spool/mqueue, so we don't want accidentally delete the / partition don't we?, trust me I happen to me once good thing I run it on my VMware machine if not I' totally fsck :p. So back to our folder /var/spool/mqueue that is, I just issued this single line of shell script:

for x in *; do rm -vfr $x; done

and all the thousand files in /var/spool/mqueue is gone! there some other way to delete multiple files here a good example how with a different approach :

find . -name '*' | xargs rm

where "." is the current directory the command is being run

-EOF

15Nov/050

Kambing!

Takala kebosanan melanda maka lahirlah sekor kambing yang tidak dpt di kesan asal usul nyer!

#!#c:\Perl\bin\perl.exe -w
# KAMBING BOT!
use strict;
use IO::Socket;

# maklumat penting! untuk ternakan kambing anda
my $pelayan = "oblivion.ca.us.irchighway.net";
my $nama_kambing_anda = "kekambing";
my $spesis = "gurun";

# kandang kambing anda
my $kandang = "#saiyaman-malay";

# koneksi ke irc server
my $sock = new IO::Socket::INET(PeerAddr => $pelayan,
PeerPort => 6667,
Proto => 'tcp') or
die "kambing betul takleh connect plak\n";
# membuat koneksi ke pelayan
print $sock "NICK $nama_kambing_anda\r\n";
print $sock "USER $spesis 8 * :Kambing Ternakan zuan\r\n";

# baca info dari pelayan tunjuk kambing dah masuk
while (my $input = < $sock>) {
if ($input =~ /004/) {
last;
}
elsif ($input =~ /433/) {
die "kambing telah mampus di baham rimau!.";
}
}

# masuk ke kandang.
print $sock "JOIN $kandang\r\n";

while (my $input = < $sock>) {
chop $input;
if ($input =~ /^PING(.*)$/i) {
# main ping pong dengan server kalau tak nanti kene sembelih
print $sock "PONG $1\r\n";
}
else {
# taik kambing bersepah-sepah
print "$input\n";
}
}

* [kekambing] (~gurun@18251e65.2f9b2a4a.4e929bd.2fc699fcX): Kambing Ternakan zuan
* [kekambing] #saiyaman-malay
* [kekambing] irc.irchighway.net :The IRCHighWay Network
* [kekambing] End of WHOIS list.

PS: nak curik copy ke ape dengan kod di atas silakan takda sape nak marah lepas ko amik ko cakap ko punya aku curik yg ko pun aku takde nak marah nyer sebab aku pun lupa mane aku dapat coding ni har har har harun!