minor fixes, indenting
authorIan Kelling <ian@iankelling.org>
Thu, 13 Apr 2017 09:59:07 +0000 (02:59 -0700)
committerIan Kelling <ian@iankelling.org>
Thu, 13 Apr 2017 09:59:07 +0000 (02:59 -0700)
distro-end
mail-setup
maru-init

index 534c17a5856691b20dc07bad6ddee92cb7fe667a..a1d9389e801fa6e1618efaa57c104785b48091d4 100755 (executable)
@@ -84,6 +84,7 @@ case $HOSTNAME in
             gdb
             gdb-doc
             git-doc
+            git-email
             gitk
             glibc-doc
             goaccess
@@ -389,7 +390,7 @@ EOF
          ProxyPass /  https://127.0.0.1:8001/
          ProxyPassReverse /  https://127.0.0.1:8001/
          # i have sockjs disabled per people suggesting that
-         # it won't work with apache right now.
+         # it won\'t work with apache right now.
          # not sure if it would work with this,
          # but afaik, this is pointless atm.
          <Location /main/realtime/sockjs/>
@@ -458,12 +459,12 @@ fi
 case $distro in
     debian|ubuntu)
         # suggests because we want the resolvconf package.
-        # todo: check other distros to make sure it's installed
+        # todo: check other distros to make sure it\'s installed
         pi-nostart --install-suggests openvpn
         # pi-nostart does not disable
         ser disable openvpn
         ;;
-*) pi openvpn;;
+    *) pi openvpn;;
 esac
 
 if private-host; then
@@ -543,11 +544,11 @@ if [[ $HOSTNAME == treetowl ]]; then
     # after adding, notification will appear on desktop to confirm
     #
     # syncing folder. from phone to desktop: select desktop in the
-    # folder on phone's sync options, notification will appear in
-    # desktop's web ui within a minute. For the reverse, the
-    # 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
+    # folder on phone\'s sync options, notification will appear in
+    # desktop\'s web ui within a minute. For the reverse, the
+    # 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.
     #
     # On phone, set settings to run syncthing all the time, and
@@ -566,49 +567,49 @@ fi
 
 
 
-    # no equivalent in other distros:
-    case $distro in
-        debian|ubuntu)
-            # for gui bug reporting
-            spa python-vte
-            ;;
-    esac
+# no equivalent in other distros:
+case $distro in
+    debian|ubuntu)
+        # for gui bug reporting
+        spa python-vte
+        ;;
+esac
 
 
-    ####### misc packages ###########
+####### misc packages ###########
 
-    if [[ $HOSTNAME == treetowl ]]; then
-        case $distro in
-            debian|ubuntu)
-                # note i had to do this, which is persistent:
-                # cd /i/k
-                # s chgrp debian-transmission torrents partial-torrents
-
-                # syslog says things like
-                # 'Failed to set receive buffer: requested 4194304, got 425984'
-                # google suggets giving it even more than that
-                tu /etc/sysctl.conf<<'EOF'
+if [[ $HOSTNAME == treetowl ]]; then
+    case $distro in
+        debian|ubuntu)
+            # note i had to do this, which is persistent:
+            # cd /i/k
+            # s chgrp debian-transmission torrents partial-torrents
+
+            # syslog says things like
+            # 'Failed to set receive buffer: requested 4194304, got 425984'
+            # google suggets giving it even more than that
+            tu /etc/sysctl.conf<<'EOF'
 net.core.rmem_max = 67108864
 net.core.wmem_max = 16777216
 EOF
-                s sysctl -p
+            s sysctl -p
 
-            # some reason it doesn't seem to start automatically anyways
+            # some reason it doesn\'t seem to start automatically anyways
             pi-nostart transmission-daemon
 
             # the folder was moved here after an install around 02/2017.
             # it contains runtime data,
-            # plus a simple symlink to the config file which it's
+            # plus a simple symlink to the config file which it\'s
             # not worth separating out.
             s lnf -T /i/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon
             #
-            # config file documented here, and it's the same config
-            # for daemon vs client, so it's documented in the gui.
+            # config file documented here, and it\'s the same config
+            # for daemon vs client, so it\'s documented in the gui.
             # https://trac.transmissionbt.com/wiki/EditConfigFiles#Options
             #
             # I originaly setup rpc-whitelist, but after using
-            # routing to a network namespace, it doesn't see the
-            # real source address, so it's disabled.
+            # routing to a network namespace, it doesn\'t see the
+            # real source address, so it\'s disabled.
             #
             # Changed the cache-size to 256 mb, reduces disk use.
             # It is a read & write cache.
@@ -635,34 +636,34 @@ EOF
             ser disable transmission-daemon
             sgo transmission-daemon-nn
             ;;
-            # todo: others unknown
-        esac
-    fi
+        # todo: others unknown
+    esac
+fi
 
-    # adapted from /var/lib/dpkg/info/transmission-daemon.postinst
-    if ! getent passwd debian-transmission > /dev/null; then
-        case $distro in
-            arch)
-                s useradd \
-                  --system \
-                  --create-home \
-                  --home-dir /var/lib/transmission-daemon \
-                  --shell /bin/false \
-                  debian-transmission
-                ;;
-            *)
-                s adduser --quiet \
-                  --system \
-                  --group \
-                  --no-create-home \
-                  --disabled-password \
-                  --home /var/lib/transmission-daemon \
-                  debian-transmission
-                ;;
-        esac
-    fi
+# adapted from /var/lib/dpkg/info/transmission-daemon.postinst
+if ! getent passwd debian-transmission > /dev/null; then
+    case $distro in
+        arch)
+            s useradd \
+              --system \
+              --create-home \
+              --home-dir /var/lib/transmission-daemon \
+              --shell /bin/false \
+              debian-transmission
+            ;;
+        *)
+            s adduser --quiet \
+              --system \
+              --group \
+              --no-create-home \
+              --disabled-password \
+              --home /var/lib/transmission-daemon \
+              debian-transmission
+            ;;
+    esac
+fi
 
-# dunno why it's there, but get rid of it
+# dunno why it\'s there, but get rid of it
 case $HOSTNAME in
     li|lj) s rm -rf /home/linode ;;
 esac
@@ -854,7 +855,7 @@ case $distro in
 esac
 # allow user to run vms, from debian handbook
 for x in ian traci; do s usermod -a -G libvirt,kvm $x; done
-# bridge networking as user fails. google lead here, but it doesn't work:
+# bridge networking as user fails. google lead here, but it doesn\'t work:
 # oh well, I give up.
 # http://wiki.qemu.org/Features-Done/HelperNetworking
 # s mkdir /etc/qemu
@@ -1010,7 +1011,7 @@ EOF
     # has seg fault error due to some bug, but it still works
     pip install -r requirements.txt || [[ $? == 139 ]]
     # note, the target must exist ahead of time, or bitcoin
-    # just overwrites the link, and it's not happy with an empty file,
+    # just overwrites the link, and it\'s not happy with an empty file,
     # so we have to create the wallet, then move and link it.
     s lnf -T /q/bitcoin/wallet.dat /nocow/.bitcoin/wallet.dat
     s lnf -T /q/bitcoin/joinmarket.dat /nocow/.bitcoin/joinmarket.dat
@@ -1028,73 +1029,64 @@ EOF
     done
     sed -ri "s/^\s*(blockchain_source\s*=).*/\1 bitcoin-rpc/" joinmarket.cfg
 
-                    fi
-
-
-
-
-                       # proprietary flash. going without for now
-                       # case $distro in
-                       #     debian)
-                       #         pi flashplugin-nonfree
-                       # esac
+fi
 
 
 
-                       case $distro in
-                           fedora)
-                               cd $(mktemp -d)
-                               wget http://tamacom.com/global/global-6.3.2.tar.gz
-                               ex global*
-                               cd global-6.3.2
-                               # based on https://github.com/leoliu/ggtags
-                               ./configure --with-exuberant-ctags=/usr/bin/ctags
-                               make
-                               s make install
-                               s pip install pygments
-                               ;;
-                           *)
-                               pi global
-                               ;;&
-                           arch)
-                               pi  python2-pygments
-                               ;;
-                           debian|ubuntu)
-                               pi python-pygments
-                               ;;
-                       esac
+case $distro in
+    fedora)
+        cd $(mktemp -d)
+        wget http://tamacom.com/global/global-6.3.2.tar.gz
+        ex global*
+        cd global-6.3.2
+        # based on https://github.com/leoliu/ggtags
+        ./configure --with-exuberant-ctags=/usr/bin/ctags
+        make
+        s make install
+        s pip install pygments
+        ;;
+    *)
+        pi global
+        ;;&
+    arch)
+        pi  python2-pygments
+        ;;
+    debian|ubuntu)
+        pi python-pygments
+        ;;
+esac
 
 
-                       case $distro in
-                           debian)
-                               pi task-cinnamon-desktop
-                               # in settings, change scrolling to two-finger,
-                               # because the default edge scroll doesn\'t work.
-                               pu transmission-gtk
-                               ;;
-                           # others unknown
-                       esac
+case $distro in
+    debian)
+        pi task-cinnamon-desktop
+        # in settings, change scrolling to two-finger,
+        # because the default edge scroll doesn\'t work.
+        pu transmission-gtk
+        ;;
+    # others unknown
+esac
 
-                       case $distro in
-                           arch) spa apg  ;;
+case $distro in
+    arch) spa apg  ;;
 
-                           # already in debian jessie
-                       esac
+    # already in debian jessie
+esac
 
 
 
 
-                       # note this failed running at the beginning of this file,
-                       # because no systemd user instance was running.
-                       # Doing systemd --user resulted in
-                       # Trying to run as user instance, but $XDG_RUNTIME_DIR is not set
+# note this failed running at the beginning of this file,
+# because no systemd user instance was running.
+# Doing systemd --user resulted in
+# Trying to run as user instance, but $XDG_RUNTIME_DIR is not set
 
-                       if isdebian-testing; then
-                           # as of 7/2016, has no unstable deps, and is not in testing anymore.
-                           pi synergy/unstable
-                       else
-                           pi synergy
-                       fi
+if isdebian-testing; then
+    # as of 7/2016, has no unstable deps, and is not in testing anymore.
+    pi synergy/unstable
+else
+    pi synergy
+fi
 
 # case $distro in
 #     # ubuntu unknown. probably the same as debian, just check if the
@@ -1170,7 +1162,7 @@ EOF
 ######### end misc packages #########
 
 
-# packages I once used before and liked, but don't want installed now for
+# packages I once used before and liked, but don\'t want installed now for
 # various reasons:
 # python-sqlite is used for offlineimap
 # lxappearance python-sqlite dolphin paman dconf-editor
@@ -1236,7 +1228,7 @@ log-file /var/log/apache2/access.log
 color-scheme 2
 
 # tip: copy access.log files to a stretch host directory, then run
-# jessie's goaccess is too old for some options, and it's
+# jessie's goaccess is too old for some options, and it\'s
 # not easily installed from a testing.
 # goaccess --ignore-crawlers -f <(cat *) -a -o html > x.html
 EOF
index 716a8b17ddfcd10628fef84adca377004656824d..3bd6b21725ea4b1f05d91059be088f24889b4361 100755 (executable)
@@ -467,6 +467,7 @@ EOF
     # just noticed this in the config file, seems like a good idea.
     s sed -i '/^\s*NICE\s*=/d' /etc/default/spamassassin
     s tee -a /etc/default/spamassassin <<<'NICE="--nicelevel 15"'
+    ser reload spamassassin
 
     s dd of=/etc/systemd/system/spamddnsfix.service <<'EOF'
 [Unit]
@@ -484,7 +485,7 @@ Description=run spamd bug fix script every 10 minutes
 # the script looks back 9 minutes into the journal,
 # it takes a second to run,
 # so lets run every 9 minutes and 10 seconds.
-OnActiveSec=550
+OnUnitInactiveSec=550
 
 [Install]
 WantedBy=timers.target
index 92f179b266860f0a9687bd4130a963ec56959789..8f4ab557ed93b826c7511ad520ab5ef03b20b695 100644 (file)
--- a/maru-init
+++ b/maru-init
@@ -38,16 +38,16 @@ esac
 
 
 scp $(readlink -f $(which rootsshsync)) maru-init maru@n5:
-ssh maru@n5 ./rootsshsync
+ssh -t maru@n5 ./rootsshsync
 
 ssh root@n5 bash <<'EOF'
 echo "ian  ALL=(ALL)  NOPASSWD: ALL" >>/etc/sudoers
 echo n5 >/etc/hostname
-hostname -F /etc/hostname
 sed -i '/^127\.0\.1\.1/d' /etc/hosts
 echo "127.0.1.1 n5.lan n5" >>/etc/hosts
+hostname -F /etc/hostname
 
-kill $(pgrep -U ian)
+kill $(pgrep -U maru)
 usermod -l ian -m -d /home/ian maru
 groupmod -n ian maru
 useradd -m -s /bin/bash traci