Skip to content

Instantly share code, notes, and snippets.

@scheibinger
Last active April 1, 2016 17:54
Show Gist options
  • Save scheibinger/bdb63c8c19dbf9c67c27811b6b43bc42 to your computer and use it in GitHub Desktop.
Save scheibinger/bdb63c8c19dbf9c67c27811b6b43bc42 to your computer and use it in GitHub Desktop.
Useful bash commands
#show disk usage of folders
find . -type d -maxdepth 1 -exec du -hcs {} \; | grep "./"	

#unzip recursively
find . -name "*.zip" -exec unzip {} \; -exec /bin/rm {} \;	

#curl POST data and newlines
cat /tmp/mm.txt | curl -d @- http://localhost:3000/message/new
cat /tmp/mm.txt | lwp-request -m POST  http://localhost:7600/edges/2269000	

#netstat
sudo netstat -plnt | grep '8080'	

#svn
svn log -r {2012-01-01}:HEAD -v

#misc
find . -type d -maxdepth 1 -exec du -hcs {} \; | grep "./"

#inject public key into another machine authorized_keys
cat ~/.ssh/id_rsa.pub | ssh vagrant@localhost -p 2222 tee -a '~/.ssh/authorized_keys'

#ubuntu

# Fix broken packages, or halt installed stuff
sudo dpkg --configure -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment