#Peter's dotfiles
This is a collection of dotfiles customised for my own usage.
Based on Roderik's dotfiles and Matt's dotfiles
##List of aliases/functions
Navigation | ||
---|---|---|
Alias | Method | Description |
cdf | (fuction) | cd to path indicated by Finder.app instance |
tab | (fuction) | create new iTerm tab with current dir and virtualenv |
splittab | (fuction) | splits tab with current dir and virtualenv. Options v - vertical, h - horizontal |
.. | cd .. | cd up |
... | cd ../.. | cd 2 x up |
~ | cd ~ | cd to home directory |
- | cd - | cd to previously visted folder |
cdd | cd ~/Downloads | |
cdp | cd ~/Projects | |
cdw | cd ~/Work | |
Opening files | ||
Alias | Method | Description |
o | open | |
o. | open . | |
Listing | ||
Alias | Method | Description |
ll | ls -l | |
la | ls -la | |
lsd | ls -l | grep "^d" | |
Network | ||
Alias | Method | Description |
server | function | host python SimpleHTTPServer in current directory. Port might be given as parm (port) |
ip | dig +short myip.opendns.com @resolver1.opendns.com | return ip |
localip | ipconfig getifaddr en1 | return local ip |
whois | whois -h whois-servers.net | |
flush | dscacheutil -flushcache && killall -HUP mDNSResponder | flush DNS |
sniff | sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80' | sniff HTTP |
httpdump | sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\" | |
json | function | Syntax-highlight JSON strings or files |
GET|POST|PUT|DELETE [url] | lwp-request -m '[METHOD]' | send GET/POST/PUT/DELETE request |
Others | ||
Alias | Usage | Description |
killp | killp 8080 | kill all processes working on port 8080 |
mkd | mkd iLikePizza | make dir and cd to it |
copy | copy cat ~/.ssh/id_rsa.pub | copy given content to clipboard |
dataurl | dataurl image.png | return base64 of given object |
update | update | update gem, brew, system etc. |
lscleanup | lscleanup | clean up given dir |
cleanup | cleanup | clean up current dir |
emptytrash | emptytrash | clean trash |
urlencode | urlencode http://google.com | encode given url |
mergepdf | mergepdf --output out.pdf file1.pdf file2.pdf | merge PDF files |
beep | sleep 2 && beep | notify task is done |
extract | extract file.zip | extract given file |
roll | roll file.zip file.png file.jpg | create zip/tar/tar.gz archive from listed files |
##Directory structure
- ~/Projects - own projects main dir
- ~/Work - work projects main dir
##Virtualenv
- virtualenv directory
~/.virtualenvs
- create new virtual env -
mkvirtualenv [env_name]
- remove existing one -
rmvirtualenv [env_name]
- workon existing one -
workon [env_name]
##SSH
In order to have auto-complete option you have to add all yours hosts into .ssh/config
file.
Example .ssh/config
file:
Host github
HostName github.com
User piotrgiedziun
IdentityFile ~/.ssh/id_rsa
Host example.com
User foreveryoung
IdentityFile ~/.ssh/foreveryoung_rsa
##Prerequisites
- brew - The missing package manager for OS X [download]
- iTerm2 - http://www.iterm2.com/downloads/beta/iTerm2-1_0_0_20130811.zip
##Installation Open terminal and type
git clone https://github.com/piotrgiedziun/dotfiles.git && cd dotfiles && sudo ./install
# if you want to have sublime attached
ln -sf /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl