+# dogcam setup. not using atm
+# case $HOSTNAME in
+# lj|li)
+# /a/bin/webcam/install-server
+# ;;
+# kw)
+# /a/bin/webcam/install-client
+# ;;
+# esac
+
+
+## not actually using prometheus just yet
+# # office is not exposed to internet yet
+# if [[ $HOSTNAME != kw ]]; then
+# ## prometheus node exporter setup
+# web-conf -f 9100 -p 9101 apache2 $(hostname -f) <<'EOF'
+# #https://httpd.apache.org/docs/2.4/mod/mod_authn_core.html#authtype
+# # https://stackoverflow.com/questions/5011102/apache-reverse-proxy-with-basic-authentication
+# <Location />
+# AllowOverride None
+# AuthType basic
+# AuthName "Authentication Required"
+# # setup one time, with root:www-data, 640
+# AuthUserFile "/etc/prometheus-htpasswd"
+# Require valid-user
+# </Location>
+# EOF
+# fi
+
+
+######### begin flidas pinned packages ######
+case $(debian-codename) in
+ # needed for debootstrap scripts for fai since fai requires debian
+ flidas)
+ curl http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg | s apt-key add -
+ sd /etc/apt/preferences.d/flidas-xenial <<EOF
+Package: *
+Pin: release a=xenial
+Pin-Priority: -100
+
+Package: *
+Pin: release a=xenial-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=xenial-security
+Pin-Priority: -100
+
+Package: firefox
+Pin: release n=xenial
+Pin-Priority: 500
+EOF
+ sd /etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
+deb http://us.archive.ubuntu.com/ubuntu/ xenial main
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main
+EOF
+
+ if ! apt-key list | grep /C0B21F32 &>/dev/null; then
+ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
+ sd /etc/apt/preferences.d/flidas-bionic <<EOF
+Package: *
+Pin: release a=bionic
+Pin-Priority: -100
+
+Package: *
+Pin: release a=bionic-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=bionic-security
+Pin-Priority: -100
+EOF
+ fi
+
+ # better to run btrfs-progs which matches our kernel version
+ # (note, renamed from btrfs-tools)
+ sd /etc/apt/preferences.d/btrfs-progs <<EOF
+Package: btrfs-progs libzstd1
+Pin: release a=bionic
+Pin-Priority: 1005
+
+Package: btrfs-progs libzstd1
+Pin: release a=bionic-updates
+Pin-Priority: 1005
+
+Package: btrfs-progs libzstd1
+Pin: release a=bionic-security
+Pin-Priority: 1005
+EOF
+
+
+ t=$(mktemp)
+ cat >$t <<EOF
+deb http://us.archive.ubuntu.com/ubuntu/ bionic main
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main
+EOF
+ f=/etc/apt/sources.list.d/bionic.list
+ if ! diff -q $t $f; then
+ sudo cp $t $f
+ sudo chmod 644 $f
+ m p update
+ fi
+
+ # no special reason, but its better for btrfs-progs to
+ # be closer to our kernel version
+ pi btrfs-progs
+
+ if [[ ! -e /usr/share/debootstrap/scripts/xenial ]]; then
+ t=$(mktemp -d)
+ cd $t
+ m aptitude download debootstrap/xenial
+ m ex ./*
+ sudo cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
+ fi
+
+ sd /etc/apt/preferences.d/flidas-etiona <<EOF
+Package: *
+Pin: release a=etiona
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-updates
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-security
+Pin-Priority: -100
+
+Package: *
+Pin: release a=etiona-backports
+Pin-Priority: -100
+EOF
+
+ t=$(mktemp)
+ cat >$t <<EOF
+deb http://mirror.fsf.org/trisquel/ etiona main
+deb http://mirror.fsf.org/trisquel/ etiona-updates main
+deb http://archive.trisquel.info/trisquel/ etiona-security main
+deb http://mirror.fsf.org/trisquel/ etiona-backports main
+EOF
+ f=/etc/apt/sources.list.d/etiona.list
+ if ! diff -q $t $f; then
+ sudo cp $t $f
+ n s chmod 644 $f
+ m p update
+ fi
+
+ sd /etc/apt/preferences.d/debian-goodies <<EOF
+Package: debian-goodies
+Pin: release n=etiona
+Pin-Priority: 1005
+EOF
+
+
+ sd /etc/apt/preferences.d/flidas-buster <<EOF
+Package: *
+Pin: release n=buster
+Pin-Priority: -100
+
+Package: *
+Pin: release n=buster-updates
+Pin-Priority: -100
+EOF
+
+ # dont use buster because it causes dist-upgrade to think its downgrading
+ # packages while really just reinstalling the same version.
+ f=/etc/apt/apt.conf.d/01iank
+ sudo rm -fv $f
+ # # stupid buster uses some key algorithm not supported by flidas gpg that apt uses.
+ # sd /etc/apt/apt.conf.d/01iank <<'EOF'
+ # Acquire::AllowInsecureRepositories "true";
+ # EOF
+
+ f=/etc/apt/sources.list.d/buster.list
+ sudo rm -fv $f
+ # 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
+ # s cp $t $f
+ # s chmod 644 $f
+ # p update
+ # fi
+
+ # newer version needed for false positive in checkrestart.
+ # I did buster at first, but other problem above with having
+ # buster repos. not sure if the false positive exists in etiona.
+ pi debian-goodies
+
+ sd /etc/apt/preferences.d/shellcheck <<EOF
+Package: shellcheck
+Pin: release a=etiona
+Pin-Priority: 1005
+
+Package: shellcheck
+Pin: release a=etiona-updates
+Pin-Priority: 1005
+
+Package: shellcheck
+Pin: release a=etiona-security
+Pin-Priority: 1005
+EOF
+
+ sd /etc/apt/preferences.d/bash <<EOF
+Package: bash
+Pin: release a=etiona
+Pin-Priority: 1005
+
+Package: bash
+Pin: release a=etiona-updates
+Pin-Priority: 1005
+
+Package: bash
+Pin: release a=etiona-security
+Pin-Priority: 1005
+EOF
+
+
+ ;;&
+ etiona)
+ sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
+Package: *
+Pin: release n=bionic
+Pin-Priority: -100
+
+Package: firefox gnome-screenshot gnome-icon-theme libnautilus-extension1a gnome-settings-daemon nautilus yelp gnome-settings-daemon-schemas nautilus-data ubuntu-wallpapers gnome-control-center gnome-control-center-data gnome-control-center-faces libsnapd-glib1 ubuntu-wallpapers-bionic gir1.2-snapd-1 ubuntu-drivers-common ubuntu-docs libyelp0
+Pin: release n=bionic
+Pin-Priority: 500
+EOF
+ ;;&
+ *)
+ if isdeb; then
+ pi debian-goodies shellcheck
+ fi