Rename Subdirectories in a Tree: the Bash way

My granma always used to say every time she was recompiling the Linux Kernel of her wash machine: Bash Scripting is GREAT! Be sure you learn it. One day will understand why it can make your life much easier. And she was right! I鈥檓 not an Bash expert, but when I spend that 10 minutes putting together that scripts that _makes that tedious task piece of cake, the satisfaction is as tick as a Mug of Coffee. ...

September 30, 2010 路 2 min 路 277 words

Git-over-SSH through Socks 5 Proxy on Windows

Because of my work, I use crappy M$ Windows in my office. And we are behind a bidirectional firewall. So, how do you do if you need to pull/push code with Git-over-SSH in this scenario? You need a Socks 5 that passes the firewall, and some scripting. First, you need to install: Git on Windows - http://code.google.com/p/msysgit/ Connect.c - http://bent.latency.net/bent/darcs/goto-san-connect-1.85/src/connect.html Then, you need a script that connects to the Socks 5 server. Like: [sourcecode lang=鈥榖ash鈥橾 #!/bin/sh ...

August 13, 2009 路 1 min 路 200 words

Personalize your $PS1

Fancy $PS1 setting The code to make the Bash prompt looks like mine is (~/.bashrc): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 case $TERM in xterm*|rxvt*) TITLEBAR='\[\033]0;\u@\h:\w\007\]' ;; *) TITLEBAR="" ;; esac; PS1="${TITLEBAR}\n\[\033[0;0m\][\033[0;32m\]time: \ \[\033[0m\]\[\033[1;31m\]\t\[\033[0m\]\[\033[0;0m\]]-\ [\[\033[0m\]\[\033[0;32m\]host: \[\033[0m\]\ \[\033[1;31m\]\h\[\033[0m\]\[\033[0;0m\]]-\ [\[\033[0m\]\[\033[0;32m\]user: \[\033[0m\]\[\033[1;31m\]\u\ \[\033[0m\]\[\033[0;0m\]]-[\[\033[0m\]\[\033[0;32m\]bash: \ \[\033[0m\]\[\033[1;31m\]\v\[\033[0;0m\]]\n\ \[\033[0;0m\][\[\033[0;32m\]cwd: \[\033[0m\]\[\033[1;31m\]\w\ \[\033[0m\]\[\033[0;0m\]]# " Thanks to Bash Prompt HOWTO.

April 21, 2008 路 1 min 路 63 words