-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
150 lines (119 loc) · 2.94 KB
/
.bash_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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#Custom aliases
alias pj="cd ~/Projects"
alias home="cd ~/"
#Docker
alias d="docker"
alias dc="docker-compose"
alias ds="docker ps"
alias dpf="docker ps | grep $1 "
alias dcu="docker-compose up"
alias dcd="docker-compose down"
#Laravel DEV
alias pa="php artisan"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias wip="git add . && git commit -m 'wip'"
alias nah="git reset --hard && git clean -df"
alias p="phpunit"
alias pf="phpunit --filter "
alias art="php artisan"
alias migrate="php artisan migrate"
alias cda="composer dump-autoload"
alias cdao="composer dump-autoload -o"
alias tinker='php artisan tinker'
#Git
alias gp="git pull"
alias gs="git fetch && git status"
# Npm alias
alias np='npm'
# Npm install alias
alias npi='npm install'
alias npis='npm install --save'
alias npig='npm install -g'
# Npm update
alias npu='npm update'
alias npug='npm update -g'
# Npm search
alias nps='npm search'
# Composer alias
alias co='composer'
# Composer install and update aliases
alias coi='composer install'
alias cou='composer update'
# Smart ls alias
alias l='ls -lah'
# Make and change directory at once
alias mkcd='_(){ mkdir -p $1; cd $1; }; _'
# fast find
alias ff='find . -name $1'
# change directories easily
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# apt get
alias apt-get='sudo apt-get'
function extract() {
if [[ "$#" -lt 1 ]]; then
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
return 1 #not enough args
fi
if [[ ! -e "$1" ]]; then
echo -e "File does not exist!"
return 2 # File not found
fi
DESTDIR="."
filename=`basename "$1"`
case "${filename##*.}" in
tar)
echo -e "Extracting $1 to $DESTDIR: (uncompressed tar)"
tar xvf "$1" -C "$DESTDIR"
;;
gz)
echo -e "Extracting $1 to $DESTDIR: (gip compressed tar)"
tar xvfz "$1" -C "$DESTDIR"
;;
tgz)
echo -e "Extracting $1 to $DESTDIR: (gip compressed tar)"
tar xvfz "$1" -C "$DESTDIR"
;;
xz)
echo -e "Extracting $1 to $DESTDIR: (gip compressed tar)"
tar xvf -J "$1" -C "$DESTDIR"
;;
bz2)
echo -e "Extracting $1 to $DESTDIR: (bzip compressed tar)"
tar xvfj "$1" -C "$DESTDIR"
;;
tbz2)
echo -e "Extracting $1 to $DESTDIR: (tbz2 compressed tar)"
tar xvjf "$1" -C "$DESTDIR"
;;
zip)
echo -e "Extracting $1 to $DESTDIR: (zipp compressed file)"
unzip "$1" -d "$DESTDIR"
;;
lzma)
echo -e "Extracting $1 : (lzma compressed file)"
unlzma "$1"
;;
rar)
echo -e "Extracting $1 to $DESTDIR: (rar compressed file)"
unrar x "$1" "$DESTDIR"
;;
7z)
echo -e "Extracting $1 to $DESTDIR: (7zip compressed file)"
7za e "$1" -o "$DESTDIR"
;;
xz)
echo -e "Extracting $1 : (xz compressed file)"
unxz "$1"
;;
exe)
cabextract "$1"
;;
*)
echo -e "Unknown archieve format!"
return
;;
esac
}