-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc0
137 lines (107 loc) · 4.5 KB
/
.bashrc0
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
PS1='\[\033[1;31m\]\h@\W/\[\033[0m\] '
##### DEFAULTS #####
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
PROMPT_COLOR='35;1m'
export HISTCONTROL=ignoreboth
export EDITOR="vim"
export VISUAL="vim"
export LESS="-eirMX"
#shopt -s histappend
#shopt -s checkwinsize
# Make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# Set variable identifying the chroot you work in (used in the prompt below)
#if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
# debian_chroot=$(cat /etc/debian_chroot)
#fi
# Color prompt
force_color_prompt=yes
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
#export M2_HOME=~/tools/maven
export PATH=~/tools/bin:/home/amit/.local/bin:/usr/local/go/bin:~/tools/mongodb/bin:$M2_HOME/bin:$PATH
#export JAVA_OPTS='-Xmx5000M -Xms5000M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC'
export JAVA_HOME=/usr/lib/jvm/default-java
export GOROOT=/usr/local/go
export GOPATH=${HOME}/go
#$systemctl status firewalld.service
#$nmap -sT -O 192.168.1.18
set bind-tty-special-chars Off
if [ -t 1 ]
then
bind "set completion-ignore-case on"
bind '"\C-w": backward-kill-word'
bind '"\ep": history-search-backward'
bind '"\en": history-search-forward'
fi
export LC_ALL=C
alias ls='ls --color'
alias redis-cli='rlwrap -a -- redis-cli'
alias mongo-cli='rlwrap -a -- mongo'
#java -classpath "target/noty-1.0.0.jar:/home/akhanda/tools/vertx/mods/com.ahanda.techops~noty~1.0.0/lib/*:/home/akhanda/tools/vert.x-2.0.2-final/lib/*" $JAVA_OPTS com.ahanda.techops.noty.ds.EventCache2
#export NVM_DIR="/home/gamihan/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
ssh-agent -s | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
# echo "helllllo dear" | mailx -v -s "hello amit" -S smtp-use-starttls -S smtp="smtp.gmail.com" -S smtp-auth=login -S smtp-auth-user="[email protected]" -S smtp-auth-password="81@mit06" -S from="[email protected](amit)" [email protected]
#/usr/bin/ffmpeg -i PB045265.AVI -c:v libx264 -crf 20 -pix_fmt yuv420p -x264-params keyint=240:min-keyint=20 -preset:v slow -profile:v baseline -level 3.0 -c:a aac -b:a 160k -vbr 4 -strict -2 PB045265.AVI.mp4
export PYTHONSTARTUP=~/.startup.py
#rsync -rvlc -e 'ssh -p 2222' ./ 192.168.1.3:SDCard/Music/
#rsync --partial --progress --rsh=ssh -avz ~/Videos/Passengers\ \(2016\)\ 720p\ Web-DL\ x264\ \[Dual-Audio\]\[Hindi\ \(Cam\)\ -\ English\]\ ESubs\ -\ Downloadhub/ [email protected]:~
# replace {} with input ... xargs -I{} sudo mv \{\} literature/
# raspberry pi
# sudo rpi-update 81355451bcd9a214fdf221ca322b6ca681d8da55
# google drive: grive -s Jarvis
# batch auto enhance gimp
# gimp -ifd -b '(batch-auto-levels "*.png")' -b '(gimp-quit 0)'
# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
# raspberry pi : connmanctl> config ethernet_b827eb7ee48a_cable --ipv4 manual 169.254.126.244 255.255.0.0 169.254.126.1
#sudo mount -t davfs http://akpi.local/media /media/akpi
log_bash_persistent_history()
{
[[
$(history 1) =~ ^\ *[0-9]+\ +([^\ ]+\ [^\ ]+)\ +(.*)$
]]
local date_part="${BASH_REMATCH[1]}"
local command_part="${BASH_REMATCH[2]}"
if [ "$command_part" != "$PERSISTENT_HISTORY_LAST" ]
then
echo $date_part "$command_part" >> ~/.persistent_history
export PERSISTENT_HISTORY_LAST="$command_part"
fi
}
# Stuff to do on PROMPT_COMMAND
run_on_prompt_command()
{
log_bash_persistent_history
}
PROMPT_COMMAND="run_on_prompt_command"
# ldapsearch -x -h 10.10.20.14 -D "gemsol\\am.handa" -W -b "cn=gemini,dc=gemsol,dc=in" -s sub "(cn=*)" cn mail sn
export GRADLE_HOME=/home/amit/tools/gradle
source /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
source ~/.kubectlAliases
for i in $(cut -f2 -d ' ' ~/.kubectlAliases | cut -f1 -d '='); do complete -F _complete_alias $i; done
source <(kops completion bash)