# for bootstrapping a new machine
# to make ssh run better, first run this:
-sudo bash -c 'source /a/c/repos/bash/.bashrc && source /a/bin/ssh-emacs-setup'
+sudo bash -c 'source /a/c/repos/bash/.bashrc && source /a/exe/ssh-emacs-setup'
# see t.org for OS installer notes
export HOSTNAME=$1
fi
-for f in iank-dev htpc treetowl x2 frodo tp lj lk; do
+for f in iank-dev htpc treetowl x2 frodo tp li lj; do
eval "$f() { [[ $HOSTNAME == $f ]]; }"
done
-has_p() { iank-dev || x2 || frodo; }
-has_x() { ! lj && ! lk; }
-encrypted() { has_p || tp; }
+has_p() { iank-dev || x2 || frodo || tp; }
+has_x() { ! { lj || li; }; }
+encrypted() { has_p; }
shopt -s extglob
export GLOBIGNORE=*/.:*/..
####### end command line parsing
+PATH="/a/exe:$PATH"
if encrypted; then
# I tried making a service which was dependent on reboot.target,
# but it happened too late in the shutdown process.
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
-ExecStop=/a/bin/keyscript-on
+ExecStop=/a/exe/keyscript-on
[Install]
WantedBy=keyscriptoff.service
[Service]
Type=oneshot
-ExecStart=/a/bin/keyscript-off
+ExecStart=/a/exe/keyscript-off
[Install]
WantedBy=multi-user.target
fi
-/a/bin/install-myqueue
+install-myqueue
if iank-dev; then
desktop=$(ssh root@iankelling.org grep desktop /etc/hosts | grep -o "^.* ")
# todo, it would be nice to cut down on some of the output
-for x in /a/bin/bash-programs-by-ian/repos/{errhandle,tee-unique,lnf}/*-function; do
- # output is below so shellcheck can verify sources
- echo "# shellcheck source=$x";
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/bash-trace-function
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errallow-function
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errcatch-function
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/errhandle/errexit-function
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/tee-unique/teeu-function
- # shellcheck source=/a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+for x in /a/bin/errhandle/*-function; do
source $x
done
sudo bash -c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-ian"
;;
*)
- sudo bash -c ". /a/bin/fai-wrapper &&
+ sudo bash -c ". /a/bin/fai/fai-wrapper &&
/a/bin/fai/fai/config/distro-install-common/end"
;;
esac
done
lnf ${opts[@]} "$1" /home/ian/$2
sudo -u traci -i <<EOF
-source /a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+PATH="/a/exe:$PATH"
lnf ${opts[@]} "$1" /home/traci/$2
EOF
}
for x in /a/c/repos/bash/!(.git); do
lnf-home "$x"
sudo -i <<EOF
-source /a/bin/bash-programs-by-ian/repos/lnf/lnf-function
+PATH="/a/exe:$PATH"
lnf $x /root
EOF
done
# todo: reconcile ~/.ssh/config work/home
s lnf -T /q/p /p
s lnf -T /a/bin /b
-/a/bin/conflink
+conflink
if has_p; then
lnf -T /p/offlineimap ~/Maildir
lnf -T /p/News ~/News
# don't use /* because I don't want to require it to be mounted
- s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
- /a/opt /a/c/.emacs.d /root
fi
-/a/bin/rootsshsync
+s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
+ /a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
+
+rootsshsync
s lnf /a/c/.inputrc /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
# work desktop doesnt need gpg stuff, but it doesnt hurt
s dd of=/etc/profile.d/environment.sh <<'EOF'
-# IAN: EDIT THIS FROM /a/bin/distro-begin
+# IAN: EDIT THIS FROM /a/bin/distro-setup/distro-begin
if [ -f $HOME/path_add-function ]; then
. $HOME/path_add-function
-/a/bin/postfix-setup
+postfix-setup
if isubuntu; then
# disable crash report annoying crap
#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+errcatch
set -x
pup
simple_packages=(
+ htop
mailutils
nmon
ruby
vim
)
-if [[ $HOSTNAME != lj && $HOSTNAME != lk ]]; then
- # universal packages
- simple_packages+=(
- apache2
- bwm-ng
- chromium
- duplicity
- evince
- fdupes
- filelight
- gdb
- gnome-screenshot
- jq
- locate
- meld
- offlineimap
- p7zip
- paprefs
- pavucontrol
- pdfgrep
- pianobar
- pidgin
- rdiff-backup
- slock
- squashfs-tools
- tcpdump
- transmission-remote-gtk
- vlc
- )
-fi
+case $HOSTNAME in
+ lj|li) : ;;
+ *)
+ # universal packages
+ # swh-plugins is for karaoke pulsaudio filter.
+ simple_packages+=(
+ apache2
+ bwm-ng
+ chromium
+ duplicity
+ evince
+ fdupes
+ filelight
+ gdb
+ gnome-screenshot
+ jq
+ locate
+ meld
+ offlineimap
+ p7zip
+ paprefs
+ pavucontrol
+ pdfgrep
+ pianobar
+ pidgin
+ rdiff-backup
+ slock
+ squashfs-tools
+ swh-plugins
+ tcpdump
+ transmission-remote-gtk
+ vlc
+ )
+ ;;
+esac
case $HOSTNAME in
- lj|lk)
+ lj|li)
pi "${simple_packages[@]}"
- $src/homepage-setup
- $src/
-
-# start=' *<source lang="bash"> *'
-# end=' *<\/source> *'
-# ruby <<'EOF' | sed -rn "/^$start$/,/^$end$/{s/^$start|$end$/# \0/;p}" | bash
-# require 'json'
-# puts JSON.parse(`curl 'https://ofswiki.org/w/api.php?\
-# action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\
-# format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*']
-# EOF
-# nginx-site iankelling.org
+ case $HOSTNAME in
+ lj) domain=iank.bid ;;
+ li) domain=iankelling.org ;;
+ esac
+ homepage-setup $domain
+ s rld /a/h/_site/ /var/www/$domain/html
+
+ curl https://$domain/git/?p=mediawiki-setup/.git;a=blob_plain;f=mw-setup-script;hb=HEAD | bash
+ $src/phab-setup
+
echo "$0: $(date): ending now)"
exit 0
;;
esac
-########### end section including lj ###############
+########### end section including li/lj ###############
case $distro in
esac
fi
+# dunno why it's there, but get rid of it
+case $HOSTNAME in
+ li|lj) s rm -rf /home/linode ;;
+esac
+
# arch had a default config,
# debian had nothing until you start it.
# With a little trial an error, here is a minimal config
# only settings I set were
# hostname
# auto-connect
-#
for f in /home/*; do
d=$f/.config/transmission-remote-gtk
u=${f##*/}
ser disable openvpn@client
ser disable openvpn
;;
- *) pi openvpn ;;
+ # suggests because we want the resolvconf package
+ *) pi --install-suggests openvpn;;
esac
pi wget
debian|ubuntu)
log=$(mktemp)
cd /a/opt
- wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- set +e
- s dpkg -i google-chrome-stable_current_amd64.deb &> $log
+ wget -nv -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+ errallow
+ s dpkg -i google-chrome-stable_current_amd64.deb |& tee $log
code=$?
- set -e
+ errcatch
case $code in
- 1)
+ 0) : ;;
+ *)
if grep '^dpkg: dependency problems prevent configuration of' \
$log &>/dev/null; then
s apt-get -fy install
exit 1
fi
;;
- 0) : ;;
- *) exit $code
esac
;;
arch)
# deal with mismatching unison compilers, but I dont
# see any reason to revert it, since it only installs
# a single package which is primarily a single binary
- pi unison-gtk/testing unison/testing
- ;;
- testing)
- piunison unison-gtk
;;
esac
+ pi unison/testing
+ pi unison-gtk/testing # after to make it the default unison
;;
arch)
pi unison gtk2
+++ /dev/null
-#!/bin/bash -l
-# Copyright (C) 2016 Ian Kelling
-# This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
-host=$1
-
-if [[ ! $host || $host == -h ]]; then
- echo "$0: error: expected 1 arg of hostname"
- exit 1
-fi
-
-set -x
-ssh $host sudo reboot ||:
-pxe-server fai $host
-while ! ssh $host :; do
- sleep 5
-done
-dsremote $host
# Copyright (C) 2016 Ian Kelling
# This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
-# lj is test server
-case $HOSTNAME in
- lj)
- domain=iankelling.org
- ;;
- lk)
- domain=iank.bid
- ;;
-esac
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+domain=$1
+
+if [[ ! $1 ]]; then
+ echo "$0: error: expected domain argument"
+ exit 1
+fi
+
+gitroot=/a/bin/githtml
+
+type -P a2enmod &>/dev/null || pi apache2
+
+acme-tiny-wrapper $domain
# debian has the package gitweb, which seems to mainly
# have some example apache config, and a minimal gitweb config.
# I'll just use the config as example and not use the package.
# It's example apache config seems to say we can use cgi or cgid,
# and googling cgid it seems a newer faster alternative.
-s a2enmod cgid
+sudo a2enmod cgid
+# so, highlight is not highlighting my
+pi highlight
+
+# additional settings from browsing https://git-scm.com/docs/gitweb.conf
s dd of=/etc/gitweb.conf <<EOF
-\$projectroot = "$gitroot";
+\$feature{'highlight'}{'default'} = [1];
+# highlighting doesn't work on files without extension.
+# I noticed in terminal "highlight file" won't do it (unknown file type)
+# hightlight < file will do it, and it's online documentation
+# suggests it reads shebang. Todo: file a bug for gitweb
+# to make highlight read shebangs.
+our \$projectroot = "$gitroot";
# not documented at https://git-scm.com/docs/gitweb.conf,
# but it's in the debian conf, so use it.
# directory to use for temp files.
\$git_temp = "/tmp";
+push @git_base_url_list, "https://$domain/git";
EOF
-git_root=/a/bin/githtml
-
-
apache-site - $domain <<EOF
# to run python script on my site:
<Directory /var/www/$domain/html>