small fixes, add maru script
authorIan Kelling <ian@iankelling.org>
Sun, 9 Apr 2017 06:52:01 +0000 (23:52 -0700)
committerIan Kelling <ian@iankelling.org>
Sun, 9 Apr 2017 06:52:01 +0000 (23:52 -0700)
distro-begin
maru-init [new file with mode: 0644]
radicale-setup
rootsshsync

index aa19cfabc8189dea6d685da71e146d012043648e..78c92eb74eaf15b4c57a8baa7ec078a5631de893 100755 (executable)
@@ -186,20 +186,8 @@ if [[ $EUID == 0 ]]; then
 fi
 
 
-#### begin link bashrc repo for all users ######
-for x in /a/c/repos/bash/!(.git|..|.); do
-    lnf "$x" /home/ian
-    sudo -u traci -i <<EOF
-PATH="/a/exe:$PATH"
-lnf "$x" /home/traci
-EOF
-    sudo -i <<EOF
-PATH="/a/exe:$PATH"
-lnf $x /root
-EOF
-done
-#### end link bashrc repo for all users ######
-
+# this needs to be before installing pacserve so we have gpg conf.
+conflink
 
 set +x
 errallow
@@ -219,9 +207,6 @@ EOF
 isfedora && tu /etc/sysctl.conf 'kernel.sysrq = 1'
 
 
-# this needs to be before installing pacserve so we have gpg conf.
-conflink
-
 if isdebian; then
     codename=$(debian-codename)
     if isdebian-stable && has_x; then
diff --git a/maru-init b/maru-init
new file mode 100644 (file)
index 0000000..92f179b
--- /dev/null
+++ b/maru-init
@@ -0,0 +1,57 @@
+#!/bin/bash
+# Copyright (C) 2017 Ian Kelling
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+
+usage() {
+    cat <<EOF
+Usage: ${0##*/}
+Initial setup for maru debian for nexus 5.
+
+We do this separately because it's constrained for space much more than
+any other host. The maru debian takes up about 1.5G. We start with about
+6.8G free. We want to keep a few gigs free to take pictures and
+movies. I should really trade this in for a 32GB version.
+
+-h|--help  Print help and exit.
+EOF
+    exit $1
+}
+
+case $1 in
+    *) usage ;;
+esac
+
+
+scp $(readlink -f $(which rootsshsync)) maru-init maru@n5:
+ssh maru@n5 ./rootsshsync
+
+ssh root@n5 bash <<'EOF'
+echo "ian  ALL=(ALL)  NOPASSWD: ALL" >>/etc/sudoers
+echo n5 >/etc/hostname
+hostname -F /etc/hostname
+sed -i '/^127\.0\.1\.1/d' /etc/hosts
+echo "127.0.1.1 n5.lan n5" >>/etc/hosts
+
+kill $(pgrep -U ian)
+usermod -l ian -m -d /home/ian maru
+groupmod -n ian maru
+useradd -m -s /bin/bash traci
+EOF
+
+# then do myunison n5,
+# then do conflink.
index 631bf427fc691b1a15e5041e8e1491ced254bc94..b885f36ef05074a7bdeaa9ad6aefeb324ba92942 100755 (executable)
@@ -41,7 +41,8 @@ setini hosts 10.8.0.4:5232 server
 sgo radicale
 
 # davdroid from f-droid. username ian,
-# url https://iank.pw/radicale/ian.
+# url https://cal.iankelling.org
+# username ian
 # I disabled power management feature, it's got 240 min sync interval,
 # so it shouldn't be bad.
 #
index e962f19295b9b1918b70cd8f3ed48f788939fbef..9d9140af8ac75e39d4c1f599ddb2e8ca2c139fa6 100755 (executable)
@@ -28,5 +28,5 @@ else
 fi
 # -t times, so it won't rewrite the file every time,
 # -L resolve links
-rsync -rtL $(eval echo ~${SUDO_USER:-$USER})/.ssh $dest
+rsync -rtL $(eval echo ~${SUDO_USER:-$USER})/.ssh/ $dest
 chown -R root:root /root/.ssh