various improvements and fixes, some flidas related
[distro-setup] / distro-end
index 3b109c80d30d423bb2526b9fe1e081f560803bdc..ca71ad9c4aef7d60509420adc88cfe61d301a4a2 100755 (executable)
@@ -67,6 +67,8 @@ case $HOSTNAME in
         # mutagen for pithos
         # guvcview set webcam brightness to highest
         # pidgin-otr, i went into pidgin pluggin settings and generated a key for some accounts
+        # xawtv has webcam cli control. v4lctl bright 80%; v4lctl list
+        # guvcview also adjusts webcam
         simple_packages+=(
             apache2
             apache2-doc
@@ -83,6 +85,7 @@ case $HOSTNAME in
             cloc
             cpulimit
             cron
+            debootstrap
             debconf-doc
             dirmngr
             dnsutils
@@ -143,10 +146,10 @@ case $HOSTNAME in
             pry
             python-autopep8
             python3-doc
-            python3-mutagen
             qrencode
             reportbug
             $(aptitude show ruby | sed -rn 's/Depends: (.*)/\1/p')-doc
+            schroot
             sqlite3-doc
             squashfs-tools
             swh-plugins
@@ -157,6 +160,10 @@ case $HOSTNAME in
             vlc
             whois
             wondershaper
+            xawtv
+            xbacklight
+            xprintidle
+            xscreensaver
         )
         spa $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}')
         ;;
@@ -328,6 +335,16 @@ EOF
     # todo: other distros unknown
 esac
 
+# dogcam setup
+case $HOSTNAME in
+    lj|li)
+        /a/bin/webcam/install-server
+        ;;
+    kw)
+        /a/bin/webcam/install-client
+        ;;
+esac
+
 # website setup
 case $HOSTNAME in
     lj|li)
@@ -361,6 +378,19 @@ EOF
 ifconfig-push 10.8.0.4 255.255.255.0
 EOF
 
+        # it\'s strange. docker seems to make the default for forward
+        # be drop, but then I set it to accept and it\'s stuck that way,
+        # I dun know why. But, let\'s make sure we can forward anyways.
+        s DEBIAN_FRONTEND=noninteractive pi iptables-persistent
+        rm /etc/iptables/rules.v6
+        s tee /etc/iptables/rules.v4 <<'EOF'
+*filter
+-A FORWARD -i tun+ -o eth0 -j ACCEPT
+-A FORWARD -i eth0 -o tun+ -j ACCEPT
+COMMIT
+EOF
+
+
 
         sudo dd of=/etc/systemd/system/vpnmail.service <<EOF
 [Unit]
@@ -843,6 +873,7 @@ if [[ $HOSTNAME == frodo ]]; then
             ;;
     esac
     lnf -T /w/syncthing /home/iank/.config/syncthing
+    ser daemon-reload # syncthing likely not properly packaged
     sgo syncthing@iank # runs as iank
 
     # these things persist in ~/.config/syncthing, which I save in
@@ -900,7 +931,17 @@ case $distro in
 esac
 
 
-####### misc packages ###########
+####### begin misc packages ###########
+
+
+if [[ $HOSTNAME == kw ]]; then
+    cat <<'EOF'
+NOTE: after this finishes, i did
+s nmtui-connect
+# remove br from auto:
+s vim /etc/network/interfaces
+EOF
+fi
 
 # nagstamon setting which were set through the ui
 # in filters tab:
@@ -925,6 +966,54 @@ case $distro in
     # others unknown
 esac
 
+# /run and /dev/shm are listed as required for pulseaudio. All 4 in the group
+# listed in the default config as suggested.
+# /run/usr/1000 i noticed was missing for pulseaudio
+# /run/user/0 just seemed like a not bad idea, given the above
+tu /etc/schroot/desktop/fstab <<'EOF'
+/run           /run            none    rw,bind         0       0
+/run/lock      /run/lock       none    rw,bind         0       0
+/dev/shm       /dev/shm        none    rw,bind         0       0
+/run/shm       /run/shm        none    rw,bind         0       0
+/run/user/1000 /run/user/1000  none    rw,bind         0       0
+/run/user/0    /run/user/0     none    rw,bind         0       0
+EOF
+
+mkschroot() {
+    n=$1
+    shift
+    apps=($@)
+    d=/nocow/schroot/$n
+    if [[ -e $d/bin ]]; then
+        s chroot $d apt-get update
+        s chroot $d apt-get -y dist-upgrade --purge --auto-remove
+        s schroot -c $n -- apt-get install --allow-unauthenticated -y ${apps[@]}
+    else
+        s mkdir -p $d
+        s debootstrap $n $d http://deb.debian.org/debian/
+        s dd of=/etc/schroot/chroot.d/$n.conf <<EOF
+[$n]
+description=$n
+type=directory
+directory=$d
+profile=desktop
+preserve-environment=true
+users=$USER
+EOF
+
+        s cp -P {,$d}/etc/localtime
+        cd #schroot fails if our current directory is not in the chroot
+        s schroot -c $n -- apt-get install --allow-unauthenticated -y ${apps[@]}
+    fi
+}
+
+# for my roommate
+case $distro in
+    trisquel)
+        mkschroot stretch firefox-esr pulseaudio chromium
+    ;;
+esac
+
 s mkdir -p /nocow/user
 s chown $USER:$USER /nocow/user
 case $distro in
@@ -934,30 +1023,7 @@ case $distro in
                 pi anki
                 ;;
             *)
-                pi debootstrap schroot
-                d=/nocow/user/schroot/anki
-                if [[ -e $d/bin ]]; then
-                    s chroot $d apt-get update
-                    s chroot $d apt-get -y dist-upgrade --purge --auto-remove
-                else
-
-                    mkdir -p /nocow/user/schroot/anki
-                    s debootstrap jessie $d http://deb.debian.org/debian/
-                    s dd of=/etc/schroot/chroot.d/anki.conf <<EOF
-[anki]
-description=Anki on jessie
-type=directory
-directory=$d
-profile=desktop
-preserve-environment=true
-users=$USER
-EOF
-
-                    s cp {,$d}/etc/locale.gen
-                    s cp -P {,$d}/etc/localtime
-                    cd
-                    s schroot -c anki -- apt-get install -y anki locales mplayer
-                fi
+                mkschroot jessie anki pulsaudio mplayer
                 ;;
         esac
         ;;