bind '"\C-i": self-insert'
else
+ if [[ $KONSOLE_PROFILE_NAME ]]; then
+ TERM=xterm-256color
+ fi
+
# todo: not sure this works in sakura
#stty werase undef
#bind "\C-w": kill-region
# sakura == xterm-256color
# konsole == xterm
- if [[ $TERM == "xterm" ]]; then
+ if [[ $TERM == xterm* ]]; then
# control + arrow keys. for other terminals, see http://unix.stackexchange.com/questions/10806/how-to-change-previous-next-word-shortcut-in-bash
bind '"\e[1;5C": shell-forward-word' 2>/dev/null
bind '"\e[1;5D": shell-backward-word' 2>/dev/null
C_DEFAULT_DIR=/a
# i for insensitive. the rest from
-# https://superuser.com/questions/366930/how-do-i-get-the-git-pager-to-clean-up-screen-output-after-exit
-# and reading the man
+# X means dont remove the current screenworth of output upon exit
+# R means to show colors n things
export LESS=RXi
export SYSTEMD_LESS=$LESS
for x in /a/bin/bash_unpublished/source-!(.#*); do source $x; done
source $(dirname $(readlink -f $BASH_SOURCE))/path_add-function
source /a/bin/log-quiet/logq-function
-if [[ -e /a/bin/errhandle/err ]]; then
- source /a/bin/errhandle/err
- err-allow
-fi
-# if someone exported $SOE (stop on error), catch errors
+# if someone exported $SOE (stop on error), catch errors.
+#
+# Note, on debian this results in the following warning when in ssh,
+# hich I haven't figured out how to fix. It doesn't happen if we source
+# after the shell has started
+#
+# bash: /usr/share/bashdb/bashdb-main.inc: No such file or directory
+# bash: warning: cannot start debugger; debugging mode disabled
if [[ $SOE ]]; then
- err-catch
+ if [[ -e /a/bin/errhandle/err ]]; then
+ source /a/bin/errhandle/err
+ fi
fi
path_add /a/exe
path_add --end ~/.local/bin
path_add --ifexists --end /a/work/libremanage
path_add --ifexists --end /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools
-path_add --ifexists --end /a/opt/scancode-toolkit-2.9.2
+path_add --ifexists --end /a/opt/scancode-toolkit-3.0.2
export WCDHOME=/a
# based on readme.debian. dunno if this will break on other distros.
_x=/usr/share/wcd/wcd-include.sh
}
faf() { # find all files
- find -L $1 -type f -not \( -name .svn -prune -o -name .git -prune \
+ find -L $1 -not \( -name .svn -prune -o -name .git -prune \
-o -name .hg -prune -o -name .editor-backups -prune \
- -o -name .undo-tree-history -prune \) 2>/dev/null
+ -o -name .undo-tree-history -prune \) -type f 2>/dev/null
}
# one that comes with distros is too old for newer devices
}
-if [[ $OS == Windows_NT ]]; then
- # cygstart wrapper
- cs() {
- cygstart "$@" &
- }
- xp() {
- explorer.exe .
- }
- # launch
- o() {
- local x=(*$1*)
- (( ${#x[#]} > 1 )) && { echo "warning ${#x[#]} matches found"; sleep 1; }
- cygstart *$1* &
- }
-else
o() {
if type gvfs-open &> /dev/null ; then
gvfs-open "$@"
fi
# another alternative is run-mailcap
}
-fi
ipdrop() {
s iptables -A INPUT -s $1 -j DROP
ser stop dnsmasq
s resolvconf -d NetworkManager
ser start dnsmasq
+ s ifup br0
}
startnm() {
+ s ifdown br0
ser start NetworkManager
s nmtui-connect
}
+rebr() {
+ s ifdown br0
+ s ifup br0
+}
setini() { # set a value in a .ini style file
key="$1" value="$2" section="$3" file="$4"
wtr() { curl wttr.in/boston; }
-xl() {
- if pgrep gnome-screensav &>/dev/null; then
- # this command actually starts gnome-screensaver if it isn\'t running.
- # lololol, what crap
- gnome-screensaver-command --exit &>/dev/null
- fi
- mate-screensaver-command --exit &>/dev/null
- if ! pidof xscreensaver; then
- pushd /
- xscreensaver &
- popd
- # 1 was not long enough
- sleep 3
- fi
- xscreensaver-command -activate
-}
-
xevkb() { xev -event keyboard; }
# * misc stuff
# commented until i want to use it because it
# noticably slows bash startup
#
-#if [[ $EUID != 0 && -e ~/.pyenv/bin ]]; then
-# export PATH="~/.pyenv/bin:$PATH"
-# eval "$(pyenv init -)"
-# eval "$(pyenv virtualenv-init -)"
-#fi
+mypyenvinit () {
+ if [[ $EUID == 0 || ! -e ~/.pyenv/bin ]]; then
+ echo "error: dont be root. make sure pyenv is installed"
+ return 1
+ fi
+ export PATH="~/.pyenv/bin:$PATH"
+ eval "$(pyenv init -)"
+ eval "$(pyenv virtualenv-init -)"
+}
export GOPATH=$HOME/go