Robert R Evans | a4d0242 | 2010-10-02 15:07:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Robert R Evans | a4d0242 | 2010-10-02 15:07:29 -0700 | [diff] [blame] | 3 | function ips { |
| 4 | ifconfig | grep "inet " | awk '{ print $2 }' |
| 5 | } |
| 6 | |
Robert R Evans | 070107a | 2010-10-02 15:23:57 -0700 | [diff] [blame] | 7 | function myip { |
| 8 | res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+') |
| 9 | echo "Your public IP is: ${LIGHT_GREEN} $res ${NORMAL}" |
| 10 | } |
| 11 | |
Robert R Evans | a4d0242 | 2010-10-02 15:07:29 -0700 | [diff] [blame] | 12 | |
| 13 | # View man documentation in Preview |
| 14 | pman () { |
| 15 | man -t "${1}" | open -f -a /Applications/Preview.app/ |
| 16 | } |
| 17 | |
| 18 | |
| 19 | pcurl() { |
| 20 | curl "${1}" | open -f -a /Applications/Preview.app/ |
| 21 | } |
| 22 | |
| 23 | pri() { |
| 24 | ri -T "${1}" | open -f -a /Applications/Preview.app/ |
| 25 | } |
| 26 | |
| 27 | |
| 28 | # disk usage per directory |
| 29 | usage () |
| 30 | { |
| 31 | if [ $1 ] |
| 32 | then |
| 33 | du -hd $1 |
| 34 | else |
| 35 | du -hd 1 |
| 36 | fi |
| 37 | } |