]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Merge branch 'os'
authorSimon Ruderich <simon@ruderich.org>
Sat, 2 Jun 2018 11:40:59 +0000 (13:40 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 2 Jun 2018 11:40:59 +0000 (13:40 +0200)
os/.gitignore [new file with mode: 0644]
os/Makefile [new file with mode: 0644]
os/darwin/environment.plist [new file with mode: 0644]
os/debian/aptitude/config.in [new file with mode: 0644]
os/debian/bin/backup.sh [new file with mode: 0755]
os/debian/bin/init-reprepro.sh [new file with mode: 0755]
os/debian/reportbugrc [new file with mode: 0644]
os/nocreeps.pub [new file with mode: 0644]
os/setup.sh [new file with mode: 0755]

diff --git a/os/.gitignore b/os/.gitignore
new file mode 100644 (file)
index 0000000..d19959a
--- /dev/null
@@ -0,0 +1,4 @@
+# Ignore files created by setup.sh.
+/debian/aptitude/config
+# Ignore temporary files.
+/debian/aptitude/cache
diff --git a/os/Makefile b/os/Makefile
new file mode 100644 (file)
index 0000000..23d5991
--- /dev/null
@@ -0,0 +1,4 @@
+all:
+       @./setup.sh
+
+.PHONY: all
diff --git a/os/darwin/environment.plist b/os/darwin/environment.plist
new file mode 100644 (file)
index 0000000..6c87ec5
--- /dev/null
@@ -0,0 +1 @@
+{ PATH = "/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"; }
diff --git a/os/debian/aptitude/config.in b/os/debian/aptitude/config.in
new file mode 100644 (file)
index 0000000..2030dfb
--- /dev/null
@@ -0,0 +1,50 @@
+// Aptitude configuration file.
+
+// Copyright (C) 2009-2013  Simon Ruderich
+//
+// This file is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This file is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+aptitude {
+    UI {
+        // Only display menubar when it's active.
+        Menubar-Autohide "true";
+        // Don't display often used commands as help, I know them.
+        HelpBar "false";
+
+        // Use normal grouping with origin (~O) package as new top level.
+        // Thanks to hark in #debian on Freenode (2009-04-02 19:14) and
+        // http://noone.org/blog/English/Computer/Debian/Group%20by%20origin%20in%20aptitude.futile
+        // the site he pointed me to.
+        //Default-Grouping "task,status,pattern(~O, !~O => other),section(subdirs,passthrough),section(topdir)";
+        // Same as Default-Grouping but only display packages which are
+        // changed (so no upgradeable are shown).
+        //Default-Preview-Grouping "pattern(~O),action,section(topdir),filter(~ainstall | ~aupgrade | ~adowngrade | ~aremove | ~apurge | ~ahold)";
+
+        // Pause before installing any packages.
+        Pause-After-Download "Yes";
+    }
+
+    // Don't display a warning when performing changes (add new packages,
+    // etc.) in read only mode.
+    Suppress-Read-Only-Warning "true";
+}
+
+Apt {
+    // Don't install recommended packages by default. The most annoying
+    // aptitude default!
+    Install-Recommends "false";
+}
+
+// vim: ft=cfg
diff --git a/os/debian/bin/backup.sh b/os/debian/bin/backup.sh
new file mode 100755 (executable)
index 0000000..4b9bffa
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Backup all important system-relevant data of a Debian system.
+#
+# The list of installed packages can be extracted from /var/lib/dpkg/status.
+
+# Copyright (C) 2013  Simon Ruderich
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -eu
+
+# tar can't exclude it automatically because we pipe it through gpg.
+target="`pwd`/`hostname`.tar.gpg"
+
+tar cf - \
+    --exclude /root/apt \
+    --exclude /var/cache \
+    --exclude /var/www \
+    --exclude "$target" \
+    --exclude "$target.tmp" \
+    /etc /root /var \
+    | gpg --encrypt --sign --recipient 0x95AC608FB0863F79 \
+    >"$target.tmp"
+mv "$target.tmp" "$target"
diff --git a/os/debian/bin/init-reprepro.sh b/os/debian/bin/init-reprepro.sh
new file mode 100755 (executable)
index 0000000..4014dc4
--- /dev/null
@@ -0,0 +1,90 @@
+# Setup a reprepro repository in /root/apt and add it to
+# /etc/apt/sources.list.
+
+# Copyright (C) 2013  Simon Ruderich
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -eu
+
+sources=/etc/apt/sources.list
+repo=/root/apt
+
+# Don't look for exact "file://$repo" match to allow modifications on the
+# system.
+if grep -E '^deb file:///' "$sources" >/dev/null 2>&1; then
+    echo "file:/// already present in '$sources'!" >&2
+    exit 1
+fi
+
+# Create signing key for the repository if necessary.
+email="apt@`hostname`"
+if ! gpg --list-keys "$email" >/dev/null 2>&1; then
+    # See doc/DETAILS in the gpg source tree for documentation.
+    gpg --gen-key --batch <<EOF
+%echo generating signing key $email for APT, this may take a while ...
+Key-Type: RSA
+Key-Length: 4096
+# "cert" is automatically used for primary key.
+Key-Usage: sign
+Subkey-Type: RSA
+Subkey-Length: 4096
+Subkey-Usage: encrypt
+Name-Real: Apt signing key
+Name-Email: $email
+Preferences: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 BZIP2 ZLIB ZIP Uncompressed
+%commit
+EOF
+fi
+
+keyid=`gpg --list-keys --with-colons --fixed-list-mode "$email" \
+       | grep -E '^pub:' \
+       | tail -n1 \
+       | awk -F: '{ print $5 }'`
+# Copied from simon-config and modified (uses "$sources"), keep in sync.
+codename=`lsb_release -s -c 2>/dev/null \
+          || grep -E '^deb' "$sources" | head -n1 | awk '{ print $3 }'`
+
+# Create reprepro repository.
+if test ! -d "$repo"; then
+    echo "creating reprepro repository in '$repo'" >&2
+    mkdir -p "$repo/conf"
+    mkdir -p "$repo/morgue"
+
+    arch="`dpkg --print-architecture` `dpkg --print-foreign-architectures`"
+    cat >"$repo/conf/distributions" <<EOF
+Codename: $codename
+Components: main
+Architectures: $arch source
+SignWith: $keyid
+EOF
+        cat >"$repo/conf/options" <<EOF
+morguedir ./morgue
+EOF
+
+    # Initialize repository and check configuration files. Ignore errors if
+    # reprepro is not installed, it's not necessary for a correct
+    # installation.
+    echo 'Initializing repository, errors are ignored.' >&2
+    ( cd "$repo" && reprepro export ) || true
+
+    # Does nothing if the same key is imported multiple times.
+    echo 'Adding key with apt-key.' >&2
+    gpg --export "$keyid" | apt-key add -
+fi
+
+echo "deb file://$repo $codename main" >>"$sources"
+
+echo 'Finished successfully'. >&2
diff --git a/os/debian/reportbugrc b/os/debian/reportbugrc
new file mode 100644 (file)
index 0000000..e5d3ef1
--- /dev/null
@@ -0,0 +1,51 @@
+# reportbug preferences file.
+
+# Copyright (C) 2009-2014  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# character encoding: UTF-8
+# Version of reportbug this preferences file was written by
+reportbug_version "6.5.0"
+
+# Use advanced operating mode which asks more questions than the default
+# (novice).
+mode advanced
+
+# Use text interface, simple and powerful.
+ui text
+
+# Use `debsums` to verify the integrity of the package before reporting a bug.
+verify
+
+# Name and email settings.
+realname "Simon Ruderich"
+email "simon@ruderich.org"
+
+# Use Debian's SMTP server.
+smtphost reportbug.debian.org
+# Encrypt connection to SMTP server.
+smtptls
+
+# Sign bug reports using GnuPG. Ignored when a MUA (like mutt) is used.
+sign gpg
+
+# Display complete mail before sending it. Not used with mutt.
+paranoid
+
+# Use mutt as MUA to send the mails.
+mutt
+# And use mutt to read mboxes.
+mbox_reader_cmd "mutt -f %s"
diff --git a/os/nocreeps.pub b/os/nocreeps.pub
new file mode 100644 (file)
index 0000000..1a31e9b
--- /dev/null
@@ -0,0 +1,52 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.14 (GNU/Linux)
+
+mQINBE8LTUsBEACl2SCqlpAreByr6SwcrDlfCLLUdg/Rb/NoBf+q+5L1CHRQNhg0
+8anYiGE2EWnkTkPINJbtbrlhTBR1g3xmMqcOGNffUWgBAlN9OLg/aZRamOYXMf10
+swKrjcdsc4dh0i+1uUK//IIkP5JZg8Ay5825pWBBG3WMSDB5/Ax88DmasMz+y3ba
+BhBfpI8k9/RO3RG4oEEb/iGAOeJmLVdch2WB5uAICTnkLcDbDHj7pybw56dNWwc5
+Z0glMKMoav9bkK6Ut/SH4I+G3N7voNWIgQoOYGk4H/qv3DeZtafxH0f+DXq2yGQC
+WijUpZznIi9PicK+9sioMYmbjtwZ2OmivUyENknWUu/swDQsX3soj2VmGsB30Eso
+TTisj+M3xejLQAY+5ZchZpNeFxhhwZIfG7G1aHyDsIcU14INetUtGdt8263zIPIs
+fQwprAs5YrI2lX2fmQmnmD5rlq2EggjWqHjBX6FjIG/8AYkpTspuW+L6Ctvt7DdN
+S5JtpdfLiQlljBEvo4bU1UP9zZLR5THDMQzIBy49PkPp5oeO/xsmKleSqNYvyGDh
+cFk4PwEufe3DtJsk9yvcMlEBIpC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4lSSFATTKy/3Qt4la+B1qrNRlFvmo1rK25gNsrkjeMnjdo5
+F1+tz/7gpE0mj/h7T85oPnP5Pbm4939WW5YQ2bRoL5AMtJTvBqQPrSXdazUlZd0s
+f7GyOvvyrHX51ij0S+vzMY1VtlW2ch0YprR3tgPmpnj+eidpQbZpcoXfbOK5Ub9J
+b6JNPKIXmZUIVWaQXU19cLVbBM8QLCrWJ1oAymgnsFb4N9ELFnj8RJTlEtPnxTeR
+LlQ=
+=6ozN
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/os/setup.sh b/os/setup.sh
new file mode 100755 (executable)
index 0000000..dc3a341
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Setup script for OS related configuration files.
+
+# Copyright (C) 2009-2013  Simon Ruderich
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -eu
+
+. ../lib.sh
+
+
+if test x"`os`" = xdarwin; then
+    # Sets a custom PATH for GUI applications.
+    mkdir -p ~/.MacOSX
+    link darwin/environment.plist ~/.MacOSX/environment.plist
+fi
+if test x"`os`" = xdebian; then
+    # Necessary as aptitude rewrites the config file on every start.
+    generate debian/aptitude/config .in cat
+    # aptitude/config uses // as comment instead of #.
+    sed_i 's|^#|//|' debian/aptitude/config
+
+    link debian/aptitude ~/.aptitude
+    if installed reportbug; then
+        link debian/reportbugrc ~/.reportbugrc
+    fi
+fi