Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revisionBoth sides next revision | ||
| code:bash [2014/06/24 06:20] ::ffff:79.194.146.55 | code:bash [2026/02/05 15:21] (current) 84.138.194.42 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| ====== bash ====== | ====== bash ====== | ||
| - | ===== snippets | + | ===== bashrc |
| < | < | ||
| - | [ $1 ] || { echo -ne "\033[0m>>> | + | # settings |
| + | TZ=' | ||
| + | # path | ||
| + | export PATH=" | ||
| + | export XDG_DATA_HOME=~/ | ||
| + | export XDG_CACHE_HOME=~/ | ||
| + | # sys | ||
| + | [ -f ~/ | ||
| + | [ -f / | ||
| + | |||
| + | |||
| + | # editor | ||
| + | set -o vi | ||
| + | export EDITOR="vim" | ||
| + | umask 022 | ||
| + | |||
| + | # history | ||
| + | export HISTFILESIZE=10000 | ||
| + | export HISTSIZE=10000 | ||
| + | shopt -s histappend | ||
| + | export HISTCONTROL=ignoredups | ||
| + | export LS_OPTIONS=' | ||
| + | eval `dircolors $HOME/ | ||
| + | |||
| + | # start screen | ||
| + | if [[ $- = *i* && -z " | ||
| </ | </ | ||
| + | ===== snippets ===== | ||
| + | # macros | ||
| + | [ $1 ] || { echo -ne " | ||
| + | |||
| + | ### pipes | ||
| + | ## sqlite to html | ||
| + | sqlite3 ex1 ' | ||
| + | |||
| + | ### tools | ||
| + | ## remove html | ||
| + | lynx -dump | ||
| + | |||
| ===== ip and gateway ===== | ===== ip and gateway ===== | ||
| Line 36: | Line 72: | ||
| </ | </ | ||
| + | |||
| + | ==== youtube-dl ==== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | <file bash yt.sh> | ||
| + | #!/bin/sh | ||
| + | COOKIE_FILE=/ | ||
| + | for i in $*; do | ||
| + | mplayer -cookies -cookies-file ${COOKIE_FILE} $(youtube-dl -g --cookies ${COOKIE_FILE} $i) | ||
| + | done | ||
| + | </ | ||
| + | |||
| + | ==== mysql ==== | ||
| + | |||
| + | ex=' | ||
| + | min() { echo $(( $1 < $2 ? $1 : $2 )); } | ||
| + | i=470; | ||
| + | a=$i; | ||
| + | $ex " | ||
| + | | ||
| + | | ||
| + | echo " | ||
| + | |||