This file contains hidden or 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 | |
parse_options(){ | |
N=5 # default line number | |
while getopts "n:" OPT; do | |
case ${OPT} in | |
n) N="$OPTARG" ;; | |
esac | |
done | |
shift $(($OPTIND-1)) |
This file contains hidden or 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 | |
N=$(head -n1 $1) | |
S=$(tail -n1 $1) | |
A=$(echo ${S}|tr -d [BCDF]) | |
B=$(echo ${S}|tr -d [ACDF]) | |
C=$(echo ${S}|tr -d [ABDF]) | |
D=$(echo ${S}|tr -d [ABCF]) | |
F=$(echo ${S}|tr -d [ABCD]) |
This file contains hidden or 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 | |
fizzbuzz(){ | |
NUM="" | |
(($1 % 3 == 0)) && NUM=${NUM}Fizz | |
(($1 % 5 == 0)) && NUM=${NUM}Buzz | |
[ ! ${NUM} ] && NUM=$1 | |
echo ${NUM} | |
} |
This file contains hidden or 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
mplayer -playlist http://mfile.akamai.com/129933/live/reflector:46051.asx\ | |
-ao pcm:waveheader:fast:file=/dev/stdout -vo null -vc dummy -really-quiet -quiet |\ | |
lame -h -ms - ~/20120320-nhkfm.mp3 |
This file contains hidden or 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 echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free" > /etc/apt/sources.list.d/backports.list | |
sudo apt-get update | |
sudo apt-get -t squeeze-backports install nautilus-dropbox |
NewerOlder