-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.aliases
More file actions
162 lines (137 loc) · 5.78 KB
/
.aliases
File metadata and controls
162 lines (137 loc) · 5.78 KB
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
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/env bash
# Make sure to add -e if being run by packer
#********************
# Easier Navigations
#********************
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
#********************
# Shortcuts
#********************
alias d="cd ~/Documents/"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias ap="cd ~/Applications"
alias key="cd ~/.ssh"
# Personal ~~~~~~~~~
# Can i use varialbe here for Atom?
alias a="cd ~/Documents/Atom"
alias dots="cd ~/Documents/*/OSX/dotFiles/"
alias c="cd " $1
#============================================
# SITES
#============================================
alias sites="cd ~/Documents/*/Sites"
alias ynt="cd ~/Documents/*/Sites/YourNewToys/Trellis"
alias nice="cd ~/Documents/*/Sites/Nice/Trellis"
alias mr="cd ~/Documents/*/Sites/MarketReactor"
alias pcclt="cd ~/Documents/*/Sites/PCCLT/Trellis"
alias spray="cd ~/Documents/*/Sites/SprayStorm/Trellis"
alias pp="cd ~/Documents/*/Sites/Spray/Trellis"
alias osx="cd ~/Documents/*/osx"
alias ansi="cd ~/Documents/*/Ansible"
# ~~~~~~~~~~~~~~~~~~
alias g="git"
alias h="history"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
export LSCOLORS='gxfxcxdxbxegedabagacad'
fi
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Le Listing
# Differentiate Directories from Files with 'ls' command colorized now
#
# -F show directory slashes; -G enable colorized output; -l list long; -L follow sym links; -A List all entries but . and ..;
# -h human readable file sizes; -t sort by time last modified; -p directory slashes; -S sort by size;
alias ls='CLICOLOR_FORCE=1 ls -GF'
# All Seeing List Eye
alias ll='ls -FGllAhp'
alias l='ls -FGLlhp'
alias lS='ls -FGlAhtpS'
alias lm='ls -FGlAhtp'
alias lc='ls -FGlAhtU'
#Figure out what fgrep and egrep are useful for, until then, just color grep
alias grep='grep -i --color=auto'
#alias fgrep='fgrep --color=auto'
#alais egrep='egrep --color=auto'
# Not sure if need- Enable aliases to be sudo'ed
# alias sudo='sudo '
# Get week number
alias week='date +%V'
# Get macOS Software Updates, and update installed brew and npm stuffs
alias update='sudo softwareupdate -i -a; brew update; brew upgrade --all; brew cleanup; npm install npm -g; npm update -g;'
# Flush Directory Service cache
alias flush="sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say flushed"
# Recursively delete '.DS_Store' files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# TEST THIS~~~
# Empty the Trash on all mounted volumes and the main HDD.
# Also, clear Apple’s System Logs to improve shell startup speed.
# Finally, clear download history from quarantine. https://mths.be/bum
#alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Disable Spotlight
alias spotoff="sudo mdutil -a -i off"
# Enable Spotlight
alias spoton="sudo mdutil -a -i on"
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume 7'"
# Kill all chrome tabs
alias chred="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Reload the shell
alias shell="exec $SHELL -l"
#**************************
#********UTILITIES
#**************************
# tree laze
alias t="tree"
alias cp="cp -iv"
alias mv="mv -iv"
# Vagrant Shortcut
alias vag="vagrant"
# Vagrant List Machines
alias vgs="vagrant global-status"
# Vagrant Destroy $1 -f
alias vd="vagrant destroy " $1
# Open Chrome
alias og="open -a 'Google Chrome'"
# Human Readable Filesize Information for current directory
alias du="du -h"
# List listenening ports
alias lsp="sudo lsof -i -n -P | grep LISTEN"
alias ip="curl icanhazip.com"
# This requires a brew install brew cask install switchaudio-osx
alias snd="SwitchAudioSource -a"
# Can't the fuck remember tar -xzvf or whatever the hell? Good, just type extract(<filename>) withouth the <> and hit enter, and this will rectumfy it.
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}