Bash Special Variables


To better understand the bash special variables, I wrote a script to help myself. #!/bin/bash #Usage of $#echo ------------------------------------------------------------echo -e You have entered $# arguments. #Usage of $*echo ------------------------------------------------------------export IFS='-'echo -e The arguments are: "$*" \(seperated by -\) #Usage of $@echo ------------------------------------------------------------n=1for arg in "$@"do        echo -e The $n argument is: "$arg"        let n+=1done #Usage … Continue reading Bash Special Variables

Ubuntu Wallpaper of the Day


My inspiration of the 'Wallpaper of the Day' comes from the Nation Geographic Photo of the Day. National Geographic recommends an amazing photo each day on this web site. I wrote a bash script to automatically set the photo as my desktop background everyday when I start my Ubuntu laptop. Create the following script then add … Continue reading Ubuntu Wallpaper of the Day

Auto Configure Proxy in Ubuntu


It is painful to turn the proxy on and off in my Ubuntu laptop between office and home.  As a lazy guy, I would like to make it automatic. Easy life now 🙂 1) Create 3 scripts named proxy_on, proxy_off and check_proxy under /usr/local/bin. #!/bin/bash #proxy_on gsettings set org.gnome.system.proxy.socks host 'proxy.company.local' gsettings set org.gnome.system.proxy.socks port … Continue reading Auto Configure Proxy in Ubuntu