+######### begin transmission client setup ######
+
+if [[ -e /p/transmission-rpc-pass ]]; then
+ # arch had a default config,
+ # debian had nothing until you start it.
+ # With a little trial an error, here is a minimal config
+ # taken from the generated one, plus changes that the
+ # settings ui does, without a bunch of ui crap settings.
+ #
+ # only settings I set were
+ # hostname
+ # auto-connect
+ # password
+
+ # the password is randomly generated on first run, i copied it out
+ # so it could be used by other hosts.
+ s ruby <<'EOF'
+require 'json'
+p = '/etc/transmission-daemon/settings.json'
+s = JSON.parse(File.read(p))
+s["rpc-password"] = File.read("/p/transmission-rpc-pass").chomp
+# default is 0022 (18 in decimal)
+s["umask"] = 2
+File.write p, JSON.pretty_generate(s)
+EOF
+
+ rpc_pass=$(</p/transmission-rpc-pass)
+ for f in /home/*; do
+ u=${f##*/}
+ uid=$(id -u $u 2>/dev/null) || continue
+ if [[ ! $uid -ge 1000 ]]; then
+ continue
+ fi
+ d=$f/.config/transmission-remote-gtk
+ s -u $u mkdir -p $d
+ s -u $u dd of=$d/config.json <<EOF
+{
+ "profiles" : [
+ {
+ "profile-name" : "Default",
+ "hostname" : "transmission.b8.nz",
+
+ "rpc-url-path" : "/transmission/rpc",
+ "username" : "",
+ "password" : "$rpc_pass",
+ "auto-connect" : true,
+ "ssl" : false,
+ "timeout" : 40,
+ "retries" : 3,
+ "update-active-only" : false,
+ "activeonly-fullsync-enabled" : false,
+ "activeonly-fullsync-every" : 2,
+ "update-interval" : 3,
+ "min-update-interval" : 3,
+ "session-update-interval" : 60,
+ "exec-commands" : [],
+ "destinations" : []
+ },
+ {
+ "profile-name" : "local",
+ "hostname" : "10.173.0.2",
+
+ "username" : "",
+ "password" : "$rpc_pass",
+ "auto-connect" : true,
+ "ssl" : false,
+ "timeout" : 40,
+ "retries" : 3,
+ "update-active-only" : false,
+ "activeonly-fullsync-enabled" : false,
+ "activeonly-fullsync-every" : 2,
+ "update-interval" : 3,
+ "min-update-interval" : 3,
+ "session-update-interval" : 60,
+ "exec-commands" : [],
+ "destinations" : []
+ }
+ ],
+ "profile-id" : 0,
+ "add-options-dialog" : false
+}
+EOF
+ done
+fi
+######### end transmission client setup ######
+
+
+### printer setup
+pi cups hplip
+s gpasswd -a $USER lpadmin # based on ubuntu wiki
+# goto http://127.0.0.1:631
+# administration tab, add new printer button.
+# In debian, I could use hte recommended driver,
+# in arch, I had to pick out the 6L driver.
+
+
+# allow user to run vms, from debian handbook
+for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
+# 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
+# f=/etc/qemu/bridge.conf
+# sd $f <<'EOF'
+# allow br0
+# EOF
+# #s chown root:qemu $f # debian has somethig like qemu-libvirt. equivalent?
+# s chmod 640 $f
+
+# general known for debian/ubuntu, not for fedora
+
+m /a/bin/buildscripts/go
+m /a/bin/buildscripts/rust
+m /a/bin/buildscripts/misc
+
+pi-nostart virtinst virt-manager
+
+
+
+pi --no-install-recommends kdeconnect
+### kdeconnect for gnome. started in /a/bin/distro-setup/desktop-20-autostart.sh
+### but gnome + xmonad not working in flidas, so i disabled it
+# pi libgtk-3-dev python3-requests-oauthlib valac cmake python-nautilus libappindicator3-dev
+# cd /a/opt/indicator-kdeconnect
+# mkdir -p build
+# cd build
+# cmake .. -DCMAKE_INSTALL_PREFIX=/usr
+# make
+# sudo make install
+# # we can start it manually with /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
+# # it seems, according to
+# # /etc/xdg/autostart/kdeconnectd.desktop
+# # I'm not seeing the icon, but the clipboard replication is working
+
+
+### model 01 arduino support ###
+# https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-Linux
+# also built latest arduino in /a/opt/Arduino, (just cd build; ant build; ant run )
+# set arduino var in bashrc,
+# have system config file setup too.
+s adduser $USER dialout
+
+# this is for the mail command too. update-alternatives is kind of misleading
+# since at least it's main commands pretend mail does not exist.
+# bsd's mail got pulled in on some dumb dependency, i dunno how.
+s update-alternatives --set mailx /usr/bin/mail.mailutils
+