-
Notifications
You must be signed in to change notification settings - Fork 0
/
.install
executable file
·104 lines (99 loc) · 5.31 KB
/
.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh -ex
# echo 'https://openbsd.mirror.netelligent.ca/pub/OpenBSD' > /etc/installurl
# pkg_add git
# git clone --bare https://github.com/renaudgermain/dotfiles.git .git
# git config core.bare false
# git reset --hard
case $(whoami):$(hostname) in
root:alpha)
pacman -Syu xorg-xrandr xorg-xdpyinfo mesa-demos alsa-utils git ratpoison \
mpv rxvt-unicode xorg-{xserver,xsetver,xsetroot,xset,xinit,xdm}
echo "TODO add rcog to groups audio, video"
echo "TODO replace grub by syslinux w/ autoselect"
echo "doc /home/rcog/doc 9p trans=virtio,version=9p2000.L 0 0" >> /etc/fstab
echo "media /home/rcog/media 9p trans=virtio,version=9p2000.L 0 0" >> /etc/fstab
mkdir /home/rcog/{doc,media}
systemctl enable dhcpcd
systemctl enable xdm.service
;;
rcog:alpha)
ln -s .xinitrc ~/.xsession
;;
root:delta)
apt-get install -y virt-viewer
;;
root:gulf)
# pkg_info -mz
pkg_add git rxvt-unicode--everything
pkg_add feh gnupg mutt--gpgme-sasl rclone
pkg_add ImageMagick abook aspell aspell-fr colorls docx2txt emacs--no_x11 eyeD3 firefox-esr jq mediainfo \
login_oath mpg321 mpv mupdf-- p5-Data-ICal rsync-- surfraw urlview-- inconsolata-font unzip-- w3m-- xdotool
pkg_add cabal-install ghc go iridium
echo '10.0.2.2 delta' >> /etc/hosts
echo 'permit nopass rcog cmd /bin/date' >> /etc/doas.conf
mkdir /home/rcog/{doc,media}
rcctl set sndiod flags -mplay
echo 'export PS1="\[[31m\][\u@\h \W]\\$ \[[0m\]"' >> /root/.profile
# https://dataswamp.org/~solene/2018-05-08-mfs-tmp.html
cat <<EOF >> /etc/fstab
swap /tmp mfs rw,nodev,noatime,async,nosuid,-s=128M 0 0
delta:/home/rcog/media /home/rcog/media nfs ro,nodev,nosuid,soft,intr,tcp 0 0
delta:/home/rcog/doc /home/rcog/doc nfs ro,nodev,nosuid,soft,intr,tcp 0 0
EOF
cat << EOF > /etc/X11/xenodm/Xresources
xlogin.Login.echoPasswd: true
xlogin.Login.fail: denied
xlogin.Login.greeting:
xlogin.Login.namePrompt: username\040
xlogin.Login.passwdPrompt: password\040
xlogin.Login.height: 180
xlogin.Login.width: 280
xlogin.Login.y: 320
xlogin.Login.frameWidth: 0
xlogin.Login.innerFramesWidth: 0
xlogin.Login.background: black
xlogin.Login.foreground: #eeeeee
xlogin.Login.failColor: white
xlogin.Login.inpColor: black
xlogin.Login.promptColor: #eeeeec
xlogin.Login.face: fixed-13
xlogin.Login.failFace: fixed-13
xlogin.Login.promptFace: fixed-13
EOF
echo "#!/bin/sh\n/usr/X11R6/bin/xsetroot -solid black\n/usr/X11R6/bin/xrandr --output default --mode 1440x900" > /etc/X11/xenodm/Xsetup_0
;;
rcog:gulf)
umask 077
ln -s .xinitrc .xsession
ssh-keygen
echo "TODO upload ~/.ssh/id_rsa.pub to github.com"
git remote set-url origin git@github.com:renaudgermain/dotfiles.git
echo 'github.com,192.30.253.113 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> $HOME/.ssh/known_hosts
echo 'delta,10.0.2.2 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFg1cZ+4lVzMNlAGNLarVDk3QNPpK90bh/W/aLPW9DrWdLfrXbwkyu/CXP3SxmxHRUnj+LjWCcGuS7w+0IOIcZY=' >> $HOME/.ssh/known_hosts
echo "TODO copy id_rsa.pub to delta:~/.ssh/authorized_keys"
rclone config # read/write from rclone subdir only
mkdir $HOME/.abook
rclone sync gdrive:rclone/addressbook .abook
crontab - <<EOF
0 0 * * * /usr/local/bin/rclone sync doc/RecettesCuisine.org gdrive:rclone
3 0 * * * /usr/local/bin/rclone sync .todo.org gdrive:rclone
6 0 * * * /usr/local/bin/rclone sync doc/notes.org gdrive:rclone
9 0 * * * /usr/local/bin/rclone sync .abook/addressbook gdrive:rclone
EOF
scp delta:~/.wallpaper.jpg .
export GPG_TTY=$(tty)
ssh -t delta gpg --armor --export-secret-keys 6E6BCDEEDEBCF123 | gpg --import # FIXME make ssh forward stderr, have gpg2 accept stdin
echo "trust\n5\ny\n" | gpg --command-fd 0 --edit-key 6E6BCDEEDEBCF123
echo 'default-key 6E6BCDEEDEBCF123' >> $HOME/.gnupg/gpg.conf
mkdir -p $HOME/.cache/mutt
read p?'mutt password:' # FIXME secure input
echo "set imap_pass=\"$p\"\nset smtp_pass=\"$p\"" | gpg --encrypt --recipient 6E6BCDEEDEBCF123 > ~/.cache/mutt/passwords.gpg
# might require restarting gpg-agent
echo "TODO browser.tabs.loadDivertedInBackground = true, uBlock origin, Tridactyl, Video Downloader professional"
# NOTE might need to click "See all versions" to get addons compatible w/ old Firefox
git clone https://github.com/chneukirchen/nq.git /tmp/nq
make -C /tmp/nq PREFIX=~/usr install
echo "TODO (from delta) ssh rcog@127.0.0.1 -p 7922 cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keys"
git clone ssh://delta:/home/rcog/src/euler/.git euler
;;
esac