From: Ian Kelling Date: Fri, 19 Feb 2021 10:15:56 +0000 (-0500) Subject: mostly nabia fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=59c90adcb32cbabe8d684dc50ea41358357c9575;p=distro-setup mostly nabia fixes --- diff --git a/bk-backup b/bk-backup index 67759fa..4050b5b 100755 --- a/bk-backup +++ b/bk-backup @@ -5,7 +5,7 @@ shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4 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 @@ -39,13 +39,13 @@ if [[ $HOSTNAME == $MAIL_HOST ]]; then 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 diff --git a/brc b/brc index 92bb543..685d6f2 100644 --- a/brc +++ b/brc @@ -1138,7 +1138,7 @@ rsu() { # [OPTS] HOST PATH # 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 diff --git a/btrbk-run b/btrbk-run index 2b21e82..d6de66a 100644 --- a/btrbk-run +++ b/btrbk-run @@ -426,15 +426,15 @@ EOF 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 diff --git a/check-subvol-stale b/check-subvol-stale index 8453026..7758df7 100644 --- a/check-subvol-stale +++ b/check-subvol-stale @@ -85,6 +85,9 @@ for d; do 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. diff --git a/distro-begin b/distro-begin index 144d8a5..30ecb9b 100755 --- a/distro-begin +++ b/distro-begin @@ -345,6 +345,16 @@ if bitfolk; then 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 diff --git a/distro-end b/distro-end index 9d207e3..3c37330 100755 --- a/distro-end +++ b/distro-end @@ -326,6 +326,37 @@ Pin-Priority: 1005 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 <$t </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 @@ -1306,7 +1308,7 @@ EOF case $HOSTNAME in - kd|rp) + kd) sgo transmission-daemon-nn ;; esac diff --git a/filesystem/etc/cron.d/ian b/filesystem/etc/cron.d/ian index 3e18e33..7df6705 100644 --- a/filesystem/etc/cron.d/ian +++ b/filesystem/etc/cron.d/ian @@ -1,5 +1,6 @@ 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 diff --git a/filesystem/usr/local/bin/abrowser b/filesystem/usr/local/bin/abrowser new file mode 100755 index 0000000..520380a --- /dev/null +++ b/filesystem/usr/local/bin/abrowser @@ -0,0 +1,17 @@ +#!/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 diff --git a/filesystem/usr/local/bin/firefox b/filesystem/usr/local/bin/firefox new file mode 120000 index 0000000..3a5d9d4 --- /dev/null +++ b/filesystem/usr/local/bin/firefox @@ -0,0 +1 @@ +abrowser \ No newline at end of file diff --git a/i3-sway/common.conf b/i3-sway/common.conf index f263a3b..48346c7 100644 --- a/i3-sway/common.conf +++ b/i3-sway/common.conf @@ -7,8 +7,8 @@ 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" diff --git a/mount-latest-subvol b/mount-latest-subvol index 64e22f1..7764b75 100644 --- a/mount-latest-subvol +++ b/mount-latest-subvol @@ -321,12 +321,17 @@ for vol in q a o i; do 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 @@ -342,7 +347,7 @@ for vol in q a o i; do # 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)) diff --git a/pkgs b/pkgs index 094d7b2..e059147 100644 --- a/pkgs +++ b/pkgs @@ -46,6 +46,8 @@ p2=( # 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=( @@ -172,7 +174,6 @@ p3=( pixz pry pv - python3-autopep8 python3-doc qemu-user-static qrencode diff --git a/subdir_files/.config/i3/config b/subdir_files/.config/i3/config index 9948f38..5b1faa5 100644 --- a/subdir_files/.config/i3/config +++ b/subdir_files/.config/i3/config @@ -7,8 +7,8 @@ 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" diff --git a/subdir_files/.config/sway/config b/subdir_files/.config/sway/config index bb9712e..4e3014e 100644 --- a/subdir_files/.config/sway/config +++ b/subdir_files/.config/sway/config @@ -7,8 +7,8 @@ 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" diff --git a/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc b/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc index 1a8d337..1d1449a 100644 --- a/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc +++ b/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc @@ -1,5 +1,5 @@ - + @@ -28,7 +28,10 @@ + + + @@ -50,16 +53,15 @@ + - - - - + +