aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE13
-rwxr-xr-xbin/backlight16
-rwxr-xr-xbuild/oksh (renamed from muslbuild/oksh)8
-rw-r--r--build/pass28
-rw-r--r--build/readme.md7
-rw-r--r--build/socat/Dockerfile2
-rw-r--r--build/socat/build.sh15
-rwxr-xr-xbuild/tmux (renamed from muslbuild/tmux)0
-rw-r--r--build/tmux/.gitignore1
-rw-r--r--build/tmux/Dockerfile14
-rw-r--r--build/tmux/build-int.sh25
-rw-r--r--build/tmux/build.sh16
-rwxr-xr-xbuild/upx (renamed from muslbuild/upx)2
-rw-r--r--exclude15
-rw-r--r--keyCheck.sh24
-rwxr-xr-xkeys/auth.sh17
-rw-r--r--keys/personal18
-rw-r--r--keys/update.sh20
-rwxr-xr-xlinux/kernel/package.sh23
-rwxr-xr-xlinux/kernel/upgrade.sh26
-rw-r--r--lolcat.bashrc6
-rwxr-xr-xmuslbuild/all11
-rwxr-xr-xmuslbuild/jq36
-rwxr-xr-xmuslbuild/libevent33
-rwxr-xr-xmuslbuild/musl53
-rwxr-xr-xmuslbuild/ncurses47
-rw-r--r--readme.md39
-rwxr-xr-xscripts/httpsvr (renamed from httpsvr)1
-rwxr-xr-xscripts/key-check.sh12
-rw-r--r--scripts/readme.md3
-rwxr-xr-x[-rw-r--r--]scripts/snap-btrfs.sh (renamed from snap/btrfs.sh)0
-rwxr-xr-x[-rw-r--r--]scripts/snap-lvm.sh (renamed from snap/lvm.sh)0
-rwxr-xr-x[-rw-r--r--]scripts/webhook.py (renamed from webhook.py)0
-rw-r--r--tezos/install.sh68
-rw-r--r--tezos/start.sh26
-rw-r--r--yashrc272
36 files changed, 89 insertions, 808 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..2531652
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2021 Mitchell Riedstra
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/bin/backlight b/bin/backlight
index 00cf00b..a0d6176 100755
--- a/bin/backlight
+++ b/bin/backlight
@@ -8,9 +8,21 @@ base="/sys/class/backlight/amdgpu_bl0/"
# base="/sys/class/backlight/backlight/"
_backlight="${base}brightness"
_max="${base}max_brightness"
-_max="$(cat "$_max" | awk '{print $1/100;}')"
+_max="$(awk '{print $1/100;}' < "$_max")"
percent="$(echo "$1" | awk '{print int($1*'"$_max"');}')"
-sudo sh -c "echo \"$percent\" > $_backlight"
+if ! [ -w "$_backlight" ] ; then
+ sudo chgrp "$(id -g)" "$_backlight"
+ sudo chmod g+w "$_backlight"
+fi
+
+
+sh -c "echo \"$percent\" > $_backlight"
+
+## If you want to do this withotu a password:
+# %wheel ALL=(ALL) NOPASSWD: /usr/bin/chgrp 1001 /sys/class/backlight/amdgpu_bl0/brightness
+# %wheel ALL=(ALL) NOPASSWD: /usr/bin/chmod g+w /sys/class/backlight/amdgpu_bl0/brightness
+# %wheel ALL=(ALL) NOPASSWD: /usr/bin/chgrp 1001 /sys/class/backlight/intel_backlight/brightness
+# %wheel ALL=(ALL) NOPASSWD: /usr/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness
diff --git a/muslbuild/oksh b/build/oksh
index 23213cf..3588d76 100755
--- a/muslbuild/oksh
+++ b/build/oksh
@@ -2,10 +2,10 @@
set -e
set -x
relver="6.9"
-build_dir="/v/muslbuild/oksh"
+build_dir="/v/autobuild/oksh"
-export CC="musl-gcc -static"
-PREFIX="$HOME/musl"
+export LDFLAGS="-static"
+PREFIX="${PREFIX:-$HOME/pkg}"
if ! [ -d "$build_dir" ] ; then
mkdir -p "$build_dir"
@@ -26,7 +26,7 @@ echo "${checksum} $arFn" | sha256sum -c
tar xzvf "$arFn"
cd "oksh-${relver}"
-./configure --prefix="$PREFIX" --bindir="$HOME/bin" --enable-ksh \
+./configure --prefix="$PREFIX" --bindir="$PREFIX/bin" --enable-ksh \
--enable-static
make
make install -j$(nproc)
diff --git a/build/pass b/build/pass
deleted file mode 100644
index 0c06564..0000000
--- a/build/pass
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-
-_install() {
-remote=""
-dest=""
-while [ $# -gt 0 ] ; do case $1 in
- -r) remote="$2"; shift ; shift ;;
- -d) dest="$2"; shift ; shift ;;
- -m) _mkopts="$2"; shift ; shift ;;
- *) echo "Unknown option $1" ; return ;;
-esac ; done
-
-if ! [ -d "$dest" ] ; then
- git clone "$remote" "$dest"
-fi
-
-cd "$dest"
-
-git pull --ff-only origin master
-
-sudo make $_mkopts install
-}
-
-_install -d /v/pub/pass -r https://git.zx2c4.com/password-store
-_install -d /v/pub/pass-otp -r https://github.com/tadfisher/pass-otp \
- -m PREFIX=/usr
diff --git a/build/readme.md b/build/readme.md
new file mode 100644
index 0000000..df1845d
--- /dev/null
+++ b/build/readme.md
@@ -0,0 +1,7 @@
+# build scripts
+
+
+Probably not a ton of use to others, specific configuration for me
+to build a few applications from source. Mostly because things on
+Ubuntu LTS become rather out of date over time and there are cases
+wehre I need to run that OS.
diff --git a/build/socat/Dockerfile b/build/socat/Dockerfile
index 1850917..e872ec8 100644
--- a/build/socat/Dockerfile
+++ b/build/socat/Dockerfile
@@ -1,5 +1,5 @@
FROM alpine:latest
-RUN apk add gcc libc-dev make
+RUN apk add gcc libc-dev make openssl-dev
diff --git a/build/socat/build.sh b/build/socat/build.sh
index d0d6ef9..fbc70d9 100644
--- a/build/socat/build.sh
+++ b/build/socat/build.sh
@@ -1,6 +1,17 @@
#!/bin/sh
+
+build=docker
+if [ -x "$(command -v buildah)" ] ; then
+ build=buildah
+fi
+
+run=docker
+if [ -x "$(command -v podman)" ] ; then
+ run=podman
+fi
+
image="socat-builder"
-docker build -t "$image" .
+$build build -t "$image" .
if ! [ -d build ] ; then
@@ -10,7 +21,7 @@ fi
cp build-int.sh build/build.sh
echo "chown -R $(id -u):$(id -g) /build" >> build/build.sh
-docker run -it \
+$run run --rm -it \
-v `pwd`/build:/build \
"$image" \
sh /build/build.sh
diff --git a/muslbuild/tmux b/build/tmux
index f160062..f160062 100755
--- a/muslbuild/tmux
+++ b/build/tmux
diff --git a/build/tmux/.gitignore b/build/tmux/.gitignore
deleted file mode 100644
index 378eac2..0000000
--- a/build/tmux/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/build/tmux/Dockerfile b/build/tmux/Dockerfile
deleted file mode 100644
index 463e964..0000000
--- a/build/tmux/Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-FROM ubuntu:20.04
-
-RUN sed -i -e'/deb-src/s/^#//g' /etc/apt/sources.list
-RUN apt-get update
-RUN apt-get install -y build-essential
-RUN env DEBIAN_FRONTEND=noninteractive apt-get build-dep -y tmux
-
-
-# RUN apk add libevent-dev gcc libc-dev make git
-# RUN apk add automake
-# RUN apk add autoconf
-# RUN apk add ncurses-dev
-
-
diff --git a/build/tmux/build-int.sh b/build/tmux/build-int.sh
deleted file mode 100644
index b4687aa..0000000
--- a/build/tmux/build-int.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-ver=3.1a
-export LDFLAGS='-static'
-
-cd /build
-
-if [ -e tmux ] ; then exit 0 ; fi
-
-if ! [ -e git ] ; then
- git clone --depth 1 --branch "$ver" https://github.com/tmux/tmux git
-fi
-
-cd git
-
-./autogen.sh
-./configure --enable-static
-make -j$(nproc)
-cp tmux ../
-
-cd ..
-
-gzip -c < tmux > tmux.gz
-base64 < tmux.gz > tmux.base64.gz
diff --git a/build/tmux/build.sh b/build/tmux/build.sh
deleted file mode 100644
index 763b045..0000000
--- a/build/tmux/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-image="tmux-builder"
-docker build -t "$image" .
-
-
-if ! [ -d build ] ; then
- mkdir build;
-fi
-
-cp build-int.sh build/build.sh
-echo "chown -R $(id -u):$(id -g) /build" >> build/build.sh
-
-docker run -it \
- -v `pwd`/build:/build \
- "$image" \
- sh /build/build.sh
diff --git a/muslbuild/upx b/build/upx
index 6c4e98b..9658832 100755
--- a/muslbuild/upx
+++ b/build/upx
@@ -2,7 +2,7 @@
set -e
set -x
relver="3.96"
-build_dir="/v/muslbuild/jq"
+build_dir="/v/autobuild/jq"
if ! [ -d "$build_dir" ] ; then
mkdir -p "$build_dir"
diff --git a/exclude b/exclude
index 4c8ccb0..809d58d 100644
--- a/exclude
+++ b/exclude
@@ -6,24 +6,9 @@
.config/chromium/*/Service Worker/CacheStorage/*
.config/chromium/*/Application Cache/*
Downloads/*
-.dropbox/*
.thumbnails/*
.dropbox-dist/*
.steam/*
.local/share/Steam/*
VirtualBox*
.wine/*
-scm/gentoo_image/*
-Laptop-Games/*
-
-
-# Backed up seperately
-# ./Dropbox/*
-# ./Nextcloud/*
-# ./Games/*
-# ./Images/*
-# ./Music/*
-# ./Photos/*
-# ./Photos_sort/*
-# ./Videos/*
-# ./pixel_camera/*
diff --git a/keyCheck.sh b/keyCheck.sh
deleted file mode 100644
index 2293b3c..0000000
--- a/keyCheck.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# Check for a public key, and create one for the user if it
-# does not exist. Spit the key in red to stdout
-
-# Really useful for people running MacOS
-
-# One line version to paste in a chat or so
-# if [ -e ~/.ssh/id_rsa.pub ] ; then echo $'\033[1;31m' ; cat ~/.ssh/id_rsa.pub ; echo $'\033[0m' ; else ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -t rsa -P ""; echo $'\033[1;31m' ; cat ~/.ssh/id_rsa.pub ; echo $'\033[0m'; fi
-
-if [ -e ~/.ssh/id_rsa.pub ] ; then
- echo $'\033[1;31m'
- cat ~/.ssh/id_rsa.pub
- echo $'\033[0m'
-else
- ssh-keygen \
- -t rsa \
- -b 4096 \
- -f ~/.ssh/id_rsa \
- -P ""
- echo $'\033[1;31m'
- cat ~/.ssh/id_rsa.pub
- echo $'\033[0m'
-fi
diff --git a/keys/auth.sh b/keys/auth.sh
deleted file mode 100755
index 15313a0..0000000
--- a/keys/auth.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-_timeout=5
-_url="https://www.rygel.us/etc/keys/personal"
-cache="/etc/ssh/keys"
-
-_temp="$(mktemp)"
-
-if curl \
- --connect-timeout $_timeout \
- "$_url" > "$_temp" 2>/dev/null
-then
- cat "$_temp" | tee $cache
-else
- cat $cache
-fi
-
-rm "$_temp"
diff --git a/keys/personal b/keys/personal
index de0e2fa..619f829 100644
--- a/keys/personal
+++ b/keys/personal
@@ -2,21 +2,3 @@ sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIMPdY+16r
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIC298G+PspbIyCc0RUNpAZ21FlLb4U6YxTJD30FSj68sAAAABHNzaDo= Yubikey
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIO0eJvCd9lvTZZTzQ0OeYOrxS/dOi/14+poSIChmW9BwAAAABHNzaDo= Yubikey Nano
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC2HxZu2QRHXUt+N1da2muz0m+kL+lnPCsEhzWZfRwqca4RmvFWrBguKQxe1Tvgj2Ft0gd+D9oINpKqFwbGWWQzIIT3jn5Q/4OKwbCP9cO4vyci1PWxw6JTogcDAC5TS0wmGkrI5TNnvR03ANC02DUobRp582GAs6nT3ide58Jtz5pq3IpQxu3jSnJnN7KAXqG0RXJgZyrwhqk2vOSLLLhCOyqz3fKlHYthmQz6Kck/0+YeFCkfSlZ7W7/ZuyA2Oec11oMlyHFMYCVkm+FvmSHCaHHH6WHXAjYAmwO34xa8UaEbATNGnwouFb1IDNQ5B05aJMTwV3wmwyPuqWOaDpEaI59KQ2IbaX4eOdTmtQ80+N44la8OELRLGOa/cVO0UqRvNSKClRQVVmV+bOFIgPgi5f08w3Qqrz/spTtEO5yU3I+b+Fbw+eJaOwK6UwRDgWn37A395PM5O4qyZOoe/KBoHvcLdb9bFYHeDUbDOfjV2wYw9AQ1pbGEYY3ca5hNK5bhx+SLRrYB00pEfJ8FQpw5l2lVfXy3vqH5Vvp445uQplW08R4Zspwg+VjNd3fjUZh+x/M/25gjE6uRNsEmjA3ifpmAWQeBCDE3ZLFD7wL6ROsWRyFbOD2bWjStvp8N2i0S688pVxn/oK15CyYfXMiQkESXRC+vHg0jPlUf6mXW+Q== PGP Smart card
-
-# sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBNs9K1BwDNYDSVFpJYLHWswlzCxq71n660rxg7mGMfBmIDeXGPQvUoe69XZl/Wzib6A83ZJEesezj5juGBH1BFcAAAAEc3NoOg== Mitch MacOS 08-01-2021
-# sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBN8qPZtZtlyagNY0O6DJCr4BSDv5D9YcjIeBzomh3STo7NtMTNWP+Fah7pS6I8tMWh+IH56tzMsbeJZ80T3wA/cAAAAEc3NoOg== Mitch Linux 07-30-2021
-# sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBLNs5rX1ghcrzlTChhTJubezFaOA2zgcyawEaiogPW7bw+mzjQtFgBj2JMeY0RT95k//41fvExXvd7uocuM0ovYAAAAEc3NoOg== Mitch T495s 07-30-2021
-# sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBGn1Olds6Inh8lHz44hRn54Ezt4auH/71HUh9sJJTrdv3Py0nTBY0U9jUd6qM6DkALuM55Anf0XhUeN0XMaMOAQAAAAEc3NoOg== Mitch OpenBSD Desktop 07-30-2021
-# sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBHuIU22MvuDl4H8hpGzLwCPeRznqCdJQVDJ+1bCXO0h5sOn7eRytxhY9Yiz4FO+j5vI8jPUTmqT9NLJ+6xC/plwAAAAEc3NoOg== Mitch OpenBSD ThinkPad 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxBJi5QcLvQD6A1S/BYCCe4VnY2Q3efzgESKx6e6925 Mitch OpenBSD X230 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEeDAYoKGhlqiQ+vrqh4Hd8Ehqo9l5HCAQm6sujnNAqD Mitch Linux X230 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJB/izGNfqQLWalXYUhhUdkV4LlkVtkw/x6YAa1tIOIP Mitch Windows X230 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINFMV2TgunTmYmjusyrpELw8dKp5j2AZi9oy8PfgEHYg Mitch T495s 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGczyjD0+ctCmSgrq4Sky0+kAsz4xpVAyHlCab06mtRU Mitch MacBook Air 07-30-2021
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA4JL/YZ11iS/fIFBJfZoacD3Wo+x8LDT7GRiShdbDAl Mitch Windows Desktop 07-30-2021
-
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhK3hkZto5wqcBHwBcS4IpK1jpQwqItbtp7Rb3Ir1+B Mitch 09-12-2020
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII2OTc82hnxoVfU1qXPxGjDJaYQnGuFBRaUr0F5iURAq Mitch x230 Void
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMR1SAkfhO943lOwxa0ISkNtxgxZ3V7Yp3OSIl41NI4o Mitch Windows Desktop 2020
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+lR5MSRm8LJRQK7lMNRssIGUFfPjIubdUAXfcy0tzn Mitch's Macbook 10.13.2020
-# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2htJE5tbC+6d2xw/zXvMDPiZY/4xmKaqlGuzlXsG5T mitch@pinebook
diff --git a/keys/update.sh b/keys/update.sh
deleted file mode 100644
index 66d0e6a..0000000
--- a/keys/update.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# Easy script to throw in the crontab of a system to update SSH keys from
-# my personal server via HTTPs. This implies that you trust all of the CAs
-# on your system.... It's up to you whether you are going to risk that.
-set -e
-_timeout=5
-_url="https://www.rygel.us/etc/keys/personal"
-keys="$HOME/.ssh/authorized_keys"
-
-_temp="$(mktemp)"
-
-if curl \
- --connect-timeout $_timeout \
- "$_url" > "$_temp" 2>/dev/null
-then
- cp "$_temp" "$keys"
- chmod 600 "$keys"
-fi
-
-rm "$_temp"
diff --git a/linux/kernel/package.sh b/linux/kernel/package.sh
deleted file mode 100755
index 14a23b2..0000000
--- a/linux/kernel/package.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-
-if [ $(id -u) -ne 0 ] ; then
- echo "You must be root"
- exit 1;
-fi
-
-if [ -z "$1" ] ; then
- echo "Usage: $0 \$version"
- echo "Will place currently installed kernel \$version in the current directory"
- exit 1;
-fi
-version="$1"; shift
-
-tar -C / -cvf - \
- "/usr/lib/modules/$version" \
- "/boot/config-$version" \
- "/boot/vmlinuz-$version" \
- "/boot/System.map-${version}" \
- "/boot/initramfs-${version}.img" \
- | gzip -3c > $version.tar.gz
diff --git a/linux/kernel/upgrade.sh b/linux/kernel/upgrade.sh
deleted file mode 100755
index dab1518..0000000
--- a/linux/kernel/upgrade.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-version="$(sed 11q Makefile \
- | sed -n \
- -e's/^VERSION = //p' \
- -e's/^PATCHLEVEL = //p' \
- -e's/^SUBLEVEL = //p' \
- | tr '\n' '.' \
- | sed -e's/\.$//')"
-localversion="$(sed 25q .config \
- | sed -rn \
- -e's/^CONFIG_LOCALVERSION="(.*)"$/\1/p')"
-if [ -z "$version" ] ; then
- exit 1;
-fi
-CPUs="$(nproc)"
-# git checkout v$version
-make -j$CPUs "$@" olddefconfig bzImage modules
-sudo make -j$CPUs install modules_install
-cd /
-sudo sh -c 'umask 002; sh /etc/kernel.d/post-install/10-dkms linux '"${version}${localversion}"
-cd -
-sudo dracut -f --kver "${version}${localversion}"
-sudo grub-mkconfig -o /boot/grub/grub.cfg
-echo "You'll have to update grub by hand there bud"
diff --git a/lolcat.bashrc b/lolcat.bashrc
deleted file mode 100644
index 62284b3..0000000
--- a/lolcat.bashrc
+++ /dev/null
@@ -1,6 +0,0 @@
-
-ESC=$(echo -e '\033')
-SOH=$(echo -e '\001')
-STX=$(echo -e '\002')
-PS1_color_wrap='s/'$ESC'\\[[[:digit:];]*m/'$SOH'&'$STX'/g'
-PS1="\$(glolcat <<< \"$PS1_colorless\" | sed '$PS1_color_wrap')"
diff --git a/muslbuild/all b/muslbuild/all
deleted file mode 100755
index fdcf41d..0000000
--- a/muslbuild/all
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-set -e
-pkgs="musl
-oksh
-ncurses
-libevent
-tmux
-upx"
-for pkg in $pkgs ; do
- ./$pkg
-done
diff --git a/muslbuild/jq b/muslbuild/jq
deleted file mode 100755
index b3873a2..0000000
--- a/muslbuild/jq
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-relver="1.6"
-build_dir="/v/muslbuild/jq"
-
-export CC="musl-gcc"
-PREFIX="$HOME/musl"
-
-if ! [ -d "$build_dir" ] ; then
- mkdir -p "$build_dir"
-fi
-cd "$build_dir"
-
-arLoc="https://github.com/stedolan/jq/releases/download/jq-%s/jq-%s.tar.gz"
-arLoc="$(printf "$arLoc\n" "$relver" "$relver")"
-arFn="jq-${relver}.tar.gz"
-
-checksum=5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72
-
-if ! [ -e "$arFn" ] ; then
- curl -L -o "$arFn" "$arLoc"
-fi
-
-echo "${checksum} $arFn" | sha256sum -c
-
-tar xzvf "$arFn"
-cd "jq-${relver}"
-./configure --prefix="$PREFIX" --bindir="$HOME/bin" --host=x86_64 \
- --build=x86_64-pc-linux-gnu \
- --enable-all-static --enable-static=yes --enable-shared=no --disable-docs \
- --with-oniguruma=builtin \
- --disable-maintainer-mode
-make
-make install -j$(nproc)
-
diff --git a/muslbuild/libevent b/muslbuild/libevent
deleted file mode 100755
index ccd24ec..0000000
--- a/muslbuild/libevent
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-relver="2.1.12"
-build_dir="/v/muslbuild/libevent"
-
-export CC="musl-gcc"
-PREFIX="$HOME/musl"
-
-if ! [ -d "$build_dir" ] ; then
- mkdir -p "$build_dir"
-fi
-cd "$build_dir"
-
-arLoc="https://github.com/libevent/libevent/releases/download/release-%s-stable/libevent-%s-stable.tar.gz"
-arLoc="$(printf "$arLoc\n" "$relver" "$relver")"
-arFn="libevent-${relver}-stable.tar.gz"
-
-checksum=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
-
-if ! [ -e "$arFn" ] ; then
- curl -L -o "$arFn" "$arLoc"
-fi
-
-echo "${checksum} libevent-${relver}-stable.tar.gz" | sha256sum -c
-
-tar xzvf "$arFn"
-cd "libevent-${relver}-stable"
-./configure --prefix="$PREFIX" --host=x86_64 \
- --disable-doxygen-doc --enable-static=yes --enable-shared=no \
- --disable-openssl
-make
-make install -j1
diff --git a/muslbuild/musl b/muslbuild/musl
deleted file mode 100755
index 13487e5..0000000
--- a/muslbuild/musl
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-relver="1.2.2"
-build_dir="/v/pub/musl"
-
-PREFIX="$HOME/musl"
-
-if ! [ -d "$build_dir" ] ; then
- mkdir -p "$build_dir"
-fi
-cd "$build_dir"
-
-sigLoc="https://musl.libc.org/releases/musl-${relver}.tar.gz.asc"
-sigFn="musl-${relver}.tar.gz.asc"
-arLoc="https://musl.libc.org/releases/musl-${relver}.tar.gz"
-arFn="musl-${relver}.tar.gz"
-
-curl https://musl.libc.org/musl.pub | gpg --import
-
-if ! [ -e "$arFn" ] ; then
- curl -o "$arFn" "$arLoc"
-fi
-
-if ! [ -e "$sigFn" ] ; then
- curl -o "$sigFn" "$sigLoc"
-fi
-
-_out="$(mktemp)";
-gpg --fingerprint --verify "$sigFn" >"$_out" 2>&1
-ret=$?
-
-if [ $ret -ne 0 ] ; then
- cat "$_out"
- rm "$_out"
- echo "Bad signature"
-fi
-
-if ! grep -q '^Primary key fingerprint: 8364 8929 0BB6 B70F 99FF DA05 56BC DB59 3020 450F' \
- < "$_out" ; then
- cat "$_out"
- rm "$_out"
- echo "Bad signature"
- exit 1
-fi
-rm "$_out" || printf ""
-
-tar xzvf "$arFn"
-cd "musl-${relver}"
-./configure --prefix="$PREFIX" --bindir="$HOME/bin" --disable-shared \
- --enable-static
-make
-make install -j$(nproc)
diff --git a/muslbuild/ncurses b/muslbuild/ncurses
deleted file mode 100755
index a9419d8..0000000
--- a/muslbuild/ncurses
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-set -e
-set -x
-relver="6.2-20210911"
-build_dir="/v/muslbuild/ncurses"
-
-PREFIX="$HOME/musl"
-export CC="musl-gcc -static"
-
-if ! [ -d "$build_dir" ] ; then
- mkdir -p "$build_dir"
-fi
-cd "$build_dir"
-
-# arLoc="https://invisible-mirror.net/archives/ncurses/ncurses-%s.tar.gz"
-# arLoc="https://invisible-mirror.net/archives/ncurses/ncurses-%s.tar.gz"
-arLoc="https://invisible-mirror.net/archives/ncurses/current/ncurses-%s.tgz"
-arLoc="$(printf "$arLoc\n" "$relver")"
-arFn="ncurses-${relver}.tar.gz"
-
-checksum=13f221dda7a5839fe7ccee827c93fafb420c943d0f7e7de4d60299046b965867f5afba54c84c1dce2d8b58ff7a5a112bea87c89eca103a14c0fea2ccdf430eaf
-
-if ! [ -e "$arFn" ] ; then
- # we're verifying the checksum anyway, it's freaking out the full
- # chain not being there
- curl -k -L -o "$arFn" "$arLoc"
-fi
-
-echo "${checksum} $arFn" | sha512sum -c
-
-tar xzvf "$arFn"
-cd "ncurses-${relver}"
-./configure --prefix="$PREFIX" --bindir="$HOME/bin" \
- --enable-static \
- --includedir="$PREFIX/include" \
- --without-ada \
- --without-tests \
- --disable-termcap \
- --with-termlib \
- --disable-rpath-hack \
- --without-cxx-binding \
- --enable-pc-files \
- --disable-shared \
- --without-pkg-config
-make clean
-make -j$(nproc)
-make install -j$(nproc)
diff --git a/readme.md b/readme.md
index d3d29bc..832f1e0 100644
--- a/readme.md
+++ b/readme.md
@@ -8,7 +8,7 @@ Things of interest:
* tmux configuration ( see more info below )
* tmux helper script ( For load average, uptime and memory in the status bar )
* basic configuration ( For if you don't want the custom status bar )
- * [`keyCheck.sh`](keyCheck.sh) Automatically generate a 4096bit RSA SSH key or display the one you have
+ * [`scripts/key-check.sh`](
* Snapshot scripts. Snapshots your entire OS see below for more details.
* A basic vim configuration ( also see [`vim-cfg`](https://git.riedstra.dev/mitch/vim-cfg/about) )
* A handful of build scripts with my options for some open source projects such as Vim
@@ -17,22 +17,34 @@ Things of interest:
These alter the fstab in the snapshot so you can boot to it just by changing kernel boot parameters
-### [`snap/btrfs.sh`](`snap/btrfs.sh`)
+### [`scripts/snap-btrfs.sh`](`scripts/snap-btrfs.sh`)
Automatically snapshot a btrfs root filesystem assuming you're using a
subvolume and the base FS is mounted in `/ROOT`
-[`snap/lvm.sh`](`snap/lvm.sh`)
+[`scripts/snap-lvm.sh`](`scripts/snap-lvm.sh`)
Same as above, except it doesn't keep RO snapshots around, and doesn't remove
old ones. Requires LVM but the underlying FS doesn't matter ( `ext4`, `xfs`,
etc )
+## `bin` directory / desktop utilities
+
+ * `snipmenu`, a small [dmenu](https://dmenu.suckless.org) script for pasting
+ snippets from the `snips` directory.
+ * `status-bar` a *very* messy script for a `dwm` status
+ * `vol` small script to adjust pulseaudio volume on linux
+ * `day`/`night` scripts for turning off/on `redshift`
+ * `wallpaper` small script to continuously adjust the wallpaper, useful
+ for when your screen resolution changes
+ * `backlight` directly adjust the backlight on Linux systems
+ * `ddmenu` dmenu for demenus. Dmenu script that launches other dmenu scripts.
+
## Shell Configuration
-`kshrc`, generated using `build.sh` inside of the `shell/` directory.
+`kshrc`
Specifically targets ksh which has been my default shell for quite a long time
-now. Though I do test it against `bash` and `ash` as well.
+now. Though I do test it against `bash` and `ash` occasionally as well.
Some useful features are:
@@ -74,17 +86,8 @@ Some useful features are:
* `updatevimrc_basic` Installs the `.vimrc` file which is a basic but useful vim configuration.
* `updatetmuxconf` Pulls in the tmux configuration from this repository.
* `updateshell` Pulls the latest version of `kshrc` from this repository.
- * `pullkeys_github <github_username>` Creates the `~/.ssh/authorized_keys` file with the SSH keys for a given github username
- * Conf<br /><br />
- All of the pieces above don't actually do anything automatically, they just
- add shell functions that can be called. This file ties it all together.
- <br />
- It:
- * sets the URLs for the update functions,
- * the configuration file location
- * sources the pre and post configuration files
- * sets the color aliases and environment variables if necessary
- * adjusts PATH to include `~/bin`
- * It also handles the different supported shells, history, etc
- * Sets up a basic PS1 for most shells
+ * `pullkeys_github <github_username>` Creates the `~/.ssh/authorized_keys`
+ file with the SSH keys for a given github username
+ * `updategitconf <name>` Creates `~/.gitconfig` with the file from
+ `gitconfig/<name>`
diff --git a/httpsvr b/scripts/httpsvr
index 0ea8104..ffc816a 100755
--- a/httpsvr
+++ b/scripts/httpsvr
@@ -59,7 +59,6 @@ while true ; do
break
fi
sleep .01
- sleep .1
[ -s "$_f" ] && counter=$((counter += 1))
ps $ncpid >/dev/null 2>&1 || break
done
diff --git a/scripts/key-check.sh b/scripts/key-check.sh
new file mode 100755
index 0000000..1672bc4
--- /dev/null
+++ b/scripts/key-check.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Check for a public key, and create one for the user if it
+# does not exist. Spit the key in red to stdout. Not so much for me,
+# but as a convienient script to give to others who aren't so familiar
+# with how SSH key authorization works.
+
+keyf="$HOME/.ssh/id_ed25519";
+! [ -e "$keyf" ] && ssh-keygen -t ed25519 -f "$keyf" -P "";
+printf '\033[1;31m%s\033[0m\n' "$(cat "$keyf.pub")";
+
+# One line version for pasting into chat:
+# keyf="$HOME/.ssh/id_ed25519"; ! [ -e "$keyf" ] && ssh-keygen -t ed25519 -f "$keyf" -P ""; printf '\033[1;31m%s\033[0m\n' "$(cat "$keyf.pub")";
diff --git a/scripts/readme.md b/scripts/readme.md
new file mode 100644
index 0000000..60c79c1
--- /dev/null
+++ b/scripts/readme.md
@@ -0,0 +1,3 @@
+# scripts
+
+A couple of misc scripts that may be of some utility.
diff --git a/snap/btrfs.sh b/scripts/snap-btrfs.sh
index cc2e5a9..cc2e5a9 100644..100755
--- a/snap/btrfs.sh
+++ b/scripts/snap-btrfs.sh
diff --git a/snap/lvm.sh b/scripts/snap-lvm.sh
index 4991495..4991495 100644..100755
--- a/snap/lvm.sh
+++ b/scripts/snap-lvm.sh
diff --git a/webhook.py b/scripts/webhook.py
index 3db70a8..3db70a8 100644..100755
--- a/webhook.py
+++ b/scripts/webhook.py
diff --git a/tezos/install.sh b/tezos/install.sh
deleted file mode 100644
index 0d55472..0000000
--- a/tezos/install.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-set -e
-
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-ocaml_compiler="4.09.1"
-ocaml_switch_name="for_tezos"
-
-printf "\033[1;31m"
-echo "**********************************************************************"
-echo "* Short install script for tezos from source code, loosely based on: *"
-echo "* https://tezos.gitlab.io/introduction/howtoget.html *"
-echo "* *"
-echo "* This script was created on 09-12-2020 and may need some checking *"
-echo "* over for updates in the future *"
-echo "* *"
-echo "* ocaml_compiler: $ocaml_compiler *"
-echo "**********************************************************************"
-echo
-printf "\033[0m"
-
-set -x
-
-# Check and see if cargo is in the path, if not let's add it
-if ! echo "$PATH"| grep -q cargo ; then
- export PATH="$HOME/.cargo/bin:$PATH"
-fi
-
-# Check and see if rustc is available, if not we're going to go ahead
-# and try to install it from their main source
-if ! stat "$(which rustc | sed 1q)" >/dev/null 2>&1 ; then
- echo "Need rustc... installing"
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-fi
-
-rustup set profile minimal
-rustup toolchain install 1.39.0
-rustup default 1.39.0
-. $HOME/.cargo/env
-
-# Check and see if we have the ppa already, if not let's go ahead and add it
-if ! apt policy 2>/dev/null | grep -q avsm/ppa ; then
- sudo add-apt-repository ppa:avsm/ppa
- sudo apt update
-fi
-sudo apt install opam
-
-# Only run if the switch for our tezos install does not currently exist
-if ! opam switch list 2>/dev/null | grep -q "$ocaml_switch_name" ; then
- opam switch create "$ocaml_switch_name" "$ocaml_compiler"
-fi
-opam switch "$ocaml_switch_name"
-eval $(opam env)
-
-opam install depext
-opam depext tezos
-
-opam install tezos
diff --git a/tezos/start.sh b/tezos/start.sh
deleted file mode 100644
index 6c515cc..0000000
--- a/tezos/start.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-set -e
-session="tezos-node"
-
-unset TMUX
-
-if tmux ls -F '#{session_name}' | grep -q "^$session" ; then
- exec tmux att -t "$session"
-fi
-
-exec tmux new-session -s "$session" \;\
- send-keys "tezos-node run --rpc-addr localhost:8732 --history-mode experimental-rolling" \;\
- send-keys Enter \;\
- \
- new-window -n "endorser" \;\
- send-keys -t "$session:endorser" "sleep 5 ; tezos-endorser-007-PsDELPH1 run" \;\
- send-keys -t "$session:endorser" Enter \;\
- \
- new-window -n "baker" \;\
- send-keys -t "$session:baker" \
- "sleep 5 ; tezos-baker-007-PsDELPH1 run with local node \"$HOME/.tezos-node\" " \;\
- send-keys -t "$session:baker" Enter \;\
- \
- new-window -n "accuser" \;\
- send-keys -t "$session:accuser" "sleep 5 ; tezos-accuser-007-PsDELPH1 run" \;\
- send-keys -t "$session:accuser" Enter \;\
diff --git a/yashrc b/yashrc
deleted file mode 100644
index c989764..0000000
--- a/yashrc
+++ /dev/null
@@ -1,272 +0,0 @@
-##### Common Yashrc #####
-# This file is in the public domain.
-
-# enable bash-like extended expansion
-set --brace-expand
-
-# enable recursive pathname expansion
-set --extended-glob
-
-# prevent redirections from overwriting existing files
-set --no-clobber
-
-# don't implicitly expand non-existent variables to empty strings
-set --no-unset
-
-# if yash is built with command history enabled...
-if command --identify --builtin-command history >/dev/null; then
-
- # don't save commands starting with a space in history
- set --hist-space
-
- # prevent clearing history by accident
- history()
- if [ -t 0 ] && (
- for arg do
- case "${arg}" in
- (-[drsw]?* | --*=*) ;;
- (-*c*) exit;;
- esac
- done
- false
- ) then
- printf 'history: seems you are trying to clear the whole history.\n' >&2
- printf 'are you sure? (yes/no) ' >&2
- case "$(head -n 1)" in
- ([Yy]*) command history "$@";;
- (*) printf 'history: cancelled.\n' >&2;;
- esac
- else
- command history "$@"
- fi
-
-fi
-
-# if yash is built with line-editing enabled...
-if command --identify --builtin-command bindkey >/dev/null; then
-
- # print job status update ASAP, but only while line-editing
- set --notify-le
-
- # some terminfo data are broken; meta flags have to be ignored for UTF-8
- set --le-no-conv-meta
-
- # enable command line prediction
- set --le-predict
-
- set --emacs
-
- # some useful key bindings
- bindkey --emacs '\^N' beginning-search-forward
- bindkey --emacs '\^O' clear-candidates
- bindkey --emacs '\^P' beginning-search-backward
- bindkey --emacs '\N' complete-next-column
- bindkey --emacs '\P' complete-prev-column
-
-fi
-
-# some useful shortcuts
-alias -- -='cd -'
-alias la='ls -a' ll='ls -l' lla='ll -a'
-alias r='fc -s'
-
-# avoid removing/overwriting existing files by accident
-cp() if [ -t 0 ]; then command cp -i "$@"; else command cp "$@"; fi
-mv() if [ -t 0 ]; then command mv -i "$@"; else command mv "$@"; fi
-rm() if [ -t 0 ]; then command rm -i "$@"; else command rm "$@"; fi
-
-# normally yash is more POSIX-compliant than /bin/sh :-)
-sh() { yash --posix "$@"; }
-yash() { command yash "$@"; }
-# By re-defining 'yash' using the 'command' built-in, the 'jobs' built-in
-# prints a command name that exposes the arguments like
-# 'yash --posix -n foo.sh' rather than a command name that hides the
-# arguments like 'yash --posix "${@}"'. This applies to the 'yash' command
-# invoked via the 'sh' function.
-
-# ensure job control works as expected
-case $- in (*m*)
- trap - TSTP TTIN TTOU
-esac
-
-# if the terminal supports color...
-if [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
-
- # make command output colorful
- if ls --color=auto -d / >/dev/null 2>&1; then
- ls() { command ls --color=auto "$@"; }
- fi
- if grep --color=auto -q X <<<X 2>/dev/null; then
- grep() { command grep --color=auto "$@"; }
- fi
- if ggrep --color=auto -q X <<<X 2>/dev/null; then
- ggrep() { command ggrep --color=auto "$@"; }
- fi
-
-fi
-
-# if vim is available...
-if command --identify vim >/dev/null 2>&1; then
-
- # prefer vim over vi
- vi() { vim "$@"; }
- view() { vim -R "$@"; }
- vim() { command vim "$@"; } # Re-definition hack. See above.
-
-fi
-
-# avoid removing existing crontab by accident
-crontab()
-if [ -t 0 ] && (
- for arg do
- case "${arg}" in
- (-*r*) exit;;
- esac
- done
- false
-) then
- printf 'crontab: seems you are trying to clear your crontab.\n' >&2
- printf 'are you sure? (yes/no) ' >&2
- case "$(head -n 1)" in
- ([Yy]*) command crontab "$@";;
- (*) printf 'crontab: cancelled.\n' >&2;;
- esac
-else
- command crontab "$@"
-fi
-
-# an alias that opens a file
-if command --identify xdg-open >/dev/null 2>&1; then
- alias o='xdg-open'
-elif command --identify cygstart >/dev/null 2>&1; then
- alias o='cygstart'
-elif [ "$(uname)" = Darwin ] 2>/dev/null; then
- alias o='open'
-fi
-
-# define some basic variables if missing
-: ${PAGER:=less} ${EDITOR:=vi} ${FCEDIT:=$EDITOR}
-: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)}
-
-# disable confusing treatment of arguments in the echo command
-: ${ECHO_STYLE:=RAW}
-
-# variables needed for command history
-HISTFILE=~/.yash_history HISTSIZE=5000
-# HISTRMDUP makes prediction less accurate
-# HISTRMDUP=500
-
-# default mail check interval is too long
-MAILCHECK=0
-
-# emulate bash's $SHLVL
-if [ "${_old_shlvl+set}" != set ]; then
- _old_shlvl=${SHLVL-}
-fi
-SHLVL=$((_old_shlvl+1)) 2>/dev/null || SHLVL=1
-export SHLVL
-
-# initialize event handlers
-COMMAND_NOT_FOUND_HANDLER=()
-PROMPT_COMMAND=()
-YASH_AFTER_CD=()
-
-# define prompt
-if [ -n "${SSH_CONNECTION-}" ]; then
- _hc='\fy.' # yellow hostname for SSH remote
-else
- _hc='\fg.' # green hostname for local
-fi
-if [ "$(id -u)" -eq 0 ]; then
- _uc='\fr.' # red username for root
- _2c='\fr.' # red PS2 for root
-else
- _uc=$_hc _hc= # same username color as hostname for non-root user
- _2c= # PS2 in normal color for non-root user
-fi
-# The main prompt ($YASH_PS1) contains the username, hostname, working
-# directory, last exit status (only if non-zero), and $SHLVL (only if
-# non-one).
-_un="${LOGNAME//mitch/}"; [ -n "$_un" ] && _un="${_un}@"
-YASH_PS1=$_uc'${_un}'$_hc'${HOSTNAME%%.*}\fd. '\
-'${${${PWD:/~/\~}##*/}:-$PWD} ${{?:/0/}:+\\fr.$?\\fd. }\$ '
-# YASH_PS1R='\fc.${_vcs_info}'
-# YASH_PS1R='\fc.${HOSTNAME%%.*} ${${${PWD:/~/\~}##*/}:-$PWD}'
-YASH_PS1R=
-YASH_PS1S='\fo.'
-YASH_PS2=$_2c'> '
-YASH_PS2R=
-YASH_PS2S=$YASH_PS1S
-YASH_PS4='\fm.+ '
-YASH_PS4S='\fmo.'
-unset _hc _uc _2c _un
-# No escape sequences allowed in the POSIXly-correct mode.
-PS1='${LOGNAME}@${HOSTNAME%%.*} '$PS1
-YASH_PS1="${?:/0/}$ "
-
-# find escape sequence to change terminal window title
-case "$TERM" in
- (xterm|xterm[+-]*|gnome|gnome[+-]*|putty|putty[+-]*|cygwin)
- _tsl='\033];' _fsl='\a' ;;
- (*)
- _tsl=$( (tput tsl 0; echo) 2>/dev/null |
- sed -e 's;\\;\\\\;g' -e 's;;\\033;g' -e 's;;\\a;g' -e 's;%;%%;g')
- _fsl=$( (tput fsl ; echo) 2>/dev/null |
- sed -e 's;\\;\\\\;g' -e 's;;\\033;g' -e 's;;\\a;g' -e 's;%;%%;g') ;;
-esac
-# if terminal window title can be changed...
-if [ "$_tsl" ] && [ "$_fsl" ]; then
-
- # set terminal window title on each prompt
- _set_term_title()
- if [ -t 2 ]; then
- printf "$_tsl"'%s@%s:%s'"$_fsl" "${LOGNAME}" "${HOSTNAME%%.*}" \
- "${${PWD:/$HOME/\~}/#$HOME\//\~\/}" >&2
- fi
- PROMPT_COMMAND=("$PROMPT_COMMAND" '_set_term_title')
-
- # reset window title when changing host or user
- ssh() {
- if [ -t 2 ]; then printf "$_tsl"'ssh %s'"$_fsl" "$*" >&2; fi
- command ssh "$@"
- }
- su() {
- if [ -t 2 ]; then printf "$_tsl"'su %s'"$_fsl" "$*" >&2; fi
- command su "$@"
- }
- sudo() {
- if [ -t 2 ]; then printf "$_tsl"'sudo %s'"$_fsl" "$*" >&2; fi
- command sudo "$@"
- }
-
-fi
-
-# when a directory name is entered as a command, treat as "cd"
-_autocd()
-if [ -d "$1" ]; then
- HANDLED=true
- cd -- "$@"
- break -i
-fi
-COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_autocd "$@"')
-
-# treat command names starting with % as "fg"
-_autofg()
-if [ $# -eq 1 ]; then
- case $1 in (%*)
- HANDLED=true
- fg "$1"
- break -i
- esac
-fi
-COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_autofg "$@"')
-
-# print file type when executing non-executable files
-_file_type()
-if [ -e "$1" ] && ! [ -d "$1" ]; then
- file -- "$1"
-fi
-COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_file_type "$@"')
-
-
-. ~/.kshrc