2 # Copyright (C) 2016 Ian Kelling
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 exec &> >(sudo
tee -a /var
/log
/distro-end
)
21 echo "$0: $(date): starting now)"
23 src
="${BASH_SOURCE%/*}"
27 IFS
= read -r -d '' y ||
:
31 spa
() { # simple package add
61 # swh-plugins is for karaoke pulsaudio filter.
99 transmission-remote-gtk
107 ########### begin section including li ################
112 if [[ `debian-archive` == testing
]]; then
125 # ubuntu 14.04 uses b-cron,
126 # but its not maintained in arch.
127 # of the ones in the main repos, cronie is only one maintained.
128 # fcron appears abandoned software.
132 *) : ;; # other distros come with cron.
162 arch
) spa the_silver_searcher
;;
163 debian|ubuntu
) spa silversearcher-ag
;;
168 debian|ubuntu
) spa ntp
;;
177 # no equivalent in other distros:
182 # for debconf-get-selections
188 ubuntu|debian
) spa ack-grep
;;
189 arch|fedora
) spa ack
;;
205 case $
(distro-name
) in
207 # allows me to pipe with ssh -t, and gets rid of spam
208 # http://forums.debian.net/viewtopic.php?f=5&t=85822
209 # i'd rather disable the service than comment the init file
210 # this says disabling the service, it will still get restarted
211 # but this script doesn't do anything on restart, so it should be fine
212 s
dd of
=/var
/run
/motd.dynamic
if=/dev
/null
213 # stretch doesn't have initscripts pkg installed by default
214 if [[ $
(debian-codename
) == jessie
]]; then
215 s update-rc.d motd disable
219 # this isn't a complete solution. It still shows me when updates are available,
220 # but it's no big deal.
221 s t
/etc
/update-motd.d
/10-help-text /etc
/update-motd.d
/00-header
227 # https://debian-handbook.info/browse/stable/sect.regular-upgrades.html
228 # /etc/cron.daily/apt calls unattended-upgrades
229 # /usr/share/doc/unattended-upgrades# cat README.md
230 # /etc/apt/apt.conf.d/50unattended-upgrades
232 setup-debian-auto-update
235 # we've got a few dependencies later on, so install them now.
236 pi
"${simple_packages[@]}"
244 lj
) domain
=iank.bid
; exit 0 ;;
245 li
) domain
=iankelling.org
;;
247 /a
/h
/setup.sh
$domain
250 sudo
-E /a
/bin
/mediawiki-setup
/mw-setup-script
253 pi-nostart mumble-server
254 s
sed -ri "s/^ *(serverpassword=).*/\1$(< /a/bin/bash_unpublished/mumble_pass)/" /etc
/mumble-server.ini
259 sudo
dd of
=/etc
/systemd
/system
/vpnmail.service
<<EOF
261 Description=Turns on iptables mail nat
266 ExecStart=/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.8.0.4:25
267 ExecStop=/sbin/iptables -t nat -D PREROUTING -i eth0 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.8.0.4:25
270 WantedBy=openvpn.service
273 ser
enable vpnmail.service
274 acme-tiny-wrapper
mail.iankelling.org
278 echo "$0: $(date): ending now)"
284 ########### end section including li/lj ###############
286 if private-host
; then
287 vpn-mk-client-cert
-n mail li
288 echo "ifconfig-push 10.8.0.4 255.255.255.0" |
ssh root@li
dd of
=/etc
/openvpn
/client-config
/$
(openssl x509
-noout -subject -in mail.crt |
sed -r 's/.*CN *= *([^,]+).*/\1/')
291 if [[ $HOSTNAME == treetowl
]]; then
292 # note, this will need to be changed when the mail host changes
293 sgo openvpn-client@
mail
296 ## android studio setup
297 # this contains the setting for android sdk to point to
298 # /a/opt/androidsdk, which is asked upon first run
299 lnf
/a
/opt
/.AndroidStudio2.2 ~
300 # android site says it needs a bunch of packages for ubuntu,
301 # but I googled for debian, and someone says you just need lib32stdc++6 plus the
303 # https://pid7007blog.blogspot.com/2015/07/installing-android-studio-in-debian-8.html
304 # see w.org for more android studio details
305 spa lib32stdc
++6 default-jdk
309 arch
) pi syncthing
;;
311 # testing has relatively up to date packages
312 if ! isdebian-testing
; then
313 # based on error when doing apt-get update:
314 # E: The method driver /usr/lib/apt/methods/https could not be found.
315 pi apt-transport-https
316 # google led me here:
317 # https://apt.syncthing.net/
318 curl
-s https
://syncthing.net
/release-key.txt | sudo apt-key add
-
319 s
="deb http://apt.syncthing.net/ syncthing release"
320 if [[ $
(cat /etc
/apt
/sources.list.d
/syncthing.list
) != $s ]]; then
321 echo "$s" | s
dd of
=/etc
/apt
/sources.list.d
/syncthing.list
328 # installed via f-droid
329 # top right, actions, device id
331 # for installing on a remote comp:
332 # ssh -L 8384:localhost:8384 -N frodo
333 # went to http://localhost:8384/
335 # add folder to sync phone,
336 # staggered file versioning would be my normal choice, but choose
337 # trash can versioning for sake of space on phone, with
338 # clean out after 7 days.
341 # ser start syncthing@ian
342 # then on phone, add device, hit bar code icon,
343 # install bar code scanner.
346 # no equivalent in other distros:
349 # for gui bug reporting
355 ####### misc packages ###########
357 if [[ $HOSTNAME == treetowl
]]; then
360 # note i had to do this, which is persistent:
362 # s chgrp debian-transmission torrents partial-torrents
364 # syslog says things like
365 # 'Failed to set receive buffer: requested 4194304, got 425984'
366 # google suggets giving it even more than that
367 tu
/etc
/sysctl.conf
<<'EOF'
368 net.core.rmem_max = 67108864
369 net.core.wmem_max = 16777216
373 # some reason it doesn't seem to start automatically anyways
374 pi-nostart transmission-daemon
376 # config file documented here, and it's the same config
377 # for daemon vs client, so it's documented in the gui.
378 # https://trac.transmissionbt.com/wiki/EditConfigFiles#Options
380 # I originaly setup rpc-whitelist, but after using
381 # routing to a network namespace, it doesn't see the
382 # real source address, so it's disabled.
384 # Changed the cache-size to 128 mb, reduces disk use.
385 # It is a read & write cache.
387 # todo: setup a password.
390 p = '/etc/transmission-daemon/settings.json'
391 File.write(p, JSON.pretty_generate(JSON.parse(File.read(p)).merge({
392 'rpc-whitelist-enabled' => false,
393 'rpc-authentication-required' => false,
394 'incomplete-dir' => '/k/partial-torrents',
395 'incomplete-dir-enabled' => true,
396 'download-dir' => '/i/k/torrents',
397 "speed-limit-up" => 800,
398 "speed-limit-up-enabled" => true,
399 "peer-port" => 61486,
400 "cache-size-mb" => 128,
401 "ratio-limit" => 1.4000,
402 "ratio-limit-enabled" => false,
403 "pidfile": "/var/lib/transmission-daemon/transmission-daemon.pid",
407 # make sure its not enabled, not sure if this is needed
408 ser disable transmission-daemon
409 sgo transmission-daemon-nn
411 # todo: others unknown
415 # adapted from /var/lib/dpkg/info/transmission-daemon.postinst
416 if ! getent passwd debian-transmission
> /dev
/null
; then
422 --home-dir /var
/lib
/transmission-daemon \
431 --disabled-password \
432 --home /var
/lib
/transmission-daemon \
438 # dunno why it's there, but get rid of it
440 li|lj
) s
rm -rf /home
/linode
;;
443 # arch had a default config,
444 # debian had nothing until you start it.
445 # With a little trial an error, here is a minimal config
446 # taken from the generated one, plus changes that the
447 # settings ui does, without a bunch of ui crap settings.
449 # only settings I set were
453 d
=$f/.config
/transmission-remote-gtk
456 s
-u $u dd of
=$d/config.json
<<'EOF'
460 "profile-name" : "Default",
461 "hostname" : "treetowl",
462 "rpc-url-path" : "/transmission/rpc",
465 "auto-connect" : true,
469 "update-active-only" : false,
470 "activeonly-fullsync-enabled" : false,
471 "activeonly-fullsync-every" : 2,
472 "update-interval" : 3,
473 "min-update-interval" : 3,
474 "session-update-interval" : 60,
482 "add-options-dialog" : false
489 # suggests because we want the resolvconf package.
490 # todo: check other distros to make sure it's installed
491 pi-nostart
--install-suggests openvpn
492 # pi-nostart this doesnt seem to be good enough?
493 ser disable openvpn@client
506 wget
-nv -N https
://dl.google.com
/linux
/direct
/google-chrome-stable_current_amd64.deb
509 s dpkg
-i google-chrome-stable_current_amd64.deb |
& tee $log
515 # previously I had a more specific search, but dpkg
516 # changed it's output as of 7/2016
517 if grep 'dependency problems' \
518 $log &>/dev
/null
; then
519 s apt-get
-fy install
536 pi cups ghostscript gsfonts
# from arch wiki cups page
537 pi hplip
# from google
538 s gpasswd
-a $USER sys
# from arch wiki
539 sgo org.cups.cupsd.service
540 # goto http://127.0.0.1:631
541 # administration tab, add new printer button.
542 # In debian, I could use hte recommended driver,
543 # in arch, I had to pick out the 6L driver.
548 # other distros unknown
553 ubuntu|debian
) pi
--no-install-recommends mairix notmuch
;;
554 fedora|arch
) spa mairix notmuch
;;
557 arch
) spa nfs-utils
;;
558 ubuntu|debian
) spa nfs-client
;;
561 ubuntu|debian
) spa par2
;;
562 arch|fedora
) spa par2cmdline
;;
565 # needed for my tex resume
567 ubuntu|debian
) spa texlive-full
;;
568 arch
) spa texlive-most
;;
574 # flash, unrar, codecs, ms fonts.
575 # This has a manual prompt.
576 spa ubuntu-restricted-extras
580 # rpm fusion recommended codecs
581 s su
-c "yum localinstall -y --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
582 pi gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg\
583 xine-lib-extras-freeworld
588 # optional dep for firefox for h.264 video
589 arch
) spa gst-libav
;;
590 # other distros, probably come by default
594 fedora|ubuntu|debian
) spa gnupg-agent
;;
600 fedora
) spa pinentry-gtk
;;
601 *) : ;; # comes default or with other packages
605 arch
) spa firefox pulseaudio
;;
606 *) : ;; # comes default or with other packages
611 arch
) spa ttf-dejavu
;;
612 debian|ubuntu
) spa fonts-dejavu
;;
619 debian|ubuntu
) spa x11-utils
;;
624 arch
) pi virt-install
;;&
625 debian|ubuntu
) pi virtinst
;;&
626 *) pi virt-manager
;; # creates the libvirt group in debian at least
629 # allow user to run vms, from debian handbook
630 for x
in ian traci
; do s usermod
-a -G libvirt
,kvm
$x; done
631 # bridge networking as user fails. google lead here, but it doesn't work:
632 # oh well, I give up.
633 # http://wiki.qemu.org/Features-Done/HelperNetworking
635 # f=/etc/qemu/bridge.conf
639 # #s chown root:qemu $f # debian has somethig like qemu-libvirt. equivalent?
645 debian|ubuntu
) spa genisoimage
;;
650 arch
) spa spice-gtk3
;;
651 debian|ubuntu
) spa spice-client-gtk
;;
655 # general known for debian/ubuntu, not for fedora
658 # cdrkit for cloud-init isos
659 # dnsmasq & ebtables for nat networking in libvirt
660 # qemu for qemu-img, bind-tools for dig
661 # dmidecode just because syslog complains
662 pi
unzip xorg-xmodmap dmidecode ebtables\
663 bridge-utils dnsmasq qemu bind-tools
664 # otherwise we get error about accessing kvm module.
665 # seems like there might be a better way, but google was a bit vague.
666 s
sed -ri --follow-symlinks '/^ *user *=/d' /etc
/libvirt
/qemu.conf
667 echo 'user = "root"' | s
tee -a /etc
/libvirt
/qemu.conf
668 # https://bbs.archlinux.org/viewtopic.php?id=206206
669 # # this should prolly go in the wiki
671 # guessing this is not needed
672 #sgo virtlogd.service
679 arch
) pi virtviewer
;;
680 *) : ;; # other distros have it as a dependency afaik.
686 fedora
) cabal
install shellcheck
;;
688 # unknown for older ubuntu
693 arch|debian|ubuntu
) spa pumpa
;;
694 # others unknown. do have a buildscript:
695 # /a/bin/buildscripts/pumpa ;;
700 debian|ubuntu
) spa android-tools-adbd
/unstable
;;
701 arch
) spa android-tools
;;
702 # other distros unknown
707 if [[ `debian-archive` == testing
]]; then
708 # has no unstable dependencies
709 spa bitcoin-qt
/unstable
711 s
cp /a
/opt
/bitcoin
/contrib
/init
/bitcoind.service
/etc
/systemd
/system
716 s chown
-R bitcoin
:bitcoin
$dir
719 s chown
-R root
:bitcoin
$dir
723 # pruning decreases the bitcoin dir to 2 gb, keeps
724 # just the recent blocks. can't do a few things like
725 # import a wallet dump.
726 # pruning works, but people had to do
727 # some manual stuff in joinmarket. I dun need the
728 # disk space, so not bothering yet, maybe in a year or so.
729 # https://github.com/JoinMarket-Org/joinmarket/issues/431
730 #https://bitcoin.org/en/release/v0.12.0#wallet-pruning
736 rpcpassword=$(openssl rand -base64 32)
737 rpcuser=$(openssl rand -base64 32)
740 walletnotify=curl -sI --connect-timeout 1 http://localhost:62602/walletnotify?%s
741 alertnotify=curl -sI --connect-timeout 1 http://localhost:62602/alertnotify?%s
744 # other distros unknown
746 if [[ $HOSTNAME == treetowl
]]; then
747 pi libsodium-dev python3-pip
749 # using develop branch, as it seems to be mostly bug fixes,
750 # and this is quite new software.
751 # note: python3 does not work.
752 pip
install -r requirements.txt
753 # we need bitcoin.conf in the data dir according to
754 # https://github.com/JoinMarket-Org/joinmarket/wiki/Running-JoinMarket-with-Bitcoin-Core-full-node
755 # following the example .service script, I don\'t have it there,
756 # and I generate it, so lets just symlink it.
757 sudo
-u bitcoin
ln -sf /etc
/bitcoin
/bitcoin.conf
/nocow
/.bitcoin
759 # one time, manually did python wallet-tool.py generate.
760 # The "wallet" is just a key which deterministically generates addresses.
761 # One time: move the wallet, then link to it.
762 # ln -s /p/joinmarket/wallet.json wallets
764 # see wallet addresses via:
765 # python wallet-tool.py wallet.json
766 # send to the first 3 mixing depth 0 addresses.
767 # depths are like "identities", to separate out association with
768 # each other. the big hash in that output is the depth/branch id,
771 # after sending btc to wallet from a 3rd party service, check that
772 # at least 20% of utxo of each transaction was sent to you,
773 # btc listtransactions 10 0 true
774 # btc getrawtransaction TXID 1
777 # python wallet-tool.py wallet.json history
779 # to help make other people,
780 # python yield-generator-basic.py wallet.json
782 for var
in rpcuser rpcpassword
; do
783 u
="$(s sed -rn "s
/^
$var=(.
*)/\
1/p
" /etc/bitcoin/bitcoin.conf)"
785 u
="${u//\\/\\\\\\\\}"
788 sed -ri "s,^(rpc_${var#rpc}\s*=).*,\1 $u," joinmarket.cfg
790 sed -ri "s/^\s*(blockchain_source\s*=).*/\1 bitcoin-rpc/" joinmarket.cfg
792 # dunno about sharing a wallet between multiple instances
793 # manually did, wallet.dat symlinked in /nocow/.bitcoin
800 # proprietary flash. going without for now
803 # pi flashplugin-nonfree
811 wget http
://tamacom.com
/global
/global-6.3
.2.
tar.gz
814 # based on https://github.com/leoliu/ggtags
815 .
/configure
--with-exuberant-ctags=/usr
/bin
/ctags
818 s pip
install pygments
834 pi task-cinnamon-desktop
835 # in settings, change scrolling to two-finger,
836 # because the default edge scroll doesn\'t work.
845 # already in debian jessie
851 # note this failed running at the beginning of this file,
852 # because no systemd user instance was running.
853 # Doing systemd --user resulted in
854 # Trying to run as user instance, but $XDG_RUNTIME_DIR is not set
856 if isdebian-testing
; then
857 # as of 7/2016, has no unstable deps, and is not in testing anymore.
864 # # ubuntu unknown. probably the same as debian, just check if the
865 # # init scripts come with the package.
867 # # copied from arch, but moved to etc
868 # s dd of=/etc/systemd/user/synergys.service <<'EOF'
870 # Description=Synergy Server Daemon
871 # After=network.target
875 # ExecStart=/usr/bin/synergys --no-daemon --config /etc/synergy.conf
879 # WantedBy=multi-user.target
881 # s dd of=/etc/systemd/user/synergys.socket <<'EOF'
883 # Conflicts=synergys@.service
890 # WantedBy=sockets.target
892 # # had this fail with 'Failed to connect to bus: No such file or directory'
893 # # then when I tried it manually, it worked fine...
894 # if ! systemctl --user daemon-reload; then
896 # echo retrying systemd user daemon reload
897 # systemctl --user daemon-reload
901 # # taken from arch wiki.
902 # s dd of=/etc/systemd/system/synergyc@.service <<'EOF'
904 # Description=Synergy Client
905 # After=network.target
909 # ExecStart=/usr/bin/synergyc --no-daemon frodo
911 # # per man systemd.unit, StartLimitInterval, by default we
912 # # restart more than 5 times in 10 seconds.
913 # # And this param defaults too 200 miliseconds.
917 # WantedBy=multi-user.target
919 # s systemctl daemon-reload
922 # ser enable synergyc@ian
923 # ser start synergyc@ian ||: # X might not be running yet
926 # systemctl --user start synergys ||:
927 # systemctl --user enable synergys
934 ######### end misc packages #########
937 # packages I once used before and liked, but don't want installed now for
939 # python-sqlite is used for offlineimap
940 # lxappearance python-sqlite dolphin paman dconf-editor
946 # todo, finish configuring smart.
949 # mostly from https://wiki.archlinux.org/index.php/S.M.A.R.T.
950 # turn on smart. background on options:
951 # first line, -a = test everyting on all devices.
952 # -S on, turn on disk internal saving of vendor specific info,
953 # from google, seems like this is usually already on and fairly standard.
954 # -o on, turn on 4 hour period non-performance degrading testing.
955 # short test daily 2-3am, extended tests Saturdays between 3-4am:
956 sched
="-s (S/../.././02|L/../../6/03)"
957 s
sed -i --follow-symlinks "s#^[[:space:]]*DEVICESCAN.*#\
958 DEVICESCAN -a -o on -S on -n standby,q $sched \
959 -m ian@iankelling.org -M exec /usr/local/bin/smart-notify#" /etc
/smartd.conf
961 # in the default configuration of at least ubuntu 14.04, resolvconf is
962 # configured to order any nameservers associated with tun* or tap*
963 # before the normal internet interfaces, which means they are always
964 # consulted first. This is often slower and undesirable, ie. local dns
965 # queries go from 0ms to 10+ or 100+ ms. To reverse the ordering, you
967 #sudo sed -i --follow-symlinks '/tun\*\|tap\*/d' /etc/resolvconf/interface-order
968 # however, this breaks dns lookup for hosts on the openvpn lan.
969 # I can\'t figure out why hosts on the normal lan would not be
970 # broken under the default ordering, except the host I was
971 # testing with previously had an entry in /etc/hosts.
973 ############# end unfinished
975 ########### misc stuff
978 # the wiki backup script from ofswiki.org uses generic paths
979 s lnf
/p
/c
/machine_specific
/li
/mw_vars
/root
980 s lnf
/k
/backup
/wiki_backup
/root
982 s cedit
/etc
/goaccess.conf
<<'EOF' || [[ $? == 1 ]]
983 # all things found from looking around the default config
984 # copied existing NCSA Combined Log Format with Virtual Host, plus %L
985 log-format %^:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %D
988 log-file /var/log/apache2/access.log
991 # tip: copy access.log files to a stretch host directory, then run
992 # jessie's goaccess is too old for some options, and it's
993 # not easily installed from a testing.
994 # goaccess --ignore-crawlers -f <(cat *) -a -o html > x.html
998 if [[ $HOSTNAME == treetowl
]] && ! sudo
test -e /etc
/openvpn
/client.key
; then
999 /a
/bin
/vpn-setup
/vpn-mk-client-cert dopub
1000 # route lan traffic from inside the network namespace.
1001 tu
/etc
/openvpn
/client.conf
"route 192.168.1.0 255.255.255.0 net_gateway"
1007 case `debian-archive` in
1009 s
dd of
=/etc
/apt
/preferences.d
/unison-gtk
<<'EOF'
1010 Explanation: Allow unison-gtk to be upgraded
1012 Pin: release a=unstable
1015 # dont think using testing is needed since I figured out how to
1016 # deal with mismatching unison compilers, but I dont
1017 # see any reason to revert it, since it only installs
1018 # a single package which is primarily a single binary
1022 pi unison-gtk
/testing
# after to make it the default unison
1031 # default is alsa, doesn\'t work with with pianobar
1032 s
dd of
=/etc
/libao.conf
<<'EOF'
1033 default_driver=pulse
1038 # note, for jessie, it depends on a higher version of btrfs-tools.
1040 # # disabled due to my patch being in btrbk
1042 # arch|debian|ubuntu) pi btrbk ;;
1047 spa pv
# for progress bar when running interactively.
1048 if [[ $HOSTNAME == treetowl
]]; then
1049 # backup/sync manually on others hosts for now.
1051 # note: to see when it was last run,
1055 if [[ $HOSTNAME == treetowl
]] && [[ `debian-archive` != testing
]]; then
1056 # fail2 ban is broken, with a workaround, per
1057 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770171
1058 # ill wait a while to see if it gets fixed
1068 debian|ubuntu
) s gpasswd
-a ian adm
;; #needed for reading logs
1074 # https://www.torproject.org/docs/rpms.html.en
1075 # https://www.torproject.org/docs/debian.html.en
1076 # todo: figure out if the running service needs to be restarted upon updates
1079 # todo on fedora: setup non-dev packages
1081 s
dd of
=/etc
/yum.repos.d
/torproject.repo
<<'EOF'
1083 name=Tor experimental repo
1085 baseurl=http://deb.torproject.org/torproject.org/rpm/tor-testing/fc/20/$basearch/
1087 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
1090 name=Tor experimental source repo
1093 baseurl=http://deb.torproject.org/torproject.org/rpm/tor-testing/fc/20/SRPMS
1095 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
1098 # to be secure, take a look at the fingerprint reported from the following install, and see if it matches from the link above:
1099 # 3B9E EEB9 7B1E 827B CF0A 0D96 8AF5 653C 5AC0 01F1
1101 /a
/bin
/buildscripts
/tor-browser
1104 tu
/etc
/apt
/sources.list
"deb http://deb.torproject.org/torproject.org $(debian-codename) main"
1105 gpg
--keyserver keys.gnupg.net
--recv 886DDD89
1106 gpg
--export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add
-
1108 pi deb.torproject.org-keyring
1110 /a
/bin
/buildscripts
/tor-browser
1114 /a
/bin
/buildscripts
/tor-browser
1117 pi tor tor-browser-en
1127 fedora todo: disable the firewall or find a way to automate it.
1128 there's an unused section in t.org for tramikssion firewall setup
1130 fedora manual config for nfs:
1132 change to permanent configuration
1133 check the box for nfs
1134 was hard to figure this out, not sure if this is all needed, but
1136 mountd: udp/tcp 20048
1137 portmapper, in firewall-config its called rpc-bind: udp/tcp 111
1138 troubleshooting, unblock things in rpcinfo -p
1139 make sure to reload the firewall to load the persistent configuration
1150 pi nfs-utils || pending_reboot
=true
1152 # this failed until I rebooted
1157 if [[ $HOSTNAME == treetowl
]]; then
1158 # nohide = export filesystems mounted deeper than the export point
1159 # fsid=0 makes this export the "root" export
1160 # not documented in the man page, but this means
1161 # 1. it can be mounted with a shorthand of server:/
1162 # 2. exports that are subdirectories of this one will automatically be mounted
1163 tu
/etc
/exports
<<'EOF'
1164 /k 192.168.1.0/24(rw,fsid=0,nohide,no_root_squash,async,no_subtree_check,insecure)
1173 # persistent virtual machines
1181 # distro may not know about win 10 yet.
1183 if ! virt-install
--os-variant list
&>/dev
/null
; then # we are using a newer virt-install
1184 for v
in 10 8.1 8; do
1185 if osinfo-query os | gr
"^\s*win${v/./\\.}\s" &>/dev
/null
; then
1192 if ! s virsh list
--all --name |
grep -xF win10
&>/dev
/null
; then
1194 # created account with
1195 # win10vmian@outlook.com, and easy to remember password
1196 # win 10 virtio, makes disk way way way faster
1197 # wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso
1198 # https://wiki.archlinux.org/index.php/QEMU#Change_Existing_Windows_VM_to_use_virtio
1199 # for installing virtio after initial install instead of with initial iso:
1200 # qemu-img create -f qcow2 fake.qcow2 1G
1201 # --disk=/a/images/virtio-win.iso,device=cdrom \
1202 # --disk=/a/images/fake.qcow2,bus=virtio
1204 # went to device manager, saw 2 pci devices with yellow !,
1205 # did search for drivers, pick cdrom location, done.
1207 # from http://www.tenforums.com/tutorials/4189-fast-startup-turn-off-windows-10-a.html.
1208 # google said there was a control panel option for it, but
1209 # that turned out to be a lie.
1210 # Put this in a .bat file and run as administrator to turn off
1211 # hyberboot which fucks things up.
1212 # REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_dWORD /D 0 /F
1213 # power settings, turn off display: never
1214 # run "control userpasswords2", turn on automatic login.
1215 # note: when changing devices, I just undefine, the create the vm again.
1217 if [[ -e /a
/images
/win10.qcow2
]]; then
1218 s virt-install
--noautoconsole --graphics spice
,listen
=0.0.0.0 \
1219 --disk=/a
/images
/win10.qcow2
,bus
=virtio
--vcpus 2 -r 4096 -w bridge
=br0 \
1220 -n win10
--import --os-variant $variant --cpu host-model-only
1222 s virsh destroy win10
1225 if [[ -e /a
/images
/win7.qcow2
]]; then
1226 # this one hasn\'t had the virtio fix done yet.
1227 s virt-install
--noautoconsole --graphics spice
,listen
=0.0.0.0 \
1228 --disk=/a
/images
/win7.qcow2
--vcpus 2 -r 4096 -w bridge
=br0 \
1229 -n win7
--import --os-variant win7
--cpu host-model-only
1230 s virsh destroy win7
1231 # had a problem with --cpu host, so trying out
1232 # --cpu host-model-only
1237 if [[ $HOSTNAME == treetowl
]]; then
1239 # note samba re-reads it\'s config every 1 minute
1241 arch
) s
cp /etc
/samba
/smb.conf.default
/etc
/samba
/smb.conf
;;
1244 # add 2 lines after workgroup option
1245 s
sed -ri --follow-symlinks '/^\s*encrypt passwords\s*=/d' /etc
/samba
/smb.conf
1246 s
sed -ri --follow-symlinks '/^\s*map to guest\s*=/d' /etc
/samba
/smb.conf
1247 s
sed -i --follow-symlinks 's/\(\s*workgroup\s*=\).*/\1 WORKGROUP\n\tencrypt passwords = yes\n\tmap to guest = bad password/' /etc
/samba
/smb.conf
1248 # remove default homes section. not sharing that.
1249 s
sed -ri --follow-symlinks '/^\s*\[homes\]/,/\s*\[/d' /etc
/samba
/smb.conf
1251 if ! grep -xF '[public]' /etc
/samba
/smb.conf
&>/dev
/null
; then
1252 s
tee -a /etc
/samba
/smb.conf
<<'EOF'
1262 # systemd claims it generates units from /etc/init.d, but it
1263 # clearly doesn\'t in debian. I have no idea how they are
1264 # related. fuck debian right now. It\'s not documented. samba
1265 # has a systemd init file linked to /dev/null. There\'s this
1266 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769714 which
1267 # claims samba\'s sub-services will be started automatically by
1268 # systemd... it didn\'t on install, wonder if it will on
1269 # boot. It clued me in how to start it manually though. Nothing
1270 # in /usr/share/doc/samba, debian admin guide says nothing about
1271 # any of this. (this is in debian testing as of 4/2016).
1273 s
/etc
/init.d
/samba start
1281 tu
/etc
/hosts
<<< "127.0.1.1 $(hostname).lan $(hostname)"
1284 ######### begin stuff belonging at the end ##########
1287 # Apps we want to override others for default file handler:
1288 # simplest way in debian is to just install them last.
1301 pi
"${simple_packages[@]}"
1304 if $pending_reboot; then
1305 echo "$0: pending reboot and then finished. doing it now."
1308 echo "$0: $(date): ending now)"