-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
116 lines (92 loc) · 3.09 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
#trap ". ~/.bashrc" USR1
# Try to disable flow control
# (-t FD => if file descriptor is open and refers to a terminal)
[ -t 0 ] && stty -ixon -ixoff
export GOPATH=$HOME/go
export XDG_CONFIG_HOME=$HOME/.config
export PATH=$HOME/special_paths:/bin:/usr/local/bin:/sbin:/usr/bin:/usr/games:$HOME/.local/bin:/usr/local/go/bin:$GOPATH/bin/:/home/runner/bin
export HISTFILESIZE=10000
export HISTSIZE=10000
export LUA_PATH="./?.lua;./lua/?.lua;;"
export PYTHONSTARTUP=$HOME/.pythonrc
export PYTHONDONTWRITEBYTECODE=1
export TERM=xterm-256color
alias freecell='sol -v freecell'
alias apacherestart='sudo /etc/init.d/apache2 restart'
alias fixType="$HOME/Desktop/test.sh; xmodmap -e \"keycode 108 = Alt_R\"; xmodmap $HOME/modmap/modmap"
alias ls="ls --color"
alias less="less -R"
alias tree="tree -C"
alias vim='vim -w $HOME/.vimlog "$@"'
alias ccat='pygmentize -g'
alias aoeu="setxkbmap us"
alias asdf="setxkbmap dvorak"
function mkcd() {
mkdir -p "$@"
cd "$@"
}
if [[ "$-" == *i* ]]; then # interactive
bind C-p:history-search-backward
bind C-n:history-search-forward
fi
# git stuff
alias br="git branch"
alias ch="git checkout"
alias co="git commit -v -a"
alias ca="git commit -v -a --amend"
alias st="git status"
alias log="git log"
alias gitdiffmeld="git difftool -y -t meld"
function send_key_and_login() {
# usage: send_key_and_login service@sms-glados-1
ssh-copy-id -i $HOME/.ssh/id_rsa.pub "$@"
ssh "$@"
}
function prompt1() {
local black="\[\e[30m\]"
local red="\[\e[31m\]"
local green="\[\e[32m\]"
local yellow="\[\e[33m\]"
local blue="\[\e[34m\]"
local purple="\[\e[35m\]"
local cyan="\[\e[36m\]"
local white="\[\e[37m\]"
[ -r $HOME/.git-completion.bash ] && . $HOME/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=0
PS1="$cyan\$(__git_ps1) $red\$(date +%H:%M) $purple\u$white@$green\h$white:$yellow\w$white\$ "
}
prompt1
function prompt_reversed() {
local black="\[\e[30m\]"
local red="\[\e[31m\]"
local green="\[\e[32m\]"
local yellow="\[\e[33m\]"
local blue="\[\e[34m\]"
local purple="\[\e[35m\]"
local cyan="\[\e[36m\]"
local white="\[\e[37m\]"
[ -r $HOME/.git-completion.bash ] && . $HOME/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=0
PS1="$black\$(__git_ps1) \$(date +%H:%M) \u@\h:\w\$ "
}
function fuck() {
if killall -9 "$2"; then
echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo
fi
}
function battery_life() {
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage
}
function top_disk_users() {
local cmd="du -hs $1/* 2> /dev/null | sort -hr | head -n 10"
echo "Running: $cmd"
eval $cmd
}
# (-e = if file exists, -r = -e && is readable)
[ -r /etc/bash_completion ] && . /etc/bash_completion
[ -r $HOME/.bashrc.local ] && . $HOME/.bashrc.local
# virtualenv / virtualenvwrapper
export WORKON_HOME=$HOME/virtual_envs
[ -r /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh
PERL_MB_OPT="--install_base \"/$HOME/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/$HOME/perl5"; export PERL_MM_OPT;