5f89c81f3024eeb0d88abf27e1d0acf5a87f2191
[shellsnippets/shellsnippets.git] / bash-ksh / profile-funcs
1 # Not complicated enough for copyright.
2
3 # RFC2822
4 alias dateR='date +"%a, %d %b %Y %H:%M:%S %z"'
5
6 # clear screen
7 alias cls='echo -ne \\033c'
8 # clear screen, kill ssh-agent, and out
9 bye() {                 # cu ;-)
10         [ "$1" = k ] && ssh-agent -k
11         M='\033c'
12         [ $? -ne 0 ] && M='\033c Warning: ssh-agent returned error!\n'
13         echo -n "$M"
14         exit
15         logout
16 }
17
18 # print disc free stats in a more handy format
19 # for wider terminals than 80c, but deals well with LVM
20 df() {
21         command df -P "$@" | sed 's/Mounted on/Mountpoint/' | column -t
22 }
23
24 ddg() {                 # DuckDuckGo Search
25         ${BROWSER:-lynx} "https://duckduckgo.com/?kp=-1&kl=wt-wt&kb=t&kh=1&kj=g2&km=l&ka=monospace&ku=1&ko=s&k1=-1&kv=1&q=$*"
26 }
27
28 ggs() {                 # Google Search
29         ${BROWSER:-lynx} "http://www.google.com/search?hl=la&num=100&safe=off&q=$*"
30 }
31 ggr() {                 # Google GRoups
32         ${BROWSER:-lynx} "http://groups.google.com/groups?hl=la&num=100&safe=off&as_umsgid=$*"
33 }
34
35 ge() {                  # German English
36         ${BROWSER:-lynx} "http://dict.leo.org/?search=$*"
37 }
38 gfr() {                 # German Frensch
39         ${BROWSER:-lynx} "http://dict.leo.org/frde?search=$*"
40 }
41 ges() {                 # German Spanish
42         ${BROWSER:-lynx} "http://dict.leo.org/esde?search=$*"
43 }
44 espanol() {             # explica en espaƱol
45         lynx -dump --nolist "http://buscon.rae.es/draeI/SrvltGUIBusUsual?TIPO_HTML=2&LEMA=$*"
46 }
47
48 loadimage() {           # call xloadimage by URI
49         for fi in "$@"; do
50                 if [ -e "$fi" ]; then
51                         xloadimage "$fi"
52                 else
53                         wget -qO - "$fi" | xloadimage stdin
54                 fi
55         done
56 }