-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
75 lines (60 loc) · 2.19 KB
/
aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# vim: set filetype=sh:
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# don't export it because we only want it in interactive shells
CDPATH=.:~/:~/projects
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
if [[ $OSTYPE =~ ^darwin ]]; then
alias ls='ls -G'
else
alias ls='ls --color=auto'
fi
fi
if [[ ! -x $(command -v pbcopy) ]]; then
# On linux we can still do a pbcopy like thing
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
fi
# some more aliases
alias ll='ls -l'
alias la='ls -a'
alias c='clear'
alias cpwd="pwd | ruby -pe'\$_.chomp!' | pbcopy" # copy path to clipboard
# This breaks scripts, it's not a good idea
# alias grep='grep --color --line-number'
alias vim='nvim'
alias vi='nvim'
alias mv='mv -i' # prompt before moving a file that would overwrite an existing file
alias lop='sudo lsof -i -P | grep -i "listen"' # show open ports
if [[ $OSTYPE =~ ^darwin ]]; then
alias icons='cd ~/Pictures/icons; open -a Preview **/*.png **/*.tiff **/*.jpg'
alias preview='open -a Preview'
fi
# Rails
alias bx='bundle exec'
alias devlog='tail -200 -f log/development.log'
alias bxr='bundle exec rspec'
alias testlog='tail -200 -f log/test.log'
# Git
alias gitrm='git ls-files -z --deleted | xargs -0 git rm'
alias gitx='gitx --all'
alias gpci='git-pair commit'
alias gp='git pair'
alias gst='git status'
alias gc='git commit'
alias gd='git diff'
alias gdc='git diff --cached'
alias getch='git fetch'
alias gf='git br -a | grep '
# Docker
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
# Delete all stopped containers and untagged images.
alias dockerclean='dockercleanc || true && dockercleani'
# alias wakewoody='wakeonlan -i 192.168.2.255 70:85:C2:A1:B9:CE'
alias wakechomsky='wakeonlan -i 192.168.2.255 fe80::8ace:52b8:b9d8:34e8'