various minor improvements
[distro-setup] / distro-end
index 3b109c80d30d423bb2526b9fe1e081f560803bdc..76d37ea911f2cdca48de6d5c5bbe2e71e1d24587 100755 (executable)
@@ -67,7 +67,10 @@ 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+=(
+            adb
             apache2
             apache2-doc
             apt-doc
@@ -83,6 +86,7 @@ case $HOSTNAME in
             cloc
             cpulimit
             cron
+            debootstrap
             debconf-doc
             dirmngr
             dnsutils
@@ -114,6 +118,7 @@ case $HOSTNAME in
             jq
             kid3-qt
             kid3-cli
+            linphone
             linux-doc
             locate
             lshw
@@ -143,10 +148,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 +162,10 @@ case $HOSTNAME in
             vlc
             whois
             wondershaper
+            xawtv
+            xbacklight
+            xprintidle
+            xscreensaver
         )
         spa $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}')
         ;;
@@ -328,6 +337,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 +380,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 +875,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
@@ -860,7 +893,7 @@ if [[ $HOSTNAME == frodo ]]; then
     # Set gui username and password.
     #
     # install syncthing via f-droid,
-    # folder setting, turn off master folder (makes it read only).
+    # folder setting, turn off send only.
     # on phone, add device, click bar code icon
     # on dekstop, top right, actions, device id
     # after adding, notification will appear on desktop to confirm
@@ -871,7 +904,8 @@ if [[ $HOSTNAME == frodo ]]; then
     # notification will appear in android\'s notifications, you have to
     # swipe down and tap it to add the folder. It won\'t appear in the
     # syncthing ui, which would be intuitive, but don\'t wait for it
-    # there.
+    # there. The notification may not work, instead open the web gui
+    # from in the app, there should be a notification within there.
     #
     # On phone, set settings to run syncthing all the time, and
     # show no notification.
@@ -900,7 +934,35 @@ case $distro in
 esac
 
 
-####### misc packages ###########
+####### begin misc packages ###########
+
+
+### begin spd install
+
+pi libswitch-perl libdigest-md5-file-perl libgnupg-interface-perl
+t=$(mktemp)
+wget -O $t http://mirror.fsf.org/fsfsys-trisquel/fsfsys-trisquel/pool/main/s/spd-perl/spd-perl_0.2-1_amd64.deb
+s dpkg -i $t
+rm $t
+# this guesses at the appropriate directory, adjust if needed
+x=(/usr/lib/x86_64-linux-gnu/perl/5.*)
+sudo ln -s ../../../perl/5.18.2/SPD/ $x
+# newer distro had gpg2 as default, older one, flidas, need to make it that way
+x=$(which gpg2)
+if [[ $x ]]; then
+    lnf -T $x /usr/local/bin/gpg
+fi
+### end spd install
+
+
+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 +987,53 @@ 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
+    s dd of=/etc/schroot/chroot.d/$n.conf <<EOF
+[$n]
+description=$n
+type=directory
+directory=$d
+profile=desktop
+preserve-environment=true
+users=$USER,traci
+EOF
+    if [[ -e $d/bin ]]; then
+        s chroot $d apt-get update
+        s chroot $d apt-get -y dist-upgrade --purge --auto-remove
+        cd; 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/
+        cd; s schroot -c $n -- apt-get install --allow-unauthenticated -y ${apps[@]}
+    fi
+    s cp -P {,$d}/etc/localtime
+
+}
+
+# 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 +1043,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
         ;;
@@ -1219,7 +1305,8 @@ esac
 
 case $distro in
     arch) spa firefox pulseaudio;;
-    *) : ;; # comes default or with other packages
+    trisquel) spa abrowser ;;
+    *) : ;; # comes default or with other packages, or uknown
 esac
 
 
@@ -1522,6 +1609,9 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
+
+
+
 # stop autopoping windows when i plug in an android phone.
 # dbus-launch makes this work within an ssh connection, otherwise you get this message,
 # with still 0 exit code.