X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=5ecfd817aa6d0a8072562a5e4b31f191d26a8e57;hb=f9ccde727d3471c99b909a528aa7168281368084;hp=e03b0b5dc2afbf86be8a89183197c701d33a6aeb;hpb=d1e0ce0c6a704ef4158c94a623fa631869dc43ef;p=distro-setup diff --git a/brc b/brc index e03b0b5..5ecfd81 100644 --- a/brc +++ b/brc @@ -188,8 +188,9 @@ if [[ $SOE ]]; then fi path_add /a/exe -# end just because it seems safer -path_add --end node_modules/.bin +# add this with absolute paths as needed for better security +#path_add --end /path/to/node_modules/.bin + # pip3 --user things go here: path_add --end ~/.local/bin path_add --ifexists --end /a/work/libremanage @@ -328,6 +329,23 @@ anki() { fi } +ap() { + # pushd in case current directory has an ansible.cfg file + pushd /a/xans >/dev/null + ansible-playbook -v -l ${1:- $(hostname -f)} site.yml + popd >/dev/null +} +aw() { + pushd /a/work/ansible-configs >/dev/null + time ansible-playbook -v -i inventory adhoc.yml "$@" + popd >/dev/null +} +ad() { + pushd /a/bin/distro-setup/a >/dev/null + ansible-playbook site.yml + popd >/dev/null +} + astudio() { # googling android emulator libGL error: failed to load driver: r600 # lead to http://stackoverflow.com/a/36625175/14456 @@ -365,12 +383,21 @@ bigclock() { } bpull() { + [[ $1 ]] || return 1 + c / + # run latest + install-my-scripts + switch-mail-host $1 $HOSTNAME +} +bpush() { + [[ $1 ]] || return 1 c / # run latest install-my-scripts - switch-mail-host $1 $HOSTNAMEs + switch-mail-host $HOSTNAME $1 } + btc() { local f=/etc/bitcoin/bitcoin.conf # importprivkey will timeout if using the default of 15 mins. @@ -935,7 +962,11 @@ gpg() { } gse() { - git send-email --notes '--envelope-sender=' \ + local email=ian@iankelling.org + if readlink ~/.mu | grep fsf &>/dev/null; then + email=iank@fsf.org + fi + git send-email --notes "--envelope-sender=<$email>" \ --suppress-cc=self "$@" } @@ -1275,6 +1306,21 @@ pfind() { #find *$1* in $PATH find "${pathArray[@]}" -iname "*$1*" } +pkx() { # package extract + c `mktemp -d` + pkg=$1 + cached=$(ls -t /var/cache/apt/archives/$1* | tail -n1) + if [[ $cached ]]; then + cp $cached . + else + aptitude download $pkg + fi + f=(*) + dtrx -m $f + dtrx -fr $f + rm -f $f +} + pk1() { local pid pid=($(pgrep -f "$*")) @@ -2124,6 +2170,9 @@ if [[ $- == *i* ]]; then if [[ -e /nocow/btrfs-stale ]] && ((`command ls -AUq /nocow/btrfs-stale|wc -l`)); then ps_char="! $ps_char" fi + if [[ ! $SSH_CLIENT && $MAIL_HOST != $HOSTNAME ]]; then + ps_char="@ $ps_char" + fi PS1="${PS1%"${PS1#*[wW]}"} \[$ps_color\]$ps_char\[$(get_term_color nocolor)\] " # emacs completion doesnt like the git prompt atm, so disabling it. #PS1="${PS1%"${PS1#*[wW]}"}$(__git_ps1 ' (%s)') \[$ps_color\]$ps_char\[$(get_term_color nocolor)\] "