add copyright headers, fix a few things
authorIan Kelling <ian@iankelling.org>
Fri, 9 Dec 2016 02:31:20 +0000 (18:31 -0800)
committerIan Kelling <ian@iankelling.org>
Fri, 9 Dec 2016 02:31:20 +0000 (18:31 -0800)
12 files changed:
btrbk-run
check-subvol-stale
desktop-20-autostart.sh
distro-begin
distro-end
input-setup
install-btrfs-sync-tools
mail-setup
mount-latest-remote
mount-latest-subvol
myoff [new file with mode: 0755]
ssh-emacs-setup

index 8cae3a79cb744f85edbd662fc192e7f6afdcaa85..c226997d1a147d2cb1b0f01f83d347ee4fd760c5 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -1,4 +1,17 @@
 #!/bin/bash
+# Copyright (C) 2016 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
index 7d36b461bcf269a67dbceeed6b2c420f06a403da..1451844f7c89298d2a9e100eeabba7f837874d24 100644 (file)
@@ -1,4 +1,20 @@
 #!/bin/bash
+# Copyright (C) 2016 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.
+
+
+# if latest subvols $@ are not mounted, exit 1, print message, and touch /nocow/btrfs-stale/$subvol
 
 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
 
index dd4d9a8e0918341277f4d596c15343d28ddd3e44..e1169609f1a3393f943a0c9656dc040ff096061f 100755 (executable)
@@ -1,4 +1,17 @@
 #!/bin/bash -l
+# Copyright (C) 2016 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.
 
 # first 2 alternatives showed under ubuntu 14.04, second 2 under arch at 11/2015
 
index edb36f49c5ef870667a640e3e0fc7c6ab5e2eb8a..a76549110ad0e77c62eb93e00a46c5a3ed50dbdc 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/bash -l
 # Copyright (C) 2016 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.
index dc97b0dd92834ef749801341d771c7c679ba206f..44be816d82fee63536c3a83adce2ad8bb5aa47a9 100755 (executable)
@@ -59,19 +59,29 @@ case $HOSTNAME in
         # universal packages
         # swh-plugins is for karaoke pulsaudio filter.
         # mutagen for pithos
+        # lib32stdc++6/default-jdk for android studio
+        # android site says it needs a bunch of packages for ubuntu,
+        # but I googled for debian, and someone says you just need one, plus the
+        # jdk
+        # https://pid7007blog.blogspot.com/2015/07/installing-android-studio-in-debian-8.html
+        # see w.org for more android studio details
+        #
         simple_packages+=(
             apache2
             bwm-ng
             chromium
+            default-jdk
             duplicity
             evince
             fdupes
             filelight
             gdb
+            gitk
             goaccess
             gnome-screenshot
             jq
             locate
+            lib32stdc++6
             manpages
             meld
             nmap
index 66a4b7ffd26d5ecf395bdd373c0b6fda8e2ea750..8ad80d315e9a1d73742078d87406b11ea4f2e99f 100755 (executable)
@@ -1,4 +1,18 @@
 #!/bin/bash -l
+# Copyright (C) 2016 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 -x
 mi() {
     xinput --get-feedbacks "$1" | grep "threshold"
@@ -22,11 +36,11 @@ set_device_id() {
 }
 
 case $HOSTNAME in
-       tp)
-               # original saved with: xkbcomp $DISPLAY /a/c/stretch-9-2016.xkb
-               xkbcomp /a/c/tp.xkb $DISPLAY
+       tp|x2)
+               # original saved with: xkbcomp $DISPLAY /a/c/stretch-x2-11-2016.xkb
+               xkbcomp /a/c/x2.xkb $DISPLAY
                ;;
-    treetowl*|iank-dev|frodo|x2)
+    treetowl*|iank-dev|frodo)
         # todo, differentiate for work pc
        #/a/bin/radl
         if [[ -z $DISPLAY ]]; then
index da729561450b4401eac42c766fd667bf2ae139e4..bbf5194fefa73907ecd21f795e4b580697854605 100755 (executable)
@@ -1,4 +1,18 @@
 #!/bin/bash
+# Copyright (C) 2016 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.
+
 
 # Running these files directly won't be good since we are
 # unmounting the volume they live on.
index f7dd6b4a01c33455dbcbddd47ea4859e17aa6afe..db4daa7615c4508a3eaa3aae09b6b6244b380e33 100755 (executable)
@@ -158,7 +158,7 @@ EOF
 
     f=/etc/exim4/passwd.client
     s touch $f
-    s chmod 600 $f # make it 600 before writing sensitive info
+    s chmod 640 $f # before writing sensitive info
     echo "$domain:${pass/:/::}" | s dd of=$f >/dev/null
     # https://blog.dhampir.no/content/make-exim4-on-debian-respect-forward-and-etcaliases-when-using-a-smarthost
     # i only need .forwards, so just doing that one.
index b67a46081886927012e47c74254835208cbbdc1d..ec475597cc01c4960ddb8ec10758c1647856b25a 100755 (executable)
@@ -1,4 +1,17 @@
 #!/bin/bash
+# Copyright (C) 2016 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
index 73709316d39b79dac8865aef265b0496574d0fc2..49ddcd594d39842306b1cc5d82f1d6e947c64dfc 100644 (file)
@@ -1,4 +1,19 @@
 #!/bin/bash
+# Copyright (C) 2016 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.
+
+
 
 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
 
@@ -94,6 +109,7 @@ for vol in q p; do
         roots=( ${new_roots[@]} )
     done
 
+    # if latest is already mounted, make sure binds are mounted and move on
     if e check-subvol-stale $d; then
         for b in ${binds[@]}; do
             mnt $b
@@ -116,6 +132,7 @@ for vol in q p; do
                 unmounted+=($dir)
             else
                 umount_ret=false
+                ret=1
                 echo "$0: failed to umount $dir"
                 break
             fi
@@ -126,7 +143,6 @@ for vol in q p; do
         for dir in ${unmounted[@]}; do
             mnt $dir
         done
-        ret=1
         continue
     fi
 
@@ -141,6 +157,8 @@ for vol in q p; do
     for dir in $d ${binds[@]}; do
         e mnt $dir
     done
+    stale_dir=/nocow/btrfs-stale
+    rm -f $stale_dir/$d
 done
 
 if [[ $HOSTNAME == treetowl ]]; then
diff --git a/myoff b/myoff
new file mode 100755 (executable)
index 0000000..2b48b45
--- /dev/null
+++ b/myoff
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright (C) 2016 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.
+
+
+# I failed at figuring out how to make a script happen early in reboot
+# but not on shutdown with systemd, so I use this to shutdown
+# and ask for a key.
+
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+if [[ $EUID != 0 ]]; then s=sudo; fi
+
+$s touch /tmp/keyscript-off
+$s poweroff
index d9204a33406fbaf9d1f059534677a5b7605a5925..ee1dd087ba8e9a443ce5135210996ff9c7db0371 100755 (executable)
@@ -1,4 +1,17 @@
 #!/bin/bash -l
+# Copyright (C) 2016 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.
 
 if [[ $EUID != 0 ]]; then
     sudo "$0"