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
autocd off | |
cdable_vars off | |
cdspell off | |
checkhash off | |
checkjobs off | |
checkwinsize on | |
cmdhist on | |
compat31 off | |
compat32 off | |
compat40 off |
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
allexport off | |
braceexpand on | |
emacs on | |
errexit off | |
errtrace off | |
functrace off | |
hashall on | |
histexpand on | |
history on | |
ignoreeof off |
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 | |
youtube-dl "$@" --extract-audio --audio-format mp3 --audio-quality 320k |
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 | |
# Brynhildr in the Darkness (Chinese ver.) | |
usage="./batch.sh chapter pages" | |
[ "$#" -lt 2 ] && { echo "$usage"; exit 1; } | |
declare -i chapter="$1" | |
declare -i pages="$2" | |
_page='$$' | |
printf -v _chapter "%.2d" "$chapter" | |
raw_url="http://imgfast.dmzj.com/j/%E6%9E%81%E9%BB%91%E7%9A%84%E5%B8%83%E4%BC%A6%E5%B8%8C%E5%B0%94%E7%89%B9/${_chapter}/%E7%AC%AC1%E8%AF%9D_00${_page}.jpg" |
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 | |
for f in *; do ff="$(echo "$f" | sed 's/\(^.*\)\((320K)MP3\)\(.*mp3\)/\3/g')"; mv "$f" "$ff"; done | |
files=(*.mp3) | |
while read line; do lines+=("$line"); done < tracks | |
for i in $(seq 1 1 ${#files[@]}); do mv "${files[$i]}" "${lines[$i]}.mp3"; done |
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
wget -qO - "$1" | bash |
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
import sys | |
def get_int_bits(): | |
if hasattr(sys, 'maxsize'): | |
max_int = getattr(sys, 'maxsize') | |
else: | |
max_int = getattr(sys, 'maxint') | |
if max_int >> 62 == 0: | |
return 32 |
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 | |
# -r: landscape | |
# -2: two columns | |
# --highlight: syntax highlight | |
enscript -r -2 --highlight --line-numbers -o - $(ls *{.c,.h}) | ps2pdf - printout.pdf |
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
enscript --fancy-header --color=1 -1 --highlight --line-numbers -o - $(find . -mindepth 2 -type f -name *.py) | ps2pdf - printout.pdf |
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 | |
pattern="http://dcbdluf1ahqio.cloudfront.net/%s/%s.png" | |
service="$1" | |
width=${2:-42} | |
size="${width}x${width}" | |
url=$(printf "$pattern" "$service" "$size") | |
wget $url -O "${service}_icon.png" |
OlderNewer