How to colorize bash prompt easily

Sometimes, the bash prompt can look a little dull and it may become difficult to recognize where the output of a command ends. Here I provide with a very simple way to customize your bash prompt by adding some colors.
First of all, add these colors definition to your .bashrc
## Fancy colors red='\[\e[0;31m\]' RED='\[\e[1;31m\]' blue='\[\e[0;34m\]' BLUE='\[\e[1;34m\]' cyan='\[\e[0;36m\]' CYAN='\[\e[1;36m\]' black='\[\e[0;30m\]' BLACK='\[\e[1;30m\]' green='\[\e[0;32m\]' GREEN='\[\e[1;32m\]' yellow='\[\e[0;33m\]' YELLOW='\[\e[1;33m\]' magenta='\[\e[0;35m\]' MAGENTA='\[\e[1;35m\]' white='\[\e[0;37m\]' WHITE='\[\e[1;37m\]' NC='\[\e[0m\]' # No Color
The variables you want to use are
- \u – username
- \h – host name
- \w – current absolute path
- \W for current relative path
- \$ – te prompt character (eg. ‘#’)
For example, my current setup looks like:
PS1="${green}\u${NC}@${green}\h ${BLUE}\w${NC} ${GREEN}\$ ${NC} "
Enjoy
Free your memory on Linux

No, this is not a howto to make your RAM Stallman-compliant.
Sometimes, it is handy to empty your caches, like when Virtualbox checks the available memory before actually starting. From linux 2.6.16 there are some nice tricks for dropping the memory cache, dentries and inodes.
First of all, we need to free all the cached objects.
Run as root:
syncThen, to free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
Now, check your available memory using free and all your cache are belong to us.. *hu-uhm* ..should have been freed. Freed as in freed-om
Installing Python 3 on Mac OS X Leopard

It’s a long time (almost a month!) I don’t write here anymore, but I’ve come back to teach you how to install Python 3.0 with readline support on Mac OS X 10.5 “Leopard” (incidentally I bought a Macbook
)
- Download the latest readline from the GNU readline homepage.
- Extract it in a folder.
- Download all the patches available here and save them in the same folder.
- Open Terminal and enter in that folder.
- Apply all the patches by running:
patch -p0 < patch_file_name
For example:
patch -p0 < readline52-001 patch -p0 < readline52-002 patch -p0 < readline52-003
- Configure, make and install:
./configure make && sudo make install
- Download the latest Python 3 release from here.
- Extract it and navigate to the folder with Terminal.
- Configure it by running:
./configure --enable-framework --with-readline-dir=/usr/local
- Compile and install it:
make && sudo make frameworkinstall
Here you go!
KDE-like bigger icons for Gnome menu
I’ve tried to use some kind of KDE like, bigger icons on my desktop for a while and I realized that it is really a pity to not use the wonderful 32×32 tango icons for the gnome menu also. If you want to try, it’s very simple:
gedit ~/.gtkrc-2.0
and put in this line:
gtk-icon-sizes = "panel-menu=32,32"and restart gnome-panel (maybe you could be more gracious :P):
killall gnome-panelHere is the outcome:

Open sopcast links on Linux
SopCast is a simple, free way to broadcast video and audio or watch videos and listen to radio on the Internet. To install it:
$ yaourt -S sopcastNow go to myp2p.eu and find a sopcast link for the event you want to watch.
$ SOPLINK=sop://broker.sopcast.com:3912/48609 $ /usr/bin/sp-sc $SOPLINK 3908 8908 > /dev/null & $ mplayer http://127.0.0.1:8908/tv.asf
Ta da!
