set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
-# need root for rsync pull of file ownership/perms
+# need root for rsync pull of file ownership/perms
[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
host=bk.b8.nz
ncbase=${ncdir##*/}
mkdir -p /p/bkbackup/$ncbase
ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on
- rsync -rai --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
+ rsync -ra --exclude=testignore --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --off
if (( $ret )); then
echo "$0: error: failed rsync $ncdir"
ret=1
fi
done
- rsync -rai --delete root@$host:/m /p/bkbackup
+ rsync -ra --delete root@$host:/m /p/bkbackup
fi
exit $ret
# rync here uses checksum instead of time so we dont mess with
# unison relying on time as much. g is for group, same reason
# to keep up with unison.
- sudo rsync -rlpchviog --relative "${opts[@]}" "$path" "root@$host:/";
+ m s rsync -rlpchviog --relative "${opts[@]}" "$path" "root@$host:/";
}
ccomp rsync rsd rsa rst rsu
fi
done
-if $amy; then
- # to manually backup amy,
- # bbk -e -s amy -m root_ubuntubionic
- cat >>/etc/btrbk.conf <<'EOF'
-volume ssh://amy/mnt/root
-subvolume root_ubuntubionic
-target send-receive /mnt/root/btrbk
-EOF
-fi
+# if $amy; then
+# # to manually backup amy,
+# # bbk -e -s amy -m root_ubuntubionic
+# cat >>/etc/btrbk.conf <<'EOF'
+# volume ssh://amy/mnt/root
+# subvolume root_ubuntubionic
+# target send-receive /mnt/root/btrbk
+# EOF
+# fi
# todo: umount first to ensure we don't have any errors
# todo: do some kill fuser stuff to make umount more reliable
d dev=$dev
subvol_dir=$(sed -rn "s,^\s*[^#]\S*\s+$d\s.*\bsubvol=([a-zA-A/]+).*,\1,p" /etc/fstab /etc/mtab|head -n1)
+ if [[ ! $subvol_dir ]]; then
+ continue
+ fi
d subvol_dir=$subvol_dir
# note, we need $dev because $d might not be mounted, and we do this loop
# because the device in fstab for the rootfs can be different.
sudo sed -ri "/^127\./n;/[[:space:]]$HOSTNAME\$/d" /etc/hosts
fi
+# firefox exists but is 2 versions outdated
+if isdeb && [[ $(debian-codename) == nabia ]]; then
+ sudo dd of=/etc/apt/preferences.d/nabia-focal-missing <<'EOF'
+Explanation: libkf5* are for konsole libilmbase* are needed for emacs
+Package: libkf5solid5 libkf5solid5-data libilmbase-dev libilmbase24 ansible unrar-free genisoimage pidgin pidgin-* libpurple0 linux-doc p7zip genisoimage mumble hplip cups-filters libcupsfilters1 libfontembed1 cups-filters-core-drivers tor lightdm mate-desktop-environment mate-desktop-environment-* mate-menus mate-panel mate-panel-* mate-session-manager libmate-* libgoa-* ubuntu-mate-default-settings mate-control-center mate-control-center-common gir1.2-matemenu-* lightdm-gtk-greeter liblightdm-gobject-* firefox
+Pin: release n=focal,o=Ubuntu
+Pin-Priority: 500
+EOF
+fi
+
#### setup firefox backport
## ian: disabled. backports are not being published atm due to rust packaging issue
EOF
+ ;;&
+ nabia|etiona)
+ # for ziva
+ #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
+ f=/etc/apt/sources.list.d/buster.list
+ t=$(mktemp)
+ cat >$t <<EOF
+deb http://http.us.debian.org/debian buster main
+deb-src http://http.us.debian.org/debian buster main
+
+deb http://security.debian.org/ buster/updates main
+deb-src http://security.debian.org/ buster/updates main
+
+deb http://http.us.debian.org/debian buster-updates main
+deb-src http://http.us.debian.org/debian buster-updates main
+EOF
+ if ! diff -q $t $f; then
+ curl -s https://ftp-master.debian.org/keys/archive-key-10-security.asc | sudo apt-key add -
+ curl -s https://ftp-master.debian.org/keys/archive-key-10.asc | sudo apt-key add -
+ s cp $t $f
+ s chmod 644 $f
+ p update
+ fi
+ if [[ ! -e /usr/share/debootstrap/scripts/buster ]]; then
+ t=$(mktemp -d)
+ cd $t
+ m aptitude download debootstrap/buster
+ m ex ./*
+ sudo cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
+ fi
+
;;&
etiona)
sd /etc/apt/preferences.d/focal <<'EOF'
p update
fi
- # for ziva
- #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
- f=/etc/apt/sources.list.d/buster.list
- t=$(mktemp)
- cat >$t <<EOF
-deb http://http.us.debian.org/debian buster main
-deb-src http://http.us.debian.org/debian buster main
-
-deb http://security.debian.org/ buster/updates main
-deb-src http://security.debian.org/ buster/updates main
-
-deb http://http.us.debian.org/debian buster-updates main
-deb-src http://http.us.debian.org/debian buster-updates main
-EOF
- if ! diff -q $t $f; then
- curl -s https://ftp-master.debian.org/keys/archive-key-10-security.asc | sudo apt-key add -
- curl -s https://ftp-master.debian.org/keys/archive-key-10.asc | sudo apt-key add -
- s cp $t $f
- s chmod 644 $f
- p update
- fi
- if [[ ! -e /usr/share/debootstrap/scripts/buster ]]; then
- t=$(mktemp -d)
- cd $t
- m aptitude download debootstrap/buster
- m ex ./*
- sudo cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
- fi
-
# duplicated in fai. Pin for bionic + ubuntu so that ppas dont get
# matched.
sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
pi lightdm-gtk-greeter
# ok, this is really weird
# normally this file has
- cat >/etc/X11/Xsession.d/99x11-common_start <<'EOF'
+ sd /etc/X11/Xsession.d/99x11-common_start <<'EOF'
# this is very odd.
# this file normally just has: exec $STARTUP
# but then ~/.xsession-errors
case $HOSTNAME in
- kd|rp)
+ kd)
sgo transmission-daemon-nn
;;
esac
SHELL=/bin/bash
PATH=/usr/bin:/bin:/usr/local/bin:/a/exe
+MAILTO=root
*/10 * * * * iank rootsshsync |& log-once -15 rootsshsync
# this goes into bash prompt, does in cron for more efficient shell
* * * * * iank system-status |& log-once system-status
--- /dev/null
+#!/bin/bash
+
+# https://stackoverflow.com/a/2108540
+tmp=:$PATH:
+del=/usr/local/bin
+tmp=${tmp//:$del:/:}
+tmp=${tmp%:}
+tmp=${tmp#:}
+PATH=$tmp
+
+rm -f {/p/c/firefox-main-profile,/p/c/firefox-main-profile,/p/c/firefox-vpn2-profile,/mnt/z/firefox-vpn-profile}/compatibility.ini
+
+if type -P abrowser &>/dev/null; then
+ abrowser "$@"
+else
+ firefox "$@"
+fi
--- /dev/null
+abrowser
\ No newline at end of file
set $mod Mod4
bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
bindsym $mod+6 exec "/a/bin/redshift.sh"
# bindsym $mod+equal exec "t s w; t in"
grep -vxF "Found a valid Btrfs stream header, version 1" | \
grep -cv "^[^;]*;snapshot: ") ||:
if [[ $lines == 0 ]]; then
- # the snapshot diff is broken, it deleted a snapshot that was different.
- # I need some examples to test on.
- # also, why are we ignoring the error code in the snapshot diff,
- # seems like we shouldnt do that
+ # rotate in case we find a bug, weve got 2 old ones
+ tmpleaf=($vol.tmpleaf2.*)
+ if (( ${#tmpleaf[@]} )); then
+ x btrfs sub del ${tmpleaf[@]}
+ fi
+ tmpleaf=($vol.tmpleaf1.*)
+ if (( ${#tmpleaf[@]} )); then
+ x mv ${tmpleaf[0]} $vol.tmpleaf2.${tmpleaf[0]#$vol.tmpleaf1.}
+ fi
echo suspected identical: $bsub $leaf
- #x btrfs sub del $leaf
+ x mv $leaf $vol.tmpleaf1.${leaf#$vol.leaf.}
fi
fi
fi
# the order gets screwed up or something.
for leaf in ${leaf_vols[@]}; do
leaf_time=$(date -d ${leaf#$vol.leaf.} +%s)
- if (( leaf_limit_time > leaf_time || ( leaf_new_limit_time > leaf_time && count > 100 ) )); then
+ if (( leaf_limit_time > leaf_time || ( leaf_new_limit_time > leaf_time && count > 15 ) )); then
x btrfs sub del $leaf
fi
count=$((count-1))
# gnat-5 doesnt exist in nabia, might not even be needed for coreboot anymore so removed it
# python3-dnspython is needed by some ansible module
+# python3-autopep8 is nice, etiona only has python2 version, not bothering
+# to setup a conditional or pin to nabia.
p3=(
pixz
pry
pv
- python3-autopep8
python3-doc
qemu-user-static
qrencode
set $mod Mod4
bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
bindsym $mod+6 exec "/a/bin/redshift.sh"
# bindsym $mod+equal exec "t s w; t in"
set $mod Mod4
bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
bindsym $mod+6 exec "/a/bin/redshift.sh"
# bindsym $mod+equal exec "t s w; t in"
<!DOCTYPE kpartgui>
-<kpartgui version="24" name="session">
+<kpartgui version="27" name="session">
<MenuBar>
<Menu name="file">
<Action group="session-operations" name="file_save_as"/>
<Action group="session-view-operations" name="monitor-silence"/>
<Action group="session-view-operations" name="monitor-activity"/>
<Separator group="session-view-operations"/>
+ <Action group="session-view-operations" name="view-readonly"/>
+ <Separator group="session-view-operations"/>
<Action group="session-view-operations" name="enlarge-font"/>
+ <Action group="session-view-operations" name="reset-font-size"/>
<Action group="session-view-operations" name="shrink-font"/>
<Action group="session-view-operations" name="set-encoding"/>
<Separator group="session-view-operations"/>
<Action name="clear-history"/>
<Action name="adjust-history"/>
<Separator/>
+ <Action name="view-readonly"/>
<Action name="switch-profile"/>
<Action name="edit-current-profile"/>
- <Separator/>
- <Action name="close-session"/>
</Menu>
- <ActionProperties scheme="Default">
- <Action shortcut="Ctrl+@" name="open-browser"/>
+ <ActionProperties>
<Action shortcut="Ctrl+Shift+R" name="edit_find_next"/>
<Action shortcut="Ctrl+Shift+E" name="edit_find_prev"/>
<Action shortcut="Ctrl++; " name="enlarge-font"/>
+ <Action shortcut="Ctrl+@" name="open-browser"/>
<Action shortcut="" name="rename-session"/>
<Action shortcut="" name="zmodem-upload"/>
</ActionProperties>