This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function shw_grey { echo -e '\033[1;30m'"$1"'\033[0m'; } | |
function shw_norm { echo "$1"; } | |
function shw_info { echo -e '\033[1;34m'"$1"'\033[0m'; } | |
function shw_warn { echo -e '\033[1;33m'"$1"'\033[0m'; } | |
function shw_err { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; } | |
function shw_usage { | |
cat <<EOT | |
Resize all JPEG files in current directory, to <GEOMETRY> size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#download the script into the Dropbox folder | |
cd $HOME/Dropbox && wget "http://gist.github.com/raw/564419/35634bc7a13e22dd58b5b0db645c2620b5aedc20/bckpDir2home.sh" | |
#and run it whenever you want to make a new backup. | |
cd $HOME/Dropbox | |
bash bckpDir2home.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Download the script OpenDns_setup_dhclient.conf.sh | |
wget "http://gist.github.com/raw/565137/0ac98870256cbdb53eb8c16ccb69008a95c20127/OpenDns_setup_dhclient.conf.sh" | |
#Run it once as root | |
sudo bash OpenDns_setup_dhclient.conf.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "\e[1;30msome color text\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e '\033[37m\033[44mprint your text - everything written from now on will have the previous colors, untill you turn them off\033[0m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e '\033[37m' #turn on foreground color: white | |
echo -e '\033[44m' #turn on background color: blue | |
echo 'print your text - everything written from now on will have the previous colors, untill you turn them off' | |
echo -e '\033[0m' #turn off foreground and background color, to defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#allow user "zipizap" to use "sudo" for all commands, without password | |
zipizap ALL=(ALL) NOPASSWD: ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#allow group "mygroup" to use "sudo /my/command/that/will/be/run/as/root" without password | |
%mygroup ALL = NOPASSWD: /my/command/that/will/be/run/as/root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo visudo | |
#add the following to the end of the file: | |
#allow user "zipizap" to use "sudo /usr/bin/aptitude" without asking for password | |
zipizap ALL = NOPASSWD: /usr/bin/aptitude | |
#save and close the edited file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shw_grey { echo -e '\033[1;30m'"$1"'\033[0m'; } | |
function shw_norm { echo "$1"; } | |
function shw_info { echo -e '\033[1;34m'"$1"'\033[0m'; } | |
function shw_warn { echo -e '\033[1;33m'"$1"'\033[0m'; } | |
function shw_err { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; } | |
shw_grey "Blablabla nothing interesting..." | |
shw_norm "I reclaim some attention, but still within normality" | |
shw_info "I'm an info message - I stand out" | |
shw_warn "We must fix our economic system" |