-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases_general
191 lines (159 loc) · 4.74 KB
/
.aliases_general
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# Aliases created for command prompt general commands - navigation/commands
## Author: John Langdon
### Author: John Langdon
# alias brc="source $HOME/_langdon/bash/.aliases_general && source $HOME/_langdon/bash/.aliases_git && source $HOME/.bashrc && source $HOME/.zshrc"
# alias rc="source $HOME/_langdon/bash/
# alias bashrc="&& echo \" ~/.bashrc refreshed \""
alias vscodesettings="open ~/Library/Application Support/Code/User/settings.json"
alias findershowhidden="defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder"
alias go="chdir"
alias gor="chdir /"
alias goru="chdir ~"
alias to=go
alias tor=gor
alias toru=goru
alias forcekill="sudo rm -rf"
alias killfasho=forcekill
alias 86=forcekill
alias dev="foundation watch"
alias _langdon="cd $HOME/_langdon/ && ls -achs"
alias editbash="open $HOME/_langdon/bash/.aliases_general && open $HOME/_langdon/bash/.bashrc && open $HOME/_langdon/bash/.aliases_git && open $HOME/.zshrc"
alias eb=editbash
alias ebash=editbash
alias todocs="$HOME/Documents/Langdon"
alias godocs=todocs
alias cddocs=godocs
alias localsandbox="cd $HOME/Documents/Langdon && ls -achs"
alias lsandbox=localsandbox
alias lsb=lsandbox
alias o="open"
alias c="clear"
alias @="pwd"
alias l="ls -ah"
alias ls="ls -ah"
alias ll="ls -ah"
alias prev="cd - && ls -achs"
alias back="cd - && ls -achs"
alias up="cd ../ && ls -achs"
alias up1="cd ../ && ls -achs"
alias up2="cd ../../ && ls -achs"
alias up3="cd ../../../ && ls -achs"
alias up4="cd ../../../../ && ls -achs"
alias up5="cd ../../../../../ && ls -achs"
#
#
## if X exists (folder) do nothing - otherwise, search for Y:
##
# -= find all directories + 1 dir
# find . -type d -path '*/node_modules/*' -prune -print
#
# change user name :
alias ownthisdir="sudo chown -Rv ujxl846 ."
#[[ ! -z "$var" ]]
function linknode() {
if [[ -z ${1+x} ]]; then
echo "linknode requires a specified version of node."
echo "use 'brew search node' to view list of available versions to link"
else
brew link --force --overwrite node@$1
fi
}
#[[ ! -z "$var" ]]
function unlinknode() {
if [[ -z ${1+x} ]]; then
echo "unnode requires a specified version of node."
echo "use 'node -v' to get the version of node that is currently linked"
else
brew unlink node@$1
fi
}
function cdd() {
if [[ -z ${1+x} ]]; then
echo "cd must have a directory path"
echo "Pattern: cd [arg1:dirpath]"
echo " Example: cd ~/Users/Documents/Super-Cool-App/readme.md"
echo ""
else
echo "From: "
echo " " &&
pwd &&
cd $1
echo " "
echo "To: "
echo " " &&
pwd &&
ls -achs
if [[ -z ${2+x} && $2 == "t" ]]; then
fi
fi
}
function echo_pub() {
cat ~/.ssh/id_rsa.pub
}
function copyssh() {
if [[ (-z ${1+x}) ]]; then
echo " "
echo "**Warning**"
echo "Improper use of the 'copy_ssh_from' function"
echo " "
echo "Please provide a complete path to ssh file ie ~/"
echo " "
else
pbcopy <$1
fi
}
function new_ssh() {
if [[ (-z ${1+x}) ]]; then
echo " "
echo "**Warning**"
echo "Improper use of the 'new_ssh' function"
echo " "
echo "Pattern: n(arg1:Email Address || User Name)"
echo " "
else
ssh-keygen -t rsa -b 4096 -C "#$1"
echo "Setting up SSH Key for: $1"
fi
}
function new() {
if [[ (-z ${2+x}) || (-z ${1+x}) ]]; then
echo " "
echo "**Error**"
echo "Improper use of the 'new' function"
echo " "
echo "Pattern: n(arg1:String, arg2:String)"
echo " "
else
if [[ ($1 == "-d") || ($1 == "-D") ]]; then
mkdir $2
echo "New folder created: $2"
echo ""
echo ""
elif [[ ($1 == "-f") || ($1 == "-F") ]]; then
touch $2
echo "New file created: $2"
echo ""
echo ""
fi
fi
# [[ $1 == "-d" ]] && echo "Folder" || [[ $1 == "-f" ]] && echo "File" || echo "Unknown Type Parameter"
}
function fallDIR() {
if [[ (-z ${1+x}) ]]; then
echo " "
echo "**Error**"
echo "need to pass a folder name in double quotes! (just the folder's name!)"
echo "example: fn ''folder_name'' "
echo " "
else
find . -type d -path '*/$1/*' -prune -print
fi
# [[ $1 == "-d" ]] && echo "Folder" || [[ $1 == "-f" ]] && echo "File" || echo "Unknown Type Parameter"
}
# alias composer="php composer.phar"
# for key in ${!arr_text_colors[@]}; do
# echo ${key} ${arr_text_colors[${key}]}
# done
# for key in ${!arr_text_colors[@]}; do
# echo ${key}
# done