From 90bd397922e7240c41377e7404f79f190bfbc9d8 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 4 Apr 2019 12:28:31 -0400 Subject: [PATCH] various bug fixes --- .bashrc | 4 +++- .profile | 5 +++++ brc | 24 ++++-------------------- btrbk-run | 6 +++++- check-subvol-stale | 2 +- distro-begin | 18 ++++++------------ distro-end | 18 +++++++----------- install-my-scripts | 2 +- mount-latest-subvol | 5 ++++- subdir_files/.gnupg/gpg.conf | 7 ++++--- 10 files changed, 40 insertions(+), 51 deletions(-) mode change 100755 => 100644 btrbk-run diff --git a/.bashrc b/.bashrc index d0c4b02..097dd98 100644 --- a/.bashrc +++ b/.bashrc @@ -51,7 +51,7 @@ if [[ $SSH_CONNECTION ]] \ && [[ ! $SSH_TTY ]] \ && [[ $- != *i* ]] \ && [[ ! $BASH_LOGIN_SHELL == true ]]; then - return + return 0 else if [[ -r /etc/profile ]]; then source /etc/profile @@ -62,3 +62,5 @@ else source $_x fi fi +# ensure no bad programs appending to this file will have an affect +return 0 diff --git a/.profile b/.profile index 6596cb5..96ca117 100644 --- a/.profile +++ b/.profile @@ -1,2 +1,7 @@ # see .bashrc_profile for commentary echo this is ~/.profile, either my .bashrc_profile is unavailable or this is posix mode or not bash + +# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. +export PATH="$PATH:$HOME/.rvm/bin" + +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* diff --git a/brc b/brc index 08f4e79..9851fe4 100644 --- a/brc +++ b/brc @@ -2205,27 +2205,7 @@ fi # eval "$(pyenv virtualenv-init -)" #fi -# id prefer to have system-wide, plus user ruby, due to bug in it -# https://github.com/rubygems/rubygems/pull/1002 -# further problems: installing multi-user ruby and user ruby, -# you dont get multi-user ruby when you sudo to root, unless its sudo -i. -# There a third hybrid form, which passenger error suggested I use, -# but it didnt actually work. - -# in cased I never need this -# rvm for non-interactive shell: modified from https://rvm.io/rvm/basics -#if [[ $(type -t rvm) == file && ! $(type -t ruby) ]]; then -# source $(rvm 1.9.3 do rvm env --path) -#fi - -# based on warning from rvmsudo -export rvmsudo_secure_path=1 -if [[ -s "/usr/local/rvm/scripts/rvm" ]]; then - source "/usr/local/rvm/scripts/rvm" -elif [[ -s $HOME/.rvm/scripts/rvm ]]; then - source $HOME/.rvm/scripts/rvm -fi export GOPATH=$HOME/go path_add $GOPATH/bin @@ -2234,6 +2214,10 @@ export ARDUINO_PATH=/a/opt/Arduino/build/linux/work path_add --end ~/.npm-global +# taken from default changes to bashrc and bash_profile +path_add --end $HOME/.rvm/bin +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* + export BASEFILE_DIR=/a/bin/fai-basefiles # didnt get drush working, if I did, this seems like the diff --git a/btrbk-run b/btrbk-run old mode 100755 new mode 100644 index 6024229..b753b5d --- a/btrbk-run +++ b/btrbk-run @@ -24,7 +24,11 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat <<'EOF' btrbk-run [OPTIONS] -usually -t TARGET_HOST +usually -t TARGET_HOST or -s SOURCE_HOST + +Note, at source location, intentionally not executable, run and read +install-my-scripts. + EOF echo "top of script file:" sed -n '1,/^[# ]*end command line/{p;b};q' "$0" diff --git a/check-subvol-stale b/check-subvol-stale index 9959421..6a63124 100644 --- a/check-subvol-stale +++ b/check-subvol-stale @@ -25,7 +25,7 @@ usage() { cat < >(sudo tee -a /var/log/distro-begin) @@ -77,7 +70,7 @@ source $script_dir/pkgs set +x source /a/bin/distro-functions/src/identify-distros $interactive || set -x -for f in iank-dev htpc kd x2 frodo tp li lj demohost kw fz; do +for f in iank-dev htpc kd x2 x3 frodo tp li lj demohost kw fz; do eval "$f() { [[ $HOSTNAME == $f ]]; }" done has_p() { ! linode; } # when tp is tracis, then not tp either @@ -207,10 +200,10 @@ conflink ###### bash environment setup set +x -errallow +err-allow source /etc/profile.d/environment.sh source ~/.bashrc -$interactive || errcatch +err-catch $interactive || set -x @@ -319,6 +312,7 @@ if has_p; then fi s lnf /q/root/.editor-backups /q/root/.undo-tree-history \ /a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root +pi rsync # needed for rootsshsync rootsshsync s lnf /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root if has_p; then @@ -566,7 +560,7 @@ if has_x; then fi ##### install laptop hardware packages -if tp || x2; then +if tp || x2 || x3; then case $distro in debian) pi task-laptop diff --git a/distro-end b/distro-end index 43ca158..d72adea 100755 --- a/distro-end +++ b/distro-end @@ -617,7 +617,7 @@ esac # s cp -r --parents /etc/openvpn/easy-rsa/keys /p/c/filesystem # s chown -R 1000:1000 /p/c/filesystem/etc/openvpn/easy-rsa/keys # # kw = kgpe work machine. -# for host in x2 kw; do +# for host in x2 x3 kw; do # vpn-mk-client-cert -b $host -n home b8.nz 1196 # dir=/p/c/machine_specific/$host/filesystem/etc/openvpn/client # mkdir -p $dir @@ -911,25 +911,21 @@ Pin-Priority: -100 Package: * Pin: release a=xenial-updates Pin-Priority: -100 + +Package: * +Pin: release a=xenial-security +Pin-Priority: -100 EOF s dd of=/etc/apt/sources.list.d/xenial.list 2>/dev/null <&2 + echo "$0: error: pids to kill includes our pid or a parent. ps output:" >&2 ps -f -p $p exit 1 fi diff --git a/subdir_files/.gnupg/gpg.conf b/subdir_files/.gnupg/gpg.conf index 9641d86..d5b5c41 100644 --- a/subdir_files/.gnupg/gpg.conf +++ b/subdir_files/.gnupg/gpg.conf @@ -34,11 +34,12 @@ default-key B125F60B7B287FF6A2B7DF8F170AF0E2954295DF # install -o iank -g iank -d -m700 /home/iank/gpg-agent-socket # because something keeps deleting that directory -# default keyserver +# default keyserver. i switch around randomly to find one that is up. # #keyserver hkp://pgp.mit.edu -# this one seems more reliable, but it's down now -keyserver hkp://pool.sks-keyservers.net +#keyserver hkp://pool.sks-keyservers.net +#keyserver hkp://keyserver.pgp.com +keyserver hkp://ipv4.pool.sks-keyservers.net # more secure, but had problems with my gpg version #keyserver hkps://hkps.pool.sks-keyservers.net -- 2.30.2