2 # Copyright (C) 2016 Ian Kelling
3 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
5 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
11 IFS
= read -r -d '' y ||
:
54 # things with no equivalent in other distros:
57 # for gui bug reporting
61 # for debconf-get-selections
67 ####### misc packages ###########
77 arch
) pi the_silver_searcher
;;
78 debian|ubuntu
) pi silversearcher-ag
;;
85 pi cups ghostscript gsfonts
# from arch wiki cups page
86 pi hplip
# from google
87 s gpasswd
-a $USER sys
# from arch wiki
88 sgo org.cups.cupsd.service
89 # goto http://127.0.0.1:631
90 # administration tab, add new printer button.
91 # In debian, I could use hte recommended driver,
92 # in arch, I had to pick out the 6L driver.
97 # other distros unknown
102 ubuntu|debian
) pi ack-grep
;;
103 arch|fedora
) pi ack
;;
107 ubuntu|debian
) pi
--no-install-recommends mairix notmuch
;;
108 fedora|arch
) pi mairix notmuch
;;
111 arch
) pi nfs-utils
;;
112 ubuntu|debian
) pi nfs-client
;;
115 ubuntu|debian
) pi par2
;;
116 arch|fedora
) pi par2cmdline
;;
119 # needed for my tex resume
121 ubuntu|debian
) pi texlive-full
;;
122 arch
) pi texlive-most
;;
128 # flash, unrar, codecs, ms fonts.
129 # This has a manual prompt.
130 pi ubuntu-restricted-extras
134 # rpm fusion recommended codecs
135 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"
136 pi gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg\
137 xine-lib-extras-freeworld
142 # optional dep for firefox for h.264 video
143 arch
) pi gst-libav
;;
144 # other distros, probably come by default
148 fedora|ubuntu|debian
) pi gnupg-agent
;;
154 fedora|ubuntu|debian
) pi transmission
;;
155 arch
) pi transmission-gtk
;;
160 fedora
) pi pinentry-gtk
;;
161 *) : ;; # comes default or with other packages
165 arch
) pi firefox pulseaudio
;;
166 *) : ;; # comes default or with other packages
178 arch
) pi ttf-dejavu
;;
179 debian|ubuntu
) pi fonts-dejavu
;;
184 arch|debian|ubuntu
) pi ntp
;;
190 debian|ubuntu
) pi x11-utils
;;
195 arch
) pi virt-install
;;
196 debian|ubuntu
) pi virtinst
;;
202 debian|ubuntu
) pi genisoimage
;;
207 arch
) pi spice-gtk3
;;
208 debian|ubuntu
) pi spice-client-gtk
;;
212 # general known for debian/ubuntu, not for fedora
215 # cdrkit for cloud-init isos
216 # dnsmasq for nat networking in libvirt
217 # qemu for qemu-img, bind-tools for dig
218 pi
unzip wget xorg-xmodmap \
219 bridge-utils dnsmasq qemu bind-tools
221 # otherwise we get error about accessing kvm module.
222 # seems like there might be a better way, but google was a bit vague.
223 s
sed -ri '/^ *user *=/d' /etc
/libvirt
/qemu.conf
224 echo 'user = "root"' | s
tee -a /etc
/libvirt
/qemu.conf
225 # https://bbs.archlinux.org/viewtopic.php?id=206206
226 # # this should prolly go in the wiki
238 arch
) pi virtviewer
;;
239 *) : ;; # other distros have it as a dependency afaik.
246 # ubuntu 14.04 uses b-cron,
247 # but it's not maintained in arch.
248 # of the ones in the main repos, cronie is only one maintained.
249 # fcron appears abandoned software.
253 *) : ;; # other distros come with cron.
258 fedora
) cabal
install shellcheck
;;
260 # unknown for older ubuntu
265 arch|debian|ubuntu
) pi pumpa
;;
266 # others unknown. do have a buildscript:
267 # /a/bin/buildscripts/pumpa ;;
272 debian|ubuntu
) pi android-tools-adb
;;
273 arch
) pi android-tools
;;
274 # other distros unknown
284 # proprietary flash. going without for now
287 # pi flashplugin-nonfree
300 wget http
://tamacom.com
/global
/global-6.3
.2.
tar.gz
303 # based on https://github.com/leoliu/ggtags
304 .
/configure
--with-exuberant-ctags=/usr
/bin
/ctags
307 s pip
install pygments
321 # leave this for last so it doesn't do a bunch of other apps
322 # which I want explicitly installed in case I switch DE's
325 pi task-cinnamon-desktop
326 # in settings, change scrolling to two-finger,
327 # because the default edge scroll doesn\'t work.
332 ######### end misc packages #########
335 # packages I once used before and liked, but don't want installed now for
337 # python-sqlite is used for offlineimap
338 # lxappearance python-sqlite dolphin paman dconf-editor
344 # todo, finish configuring smart.
345 # mostly from https://wiki.archlinux.org/index.php/S.M.A.R.T.
346 # turn on smart. background on options:
347 # first line, -a = test everyting on all devices.
348 # -S on, turn on disk internal saving of vendor specific info,
349 # from google, seems like this is usually already on and fairly standard.
350 # -o on, turn on 4 hour period non-performance degrading testing.
351 # short test daily 2-3am, extended tests Saturdays between 3-4am:
352 sched
="-s (S/../.././02|L/../../6/03)"
353 s
sed -i "s#^[[:space:]]*DEVICESCAN.*#\
354 DEVICESCAN -a -o on -S on -n standby,q $sched\
355 -m ian@iankelling.org -M exec /usr/local/bin/smart-notify#" /etc
/smartd.conf
357 # in the default configuration of at least ubuntu 14.04, resolvconf is
358 # configured to order any nameservers associated with tun* or tap*
359 # before the normal internet interfaces, which means they are always
360 # consulted first. This is often slower and undesirable, ie. local dns
361 # queries go from 0ms to 10+ or 100+ ms. To reverse the ordering, you
363 #sudo sed -i '/tun\*\|tap\*/d' /etc/resolvconf/interface-order
364 # however, this breaks dns lookup for hosts on the openvpn lan.
365 # I can\'t figure out why hosts on the normal lan would not be
366 # broken under the default ordering, except the host I was
367 # testing with previously had an entry in /etc/hosts.
369 ############# end unfinished
373 # default is alsa, doesn\'t work with with pianobar
374 s
dd of
=/etc
/libao.conf
<<'EOF'
382 arch|debian|ubuntu
) pi btrbk
;;
386 if [[ $HOSTNAME == treetowl
]]; then
394 case $
(distro-name
) in
396 # allows me to pipe with ssh -t, and gets rid of spam
397 # http://forums.debian.net/viewtopic.php?f=5&t=85822
398 # i'd rather disable the service than comment the init file
399 # this says disabling the service, it will still get restarted
400 # but this script doesn't do anything on restart, so it should be fine
401 s
dd of
=/var
/run
/motd.dynamic
if=/dev
/null
402 s update-rc.d motd disable
405 # this isn't a complete solution. It still shows me when updates are available,
406 # but it's no big deal.
407 s t
/etc
/update-motd.d
/10-help-text /etc
/update-motd.d
/00-header
413 # https://debian-handbook.info/browse/stable/sect.regular-upgrades.html
414 # /etc/cron.daily/apt calls unattended-upgrades
415 # /usr/share/doc/unattended-upgrades# cat README.md
416 # /etc/apt/apt.conf.d/50unattended-upgrades
418 pi unattended-upgrades
419 s
dd of
=/etc
/apt
/apt.conf.d
/10periodic
<<'EOF'
420 # this file was mostly just comments.
421 APT::Periodic::Update-Package-Lists "1";
422 APT::Periodic::Download-Upgradeable-Packages "1";
423 APT::Periodic::AutocleanInterval "7";
424 APT::Periodic::Unattended-Upgrade "1";
427 Unattended-Upgrade::Mail "root";
428 Unattended-Upgrade::MailOnlyOnError "true";
429 Unattended-Upgrade::Remove-Unused-Dependencies "true";
430 Unattended-Upgrade::Origins-Pattern {
431 # default is just upgrade main and security, not updates.
433 if isdebian-testing
; then
435 # for stable, only do security updates.
436 "origin=Debian,codename=${distro_codename},label=Debian-Security";
439 # These are stable packages only getting bugfixes anyways.
446 } | s
dd of
=/etc
/apt
/apt.conf.d
/50unattended
-upgrades
452 ######### begin postfix ########
453 # based on,http://www.postfix.org/qmgr.8.html and my notes in gnus
454 # originally tried moving specific directories under /var/spool/postfix,
455 # but postfix didn't like that
456 if [[ ! -L /var
/spool
/postfix
]]; then
458 if [[ -e /q
/postfix
]]; then
459 echo "$0: error: /q/postfix exists but not the link to it"
461 s
mv /var
/spool
/postfix
/q
462 s lnf
/q
/postfix
/var
/spool
468 # This also works instead of ~/.forward
469 # s sed -i '/^root/d' /etc/aliases ||:
470 #echo "root: $HOSTNAME@bog.mm.st" | s tee -a /etc/aliases
471 # this can't be a symlink and has permission restrictions
472 # it might work in /etc/aliases, but this seems more proper.
474 if s
grep amazonaws
/etc
/postfix
/sasl_passwd
&>/dev
/null
; then
475 forward
=x@sallymae.club
477 forward
=$HOSTNAME@bog.mm.st
479 e
$forward > ~
/.forward
480 e
$forward | s
tee /root
/.forward
483 # if I wanted the from address to be renamed and sent to a different address,
484 # echo "sdx@localhost development@localhost" | sudo dd of=/etc/postfix/recipient_canonical
485 # sudo postmap hash:/etc/postfix/recipient_canonical
486 # sudo service postfix reload
489 # i'm assuming mail just won't work on systems without the sasl_passwd.
491 smtp_sasl_auth_enable = yes
492 smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
493 smtp_sasl_security_options = noanonymous
494 smtp_tls_security_level = secure
495 message_size_limit = 20480000
496 smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
498 # ^ I ran into a log file not sending cuz of size. double from 10 to 20 meg limit
500 s postmap
hash:/etc
/postfix
/sasl_passwd
501 # offlineimap uses this too, it is much easier to use one location than to
502 # condition it's config and postfix's config
504 fedora
) s lnf
-T ca-certificates.crt
/etc
/ssl
/ca-bundle.trust.crt
;;
508 s service postfix reload
511 ############ end postfix #######
515 debian|ubuntu
) s gpasswd
-a ian adm
;; #needed for reading logs
521 # https://www.torproject.org/docs/rpms.html.en
522 # https://www.torproject.org/docs/debian.html.en
523 # todo: figure out if the running service needs to be restarted upon updates
526 # todo on fedora: setup non-dev packages
528 s
dd of
=/etc
/yum.repos.d
/torproject.repo
<<'EOF'
530 name=Tor experimental repo
532 baseurl=http://deb.torproject.org/torproject.org/rpm/tor-testing/fc/20/$basearch/
534 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
537 name=Tor experimental source repo
540 baseurl=http://deb.torproject.org/torproject.org/rpm/tor-testing/fc/20/SRPMS
542 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
545 # to be secure, take a look at the fingerprint reported from the following install, and see if it matches from the link above:
546 # 3B9E EEB9 7B1E 827B CF0A 0D96 8AF5 653C 5AC0 01F1
548 /a
/bin
/buildscripts
/tor-browser
551 tu
/etc
/apt
/sources.list
"deb http://deb.torproject.org/torproject.org $(debian-codename) main"
552 gpg
--keyserver keys.gnupg.net
--recv 886DDD89
553 gpg
--export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add
-
555 pi deb.torproject.org-keyring
557 /a
/bin
/buildscripts
/tor-browser
561 /a
/bin
/buildscripts
/tor-browser
564 pi tor tor-browser-en
574 fedora todo: disable the firewall or find a way to automate it.
575 there's an unused section in t.org for tramikssion firewall setup
577 fedora manual config for nfs:
579 change to permanent configuration
580 check the box for nfs
581 was hard to figure this out, not sure if this is all needed, but
583 mountd: udp/tcp 20048
584 portmapper, in firewall-config its called rpc-bind: udp/tcp 111
585 troubleshooting, unblock things in rpcinfo -p
586 make sure to reload the firewall to load the persistent configuration
603 if [[ -e /i
/video
]]; then
604 # nohide = export filesystems mounted deeper than the export point
605 # fsid=0 makes this export the "root" export
606 # not documented in the man page, but this means
607 # 1. it can be mounted with a shorthand of server:/
608 # 2. exports that are subdirectories of this one will automatically be mounted
609 tu
/etc
/exports
'/i/video 192.168.1.0/24(rw,fsid=0,nohide,no_root_squash,async,no_subtree_check,insecure)'
611 showmount
-e localhost
616 f
=/a
/bin
/$HOSTNAME-crontab