Skip to content
Browse files

Added some random scripts

  • Loading branch information...
1 parent 896eafb commit aa5e9f479a733ee6f73de89df6ae3f091044cb61 @dave1010 committed
Showing with 38 additions and 0 deletions.
  1. +30 −0 aliases.sh
  2. +7 −0 notify-apache-errors.sh
  3. +1 −0 sort-phpunit-tests-by-time.sh
View
30 aliases.sh
@@ -0,0 +1,30 @@
+
+alias .='pwd'
+alias ..='cd ..'
+
+alias g='git' # as i use git so much
+
+alias xclip='xclip -selection c' # copy stdin to x clipboard
+
+alias nano='nano -c' # show line numbers
+
+alias f='find . -name' # quick find
+
+alias phplint="find . -name '*.php' -exec php -l {} \; | grep -v 'No syntax errors detected'" # lint all php files in dir
+
+# search wikipedia
+function wiki () {
+COLUMNS=`tput cols`
+dig +short txt "${*}".wp.dg.cx | sed -e 's/" "//g' -e 's/^"//g' -e 's/"$//g' -e 's/ http:/\n\nhttp:/' | fmt -w $COLU$
+}
+
+alias ack='ack-grep' # http://betterthangrep.com/
+
+alias hl='ack --passthru' # highlight
+
+alias httpserver='ip && python -m SimpleHTTPServer' # serve current directory on port 8000
+
+alias 'ip=/sbin/ifconfig|grep "inet addr"|awk "{print \$2}"|sed s/addr://g' # get all local ip addresses
+
+alias nmap24='nmap -sP `ip`/24|grep report|awk " { print \$5 } "' # see what hosts respond to pings on your /24 network
+
View
7 notify-apache-errors.sh
@@ -0,0 +1,7 @@
+# use ubuntu's notification system to let us know when there's something new in the apache error log
+tail -n0 -f /var/log/apache2/error.log | while read line
+do
+ body=`echo $line | cut -f 9- -d ' '`
+ notify-send -c im.received -i error "Apache / PHP error" "$body"
+done
+
View
1 sort-phpunit-tests-by-time.sh
@@ -0,0 +1 @@
+grep time tests.xml | grep testcase | awk "{ print \$7 \$2 }"|sed 's/name="/ /g'|sed 's/time="//g'|sed 's/"\/>//g'|sed 's/"//g'|sort

0 comments on commit aa5e9f4

Please sign in to comment.
Something went wrong with that request. Please try again.