PS1 colors

Feb 14
2009

I like to see green prompt for userid > 0 and red for root, also the hostname and the history number of a command.

PS1="\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\\$\[\e[0m\]"
PS1="\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\\$\[\e[0m\]"

just another perlmonks’ post

Feb 06
2009

perldoc perlfaq1 | perl -ne ’/((?< =”)(.+hack…(?:OR)?))/&&die$2.$/’ -

how to monitor ip addresses from a log file

Jan 28
2009
tail -f production.log  | egrep "([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}"

Security Problems with KDE

Jan 18
2009

From tcpdump it becomes obvious that some kde apps are contacting jamaica.kde.org through http!?
I cannot understand this M$ type of behavior in UNIX env, neither I want , so here is a quick solution:


iptables -A OUTPUT -d 62.70.27.118 -p tcp -j DROP
iptables -A OUTPUT -j ACCEPT

Jojo (my cat)

Dec 05
2008

my cat

Filtering Lists

Dec 01
2008

Ruby

arr = (1..10).to_a
arr.select{ |e| e % 2 != 0 }

Python

arr = range(1,11)
[e for e in arr if e % 2]

Perl

@arr = (1..10);
grep($_ % 2, @arr);

Simple Email Hex Encoding

Nov 18
2008
#!/usr/bin/python
 
import re
 
hex_encode = lambda x: ("&#%i;" * len(x)) % (tuple(map(ord, re.findall('.', x))))
 
# hex_encode("root@example.com") =>;
# &#114;&#111;&#111;&#116;&#64;&#118;&#105;&#100;&#117;&#108;&#46;&#99;&#111;&#109;

Store Init Failed – Engine Init() Failed

Nov 15
2008

This nice post describes the fix for Opera email error.
On UNIX/Linux OS you can achieve the same effect with the following command:
pkill -9 opera
Then start Opera and everything should be fine.

Mozart N40

Nov 14
2008

I’m screaming revenge again
Wrong
I’ve been wrong for far too long
Been constantly so frustrated
I’ve moved mountains with less
When I channel my hate to productive
I don’t find it hard to impress

Bones in traction
Hands break to hone raw energy
Bold and disastrous
My ears can’t hear what you say to me

Hold your mouth for the war
Use it for what isn’t for
Speak the truth about me
Determined

Possessed
I feel a conquering will down inside me
Strength
The strength of many to crush
Who might stop me
My strength is in number
And my soul lies in every one
The releasing of anger can better any medicine under the sun

There comes a time within everyone to close your eyes to
what’s real
No comprehension to fail
I vacuum the wind for my sail
Can’t be the rest
Let others waste my time
Owning success is the bottom line.
Like a knife into flesh
After life is to death
Pulling and punching the rest of duration
NO ONE can piss on this determination

The Best Package Manager

Nov 04
2008

Zypper is fast and reliable package manager, and not slow and buggy like APT.

Calendar

May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags