-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
223 lines (184 loc) · 5.44 KB
/
.bashrc
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#!/usr/bin/env bash
# Path to the bash it configuration
# Lock and Load a custom theme file
# location /.bash_it/themes/
export BASH_IT_THEME='sexy'
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
#export HOSTALIASES=/etc/host.aliases
# (Advanced): Change this to the name of your remote repo if you
# cloned bash-it with a remote other than origin such as .
# export BASH_IT_REMOTE='bash-it'
export BASH_IT="/home/$(whoami)/.bash_it"
export EDITOR="vim"
# Your place for hosting Git repos. I use this for private repos.
#export GIT_HOSTING='[email protected]'
# Don't check mail when opening terminal.
unset MAILCHECK
# Change this to your console based IRC client of choice.
export IRC_CLIENT='irssi'
# Set this to the command you use for todo.txt-cli
#export TODO="t"
# Set this to false to turn off version control status checking within the prompt for all themes
export SCM_CHECK=true
webserver_simple() {
if [ ! -z $1 ];then
python3 -m http.server --bind 0.0.0.0 $1
else
python3 -m http.server --bind 0.0.0.0 8000
fi
}
show() {
if [[ -z $1 ]];then
echo "usage: $? file.jpg"
fi
descriptor=$(echo $1|awk '{print $2}' FS='.'|tr "[A-Z]" "[a-z]")
if [ -d $1 ];then
descriptor="folder"
fi
case $descriptor in
jpg|png|jpeg|gif|webp)
eog $1 > /dev/null 2>&1
;;
pdf)
evince $1 > /dev/null 2>&1
;;
folder)
xdg-open $1 > /dev/null 2>&1
;;
*)
echo ".$descriptor nicht gefunden"
;;
esac
}
alias show=show
# https://github.com/chubin/cheat.sh
cheat() {
curl "cheat.sh/$1/$2+$3+$4+$5+$6+$7+$8+$9"
}
alias cheat=cheat
# https://github.com/dutchcoders/transfer.sh/
transfer() {
curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | tee /dev/null;
echo -e "\n\n"
}
alias transfer=transfer
boilerplate() {
html() {
cat << 'EOF' > index.html
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>wow</title>
<meta name="description" content="awesome new site">
<meta name="Tino Schroeter" content="SitePoint">
<link rel="stylesheet" href="assets/css/styles.css?v=1.0">
</head>
<body>
<script src="assets/js/scripts.js"></script>
</body>
</html>
EOF
mkdir -p assets/css assets/js
touch assets/css/styles.css assets/js/scripts.js
}
p5() {
cat << 'EOF' > index.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>p5js</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.1/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script src="sketch.js"></script>
</body>
</html>
EOF
cat << 'EOF' > sketch.js
function preload() {
}
function setup() {
createCanvas(windowWidth, windowHeight);
//frameRate(30);
}
function draw() {
background(0);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
EOF
cat << 'EOF' > style.css
html, body {
margin: 0;
padding: 0;
overflow:hidden;
}
EOF
}
arduino() {
cat << 'EOF' > sketch.ino
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
EOF
}
case "$1" in
"html")
html
;;
"p5")
p5
;;
"arduino")
arduino
;;
*)
echo "$1 ? html / p5 / arduino"
;;
esac
}
alias boilerplate=boilerplate
# Set Xterm/screen/Tmux title with only a short hostname.
# Uncomment this (or set SHORT_HOSTNAME to something else),
# Will otherwise fall back on $HOSTNAME.
#export SHORT_HOSTNAME=$(hostname -s)
# Set Xterm/screen/Tmux title with only a short username.
# Uncomment this (or set SHORT_USER to something else),
# Will otherwise fall back on $USER.
#export SHORT_USER=${USER:0:8}
# Set Xterm/screen/Tmux title with shortened command and directory.
# Uncomment this to set.
#export SHORT_TERM_LINE=true
# Set vcprompt executable path for scm advance info in prompt (demula theme)
# https://github.com/djl/vcprompt
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
alias chefdir='cd ~/work/chef/'
alias workdir='cd ~/work/'
alias dnsdir='cd ~/work/dns/'
# (Advanced): Uncomment this to make Bash-it reload itself automatically
# after enabling or disabling aliases, plugins, and completions.
# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1
# auto competion
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
# Load Bash It
source "$BASH_IT"/bash_it.sh
export PATH=/bin/lscript:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
export PATH=$HOME/.local/bin:$HOME/go/bin:$PATH
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH