dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 3b19f4b4fc303c9bb8a5d8e5c00e8a44feab2c79
parent 1d5826874f014df8b08dddc2f0239c14eca5d23d
Author: hhvn <dev@hhvn.uk>
Date:   Sun,  2 Jan 2022 18:49:59 +0000

.scripts/bin/ -> .scripts/

Diffstat:
R.scripts/bin/PATH -> .scripts/PATH | 0
R.scripts/bin/addrbook -> .scripts/addrbook | 0
R.scripts/bin/addtorrent -> .scripts/addtorrent | 0
R.scripts/bin/asciiclip -> .scripts/asciiclip | 0
R.scripts/bin/asplit -> .scripts/asplit | 0
R.scripts/bin/autowifi -> .scripts/autowifi | 0
R.scripts/bin/backronym -> .scripts/backronym | 0
R.scripts/bin/bandcampdl -> .scripts/bandcampdl | 0
R.scripts/bin/bandcampsrch -> .scripts/bandcampsrch | 0
A.scripts/bin | 2++
D.scripts/bin/crypto | 2--
D.scripts/bin/gophcheck | 80-------------------------------------------------------------------------------
D.scripts/bin/hlpaste | 10----------
D.scripts/bin/kshrcremote | 29-----------------------------
D.scripts/bin/queuevid | 3---
D.scripts/bin/rfclookup | 47-----------------------------------------------
D.scripts/bin/shmenu | 55-------------------------------------------------------
D.scripts/bin/uptimemon | 43-------------------------------------------
D.scripts/bin/wbcachemake | 27---------------------------
R.scripts/bin/centre -> .scripts/centre | 0
R.scripts/bin/chradio -> .scripts/chradio | 0
R.scripts/bin/chrtmp -> .scripts/chrtmp | 0
R.scripts/bin/colotable -> .scripts/colotable | 0
R.scripts/bin/convf -> .scripts/convf | 0
A.scripts/crypto | 2++
R.scripts/bin/cst2secs -> .scripts/cst2secs | 0
R.scripts/bin/cu -> .scripts/cu | 0
R.scripts/bin/currency -> .scripts/currency | 0
D.scripts/custom/README | 1-
D.scripts/custom/dock | 3---
D.scripts/custom/eyes | 8--------
D.scripts/custom/mount | 3---
D.scripts/custom/sunglasses | 12------------
D.scripts/custom/umount | 4----
D.scripts/custom/undock | 8--------
R.scripts/bin/cvrestart -> .scripts/cvrestart | 0
R.scripts/bin/deexif -> .scripts/deexif | 0
R.scripts/bin/dgrep -> .scripts/dgrep | 0
R.scripts/bin/diary -> .scripts/diary | 0
R.scripts/bin/dict -> .scripts/dict | 0
R.scripts/bin/dimg -> .scripts/dimg | 0
R.scripts/bin/dnsbl -> .scripts/dnsbl | 0
R.scripts/bin/dpass -> .scripts/dpass | 0
R.scripts/bin/dupfind -> .scripts/dupfind | 0
R.scripts/bin/dwmbar/README -> .scripts/dwmbar/README | 0
R.scripts/bin/dwmbar/bat -> .scripts/dwmbar/bat | 0
R.scripts/bin/dwmbar/cal -> .scripts/dwmbar/cal | 0
R.scripts/bin/dwmbar/cpu -> .scripts/dwmbar/cpu | 0
R.scripts/bin/dwmbar/dwmbar -> .scripts/dwmbar/dwmbar | 0
R.scripts/bin/dwmbar/mail -> .scripts/dwmbar/mail | 0
R.scripts/bin/dwmbar/mem -> .scripts/dwmbar/mem | 0
R.scripts/bin/dwmbar/net -> .scripts/dwmbar/net | 0
R.scripts/bin/dwmbar/time -> .scripts/dwmbar/time | 0
R.scripts/bin/dwmbar/time2 -> .scripts/dwmbar/time2 | 0
R.scripts/bin/dwmbar/torrent -> .scripts/dwmbar/torrent | 0
R.scripts/bin/dwmbar/vol -> .scripts/dwmbar/vol | 0
R.scripts/bin/encsign -> .scripts/encsign | 0
R.scripts/bin/extracthls -> .scripts/extracthls | 0
R.scripts/bin/fetchmail -> .scripts/fetchmail | 0
R.scripts/bin/fileoccur -> .scripts/fileoccur | 0
R.scripts/bin/filesed -> .scripts/filesed | 0
R.scripts/bin/gdiffpager -> .scripts/gdiffpager | 0
R.scripts/bin/geo -> .scripts/geo | 0
R.scripts/bin/getascii -> .scripts/getascii | 0
R.scripts/bin/githubraw -> .scripts/githubraw | 0
R.scripts/bin/googlegopher -> .scripts/googlegopher | 0
A.scripts/gophcheck | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R.scripts/bin/gopherdl -> .scripts/gopherdl | 0
R.scripts/bin/gpgimport -> .scripts/gpgimport | 0
A.scripts/hlpaste | 18++++++++++++++++++
R.scripts/bin/hmpv -> .scripts/hmpv | 0
R.scripts/bin/hvol -> .scripts/hvol | 0
R.scripts/bin/imgclean -> .scripts/imgclean | 0
R.scripts/bin/infowall -> .scripts/infowall | 0
A.scripts/kshrcremote | 30++++++++++++++++++++++++++++++
R.scripts/bin/lsswp -> .scripts/lsswp | 0
R.scripts/bin/maemo-launch -> .scripts/maemo-launch | 0
R.scripts/bin/mailselect -> .scripts/mailselect | 0
D.scripts/man/.incomplete | 161-------------------------------------------------------------------------------
D.scripts/man/man1/rmpv-list.1 | 32--------------------------------
D.scripts/man/man1/rmpv.1 | 22----------------------
D.scripts/man/man1/seq.1o | 29-----------------------------
D.scripts/man/man1/tac.1o | 19-------------------
D.scripts/man/man5/rmpv-list.5 | 15---------------
D.scripts/man/man7/hhvn-obsd-compat.7 | 14--------------
D.scripts/man/man7/hhvn-scripts.7 | 11-----------
D.scripts/man/template-obsd.1 | 22----------------------
D.scripts/man/template-obsd.5 | 18------------------
D.scripts/man/template.1 | 17-----------------
D.scripts/man/template.5 | 14--------------
R.scripts/bin/manualpatch -> .scripts/manualpatch | 0
R.scripts/bin/markwatched -> .scripts/markwatched | 0
R.scripts/bin/mkmaildir -> .scripts/mkmaildir | 0
R.scripts/bin/musictag -> .scripts/musictag | 0
R.scripts/bin/musictaginteractive -> .scripts/musictaginteractive | 0
R.scripts/bin/musictagorder -> .scripts/musictagorder | 0
R.scripts/bin/mustfix -> .scripts/mustfix | 0
R.scripts/bin/mvmailbackup -> .scripts/mvmailbackup | 0
R.scripts/bin/netdownload -> .scripts/netdownload | 0
R.scripts/bin/newtab -> .scripts/newtab | 0
R.scripts/bin/notify -> .scripts/notify | 0
R.scripts/bin/notify-send -> .scripts/notify-send | 0
R.scripts/bin/number -> .scripts/number | 0
R.scripts/bin/nwatched -> .scripts/nwatched | 0
R.scripts/bin/open -> .scripts/open | 0
R.scripts/bin/passgpg -> .scripts/passgpg | 0
R.scripts/bin/passgpg2 -> .scripts/passgpg2 | 0
R.scripts/bin/pexelgrab -> .scripts/pexelgrab | 0
R.scripts/bin/plumb -> .scripts/plumb | 0
R.scripts/bin/pman -> .scripts/pman | 0
R.scripts/bin/qmap -> .scripts/qmap | 0
R.scripts/bin/qmv -> .scripts/qmv | 0
A.scripts/queuevid | 10++++++++++
R.scripts/bin/quik -> .scripts/quik | 0
R.scripts/bin/radio -> .scripts/radio | 0
D.scripts/random/example-args.sh | 21---------------------
D.scripts/random/gnulinux.sh | 3---
D.scripts/random/rev | 14--------------
D.scripts/random/ytsrch | 70----------------------------------------------------------------------
A.scripts/rfclookup | 47+++++++++++++++++++++++++++++++++++++++++++++++
R.scripts/bin/rmpatch -> .scripts/rmpatch | 0
R.scripts/bin/rmsshsock -> .scripts/rmsshsock | 0
R.scripts/bin/rwall -> .scripts/rwall | 0
R.scripts/bin/scrape/debug -> .scripts/scrape/debug | 0
R.scripts/bin/scrape/youtube -> .scripts/scrape/youtube | 0
R.scripts/bin/screenoff -> .scripts/screenoff | 0
R.scripts/bin/secs2cst -> .scripts/secs2cst | 0
R.scripts/bin/service -> .scripts/service | 0
R.scripts/bin/sfeed_addfeed -> .scripts/sfeed_addfeed | 0
A.scripts/shmenu | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R.scripts/bin/slock_mod -> .scripts/slock_mod | 0
R.scripts/bin/slopvid -> .scripts/slopvid | 0
R.scripts/bin/somafm -> .scripts/somafm | 0
R.scripts/bin/srxsrch -> .scripts/srxsrch | 0
R.scripts/bin/sshdatesync -> .scripts/sshdatesync | 0
R.scripts/bin/sshtar -> .scripts/sshtar | 0
R.scripts/bin/sttab -> .scripts/sttab | 0
R.scripts/bin/sudo -> .scripts/sudo | 0
R.scripts/bin/swamp -> .scripts/swamp | 0
R.scripts/bin/textdisplay -> .scripts/textdisplay | 0
R.scripts/bin/thesaurus -> .scripts/thesaurus | 0
R.scripts/bin/tlds -> .scripts/tlds | 0
R.scripts/bin/tmuxkillshell -> .scripts/tmuxkillshell | 0
R.scripts/bin/topen -> .scripts/topen | 0
R.scripts/bin/torlist -> .scripts/torlist | 0
R.scripts/bin/torrents -> .scripts/torrents | 0
R.scripts/bin/tsclean -> .scripts/tsclean | 0
R.scripts/bin/ttyblocks -> .scripts/ttyblocks | 0
R.scripts/bin/uniqfind -> .scripts/uniqfind | 0
A.scripts/uptimemon | 44++++++++++++++++++++++++++++++++++++++++++++
R.scripts/bin/urlencode -> .scripts/urlencode | 0
R.scripts/bin/urlhand -> .scripts/urlhand | 0
R.scripts/bin/urlhand2 -> .scripts/urlhand2 | 0
R.scripts/bin/voidupdate -> .scripts/voidupdate | 0
R.scripts/bin/wallblur -> .scripts/wallblur | 0
R.scripts/bin/wallp -> .scripts/wallp | 0
A.scripts/wbcachemake | 27+++++++++++++++++++++++++++
R.scripts/bin/yt/feed -> .scripts/yt/feed | 0
R.scripts/bin/yt/meta -> .scripts/yt/meta | 0
R.scripts/bin/yt/srch2 -> .scripts/yt/srch2 | 0
R.scripts/bin/yt/srch2-sort -> .scripts/yt/srch2-sort | 0
161 files changed, 321 insertions(+), 817 deletions(-)

diff --git a/.scripts/bin/PATH b/.scripts/PATH diff --git a/.scripts/bin/addrbook b/.scripts/addrbook diff --git a/.scripts/bin/addtorrent b/.scripts/addtorrent diff --git a/.scripts/bin/asciiclip b/.scripts/asciiclip diff --git a/.scripts/bin/asplit b/.scripts/asplit diff --git a/.scripts/bin/autowifi b/.scripts/autowifi diff --git a/.scripts/bin/backronym b/.scripts/backronym diff --git a/.scripts/bin/bandcampdl b/.scripts/bandcampdl diff --git a/.scripts/bin/bandcampsrch b/.scripts/bandcampsrch diff --git a/.scripts/bin b/.scripts/bin @@ -0,0 +1 @@ +. +\ No newline at end of file diff --git a/.scripts/bin/crypto b/.scripts/bin/crypto @@ -1 +0,0 @@ -currency -\ No newline at end of file diff --git a/.scripts/bin/gophcheck b/.scripts/bin/gophcheck @@ -1,80 +0,0 @@ -#!/bin/sh -# -# gophcheck.sh -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. - -# downloads & caches gophermaps -# compares later updates -# usage: gophcheck (compares the "current" files and "old") -# gophcheck update (moves the "current" files to "old", and pulls in new -# "current" files) - -# configuration: -uris="gopher://1436.ninja/1/Phlog -gopher://nebulacentre.net/1 -gopher://wfnintr.net/ -gopher://go-beyond.org/ -gopher://bitreich.org/1/news.gph -gopher://baud.baby/1/phlog -gopher://dataswamp.org/1/~solene -gopher://codevoid.de/1" -readcmd="cgo -f" - -cache=${XDG_CACHE_HOME:=$HOME/.cache} -old=$cache/gophcheck/old -current=$cache/gophcheck/current -mkdir -p $old $current - -echo(){ - printf "%s\n" "$@" -} - -[ ! -z $1 ] && { - [ "$1" = "update" ] && { - rm -rf $old/* - mv $current/* $old - for u in $uris - do - name=$(echo "$u" | tr '/' '%') - curl -qs $u > $current/$name && echo "[$(tput setaf 40)OKAY$(tput sgr0)] $u" || echo "[$(tput setaf 88)FAIL$(tput sgr0)] $u" - done - } || { - echo "No such command, edit/read script for configuration/usage" - exit 1 - } -} - -tmp=$HOME/net/gophcheck.tmp -for f in $(ls $current) -do - f2="$old/$f" - f3="$current/$f" - [ -f $f2 ] && { - diff=$(diff $f2 $f3 | grep '^>' | sed -E 's/> (.*)/\1/') - echo "$diff" | grep '[[:alnum:]]' >/dev/null && { - echo "[$(tput setaf 40) DIFF$(tput sgr0)] $(echo "$f" | tr '%' '/')" - echo "i$f null null null" | tr '%' '/' >> $tmp - echo "$diff" >> $tmp - echo "i null null null" >> $tmp - ydiff="y" - } || echo "[$(tput setaf 88)NODIFF$(tput sgr0)] $(echo "$f" | tr '%' '/')" - } || cp $f3 $f2 -done - -trap "rm $tmp; exit 0" 2 -[ "$ydiff" = "y" ] && clear && cgo haydenvh.com/1/gophcheck.tmp diff --git a/.scripts/bin/hlpaste b/.scripts/bin/hlpaste @@ -1,10 +0,0 @@ -#!/bin/sh -# usage: <command> | hlpaste [file extension] -# hlpaste [file extension] < /path/to/file - -cp /dev/stdin /tmp/hlpaste -id=$(mktemp -u p/XXXXXXXXXXXXXX) - -gtype=$(file /tmp/hlpaste | tr '[:upper:]' '[:lower:]' | sed -E 's~.*(binary|video|audio).*~9~;s~.*image.*~I~' | grep -o '^.$' || echo "0") -scp /tmp/hlpaste hlirc.net:/var/gopher/$id.${1:-txt} >/dev/null -printf "gopher://hlirc.net/$gtype/$id.${1:-txt}\n" | tee /dev/stderr | tr -d '\n' | xclip diff --git a/.scripts/bin/kshrcremote b/.scripts/bin/kshrcremote @@ -1,29 +0,0 @@ -#!/bin/sh - -[ -z $1 ] && echo "usage: kshrcremote <[user@]hostname> [other users]" && exit 1 -host=$1 -shift - -for i in 8 9 10 11 12 13 14 15 -do - tput setab $i - printf ' ' - tput sgr0 - tput setaf $i - printf '%03d' $i - tput sgr0 - tput setab $i - printf ' ' - tput sgr0 - echo -done -printf "Colour? " -read c </dev/tty - -cat $HOME/.config/ksh/* | sed -E "s/setaf 5/setaf $c/g;"'s/setaf ([0-9]*)/setaf \1 \1 \1/g' > /tmp/kshrc -scp /tmp/kshrc $host:.profile -for u in $@ -do - ssh -o "ControlMaster=auto" -o "ControlPath=/tmp/kshrcremote.%h.%p.%r.sock" -o "ControlPersist=1m" $host sh -c 'sudo cp $HOME/.profile '"/home/$u/.profile"' && doas cp $HOME/.profile'"/home/$u/.profile" -done -ssh $host diff --git a/.scripts/bin/queuevid b/.scripts/bin/queuevid @@ -1,3 +0,0 @@ -#!/bin/sh - -ts "cd ~/general/videos/ && youtube-dl --add-metadata -ic $(xclip -o)" diff --git a/.scripts/bin/rfclookup b/.scripts/bin/rfclookup @@ -1,47 +0,0 @@ -#!/bin/sh -# -# rfclookup.sh -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. - -index=https://www.ietf.org/download/rfc-index.txt -document="https://www.ietf.org/rfc/rfc%s.txt" - -usage(){ - base=$(basename "$0") - printf "usage: %s -s <search query>\n" "$base" - printf "\t %s -n <number>\n" "$base" - printf "\t %s -u <number>\n" "$base" -} - -case "$1" in --s) - curl -i $index | - tr '\n' '\t' | - sed 's/\t\t/\n/g' | - tr '\t' ' ' | - tr -s ' ' | - grep '^[0-9][0-9][0-9][0-9] ' | - grep -iE "$2" - ;; --n) - curl -s $(printf "$document\n" "$2") | less - ;; --u) - printf "$document\n" "$2" - ;; -esac diff --git a/.scripts/bin/shmenu b/.scripts/bin/shmenu @@ -1,55 +0,0 @@ -#!/bin/bash - -[ -z $1 ] && echo "usage: shmenu <prompt> - -stdin is given to the user to search through -stdout contains the selection -stderr contains the user interface - -Use ctrl+h or ctrl+l to navigate between options." && exit - -cleanup(){ - clear > /dev/stderr - echo "$files" | grep -i "$query" | tail -n $selected | head -n 1 - exit -} - -files=$(cat /dev/stdin) -tput civis - -selected=1 -IFS='' -while true -do - query=".*$(echo "$prev" | sed 's/./&\.\*/g')" # fuzzyfy - output=$(echo "$files" | grep -i "$query") - [ "$output" != "$oldoutput" ] && { - clear > /dev/stderr - echo "$output" | sed 's/^/ /g' > /dev/stderr - printf "$(tput setaf 10)$1>$(tput sgr0) $prev" > /dev/stderr - } - [ $(echo "$output" | wc -l) -gt $(tput lines) ] && { - len=$(($(tput lines)-1-$selected)) - } || { - len=$(($(echo "$output" | wc -l)-$selected)) - } - tput sc >/dev/stderr - tput cup $(($len-1)) 0 >/dev/stderr - printf ' ' >/dev/stderr - tput cup $(($len)) 0 >/dev/stderr - tput setaf 7 >/dev/stderr - printf -- '>-' >/dev/stderr - tput sgr0 >/dev/stderr - tput cup $(($len+1)) 0 >/dev/stderr - printf ' ' - tput rc >/dev/stderr - tput cnorm - read -rsn1 key < /dev/tty - tput civis - oldoutput="$output" - [ "$key" = "$(echo)" ] && cleanup - echo "$key" | grep "">/dev/null && selected=$(($selected+1)) && continue - echo "$key" | grep " ">/dev/null && { [ ! $selected -eq 1 ] && selected=$(($selected-1)); } && continue - newkey=$(echo "$key" | grep '[[:print:]]') - [ "$newkey" = "" ] && prev=$(echo "$prev" | sed 's/.$//') || prev="${prev}${newkey}" -done diff --git a/.scripts/bin/uptimemon b/.scripts/bin/uptimemon @@ -1,43 +0,0 @@ -#!/bin/sh -# -# uptimemon.sh - monitor and record uptime (records) -# -# hayden@hhvn.uk -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. - -d=$HOME/net/exec/uptime - -for s in matrix.hhvn.uk hhvn.uk irc1 irc2 dumbterm.hhvn.uk phony.hhvn.uk port.hhvn.uk mx1.hhvn.uk -do - curr=$(ssh $s uptime | grep 'days' | awk '{print $3}' | grep '^[^:]*$' || echo 0) - ssh $s uptime >/dev/null && down=n || down=y # run the cmd again - variable can't be set - # in substitions - [ ! -f $d/$s ] && echo "curr $curr" > $d/$s - [ -f $d/$s ] && { - awk -F" " -v "curr=${curr:-0}" ' - $1 == "curr" { - if ($2 > curr) { - print "curr " curr - print "record " $2 - } else { - print "curr " curr - } - } - $1 == "record"' < $d/$s > $d/$s.new - mv $d/$s.new $d/$s - [ "$down" = "y" ] && chmod +x $d/$s || chmod -x $d/$s # use executable perm to - # signal to uptime.dcgi - } -done diff --git a/.scripts/bin/wbcachemake b/.scripts/bin/wbcachemake @@ -1,27 +0,0 @@ -#!/bin/sh -# usage: wbcachemake - -cache=$HOME/general/cache/ - -donorm(){ - [ "$args" = "" ] && { - convert $file -sparse-color Barycentric '0,0 black 0,%h white' -function polynomial 3.5,-3.2,1.15 /tmp/blurmap.png - convert $file /tmp/blurmap.png -compose Blur -set option:compose:args 9 -composite $1 - } || { - convert $file $args $1 - } - files="$files $1" -} - -mkdir -p $cache/wallblur - -files=$(find images/wallpapers/ -type f -name "*.png") - -for file in $files -do - [ ! -f $cache/wallblur/$(basename "$file") ] && { - echo $file start - donorm "$cache/wallblur/$(basename $file)" - echo $file done - } -done diff --git a/.scripts/bin/centre b/.scripts/centre diff --git a/.scripts/bin/chradio b/.scripts/chradio diff --git a/.scripts/bin/chrtmp b/.scripts/chrtmp diff --git a/.scripts/bin/colotable b/.scripts/colotable diff --git a/.scripts/bin/convf b/.scripts/convf diff --git a/.scripts/crypto b/.scripts/crypto @@ -0,0 +1 @@ +currency +\ No newline at end of file diff --git a/.scripts/bin/cst2secs b/.scripts/cst2secs diff --git a/.scripts/bin/cu b/.scripts/cu diff --git a/.scripts/bin/currency b/.scripts/currency diff --git a/.scripts/custom/README b/.scripts/custom/README @@ -1 +0,0 @@ -These are scripts that suite my specific hardware - don't expect them to work out of the box. diff --git a/.scripts/custom/dock b/.scripts/custom/dock @@ -1,3 +0,0 @@ -#!/bin/sh - -xrandr --output LVDS1 --off --output VGA1 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI1 --off --output DP1 --off --output HDMI2 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP2 --off --output DP3 --off --output TV1 --off diff --git a/.scripts/custom/eyes b/.scripts/custom/eyes @@ -1,8 +0,0 @@ -#!/bin/sh -# reverse of sunglasses - -pkill redshift -xrandr --output HDMI2 --brightness 1.15 -xrandr --output VGA1 --brightness 1.15 -sleep 3 -nohup redshift & diff --git a/.scripts/custom/mount b/.scripts/custom/mount @@ -1,3 +0,0 @@ -#!/bin/sh - -sshfs -o allow_other local:/srv/zfs $HOME/general diff --git a/.scripts/custom/sunglasses b/.scripts/custom/sunglasses @@ -1,12 +0,0 @@ -#!/bin/sh -# my monitors face the windows, so sometimes when it's bright I like to wear sunglasses. -# To do this I first double the gamma of my displays with this script. -# sun = 1.0 -# screen = 2.0 -# sun + sunglasses = 0.5 -# screen + glasess = 1.0 - -pkill redshift -sleep 1 -xrandr --output HDMI2 --brightness 2.0 -xrandr --output VGA1 --brightness 2.0 diff --git a/.scripts/custom/umount b/.scripts/custom/umount @@ -1,4 +0,0 @@ -#!/bin/sh - -doas pkill sshfs -doas umount -l $HOME/general diff --git a/.scripts/custom/undock b/.scripts/custom/undock @@ -1,8 +0,0 @@ -#!/bin/sh - -for d in "LVDS1" "VGA1" "HDMI2" -do - xrandr --output $d --off -done - -xrandr --output LVDS1 --mode 1280x800 diff --git a/.scripts/bin/cvrestart b/.scripts/cvrestart diff --git a/.scripts/bin/deexif b/.scripts/deexif diff --git a/.scripts/bin/dgrep b/.scripts/dgrep diff --git a/.scripts/bin/diary b/.scripts/diary diff --git a/.scripts/bin/dict b/.scripts/dict diff --git a/.scripts/bin/dimg b/.scripts/dimg diff --git a/.scripts/bin/dnsbl b/.scripts/dnsbl diff --git a/.scripts/bin/dpass b/.scripts/dpass diff --git a/.scripts/bin/dupfind b/.scripts/dupfind diff --git a/.scripts/bin/dwmbar/README b/.scripts/dwmbar/README diff --git a/.scripts/bin/dwmbar/bat b/.scripts/dwmbar/bat diff --git a/.scripts/bin/dwmbar/cal b/.scripts/dwmbar/cal diff --git a/.scripts/bin/dwmbar/cpu b/.scripts/dwmbar/cpu diff --git a/.scripts/bin/dwmbar/dwmbar b/.scripts/dwmbar/dwmbar diff --git a/.scripts/bin/dwmbar/mail b/.scripts/dwmbar/mail diff --git a/.scripts/bin/dwmbar/mem b/.scripts/dwmbar/mem diff --git a/.scripts/bin/dwmbar/net b/.scripts/dwmbar/net diff --git a/.scripts/bin/dwmbar/time b/.scripts/dwmbar/time diff --git a/.scripts/bin/dwmbar/time2 b/.scripts/dwmbar/time2 diff --git a/.scripts/bin/dwmbar/torrent b/.scripts/dwmbar/torrent diff --git a/.scripts/bin/dwmbar/vol b/.scripts/dwmbar/vol diff --git a/.scripts/bin/encsign b/.scripts/encsign diff --git a/.scripts/bin/extracthls b/.scripts/extracthls diff --git a/.scripts/bin/fetchmail b/.scripts/fetchmail diff --git a/.scripts/bin/fileoccur b/.scripts/fileoccur diff --git a/.scripts/bin/filesed b/.scripts/filesed diff --git a/.scripts/bin/gdiffpager b/.scripts/gdiffpager diff --git a/.scripts/bin/geo b/.scripts/geo diff --git a/.scripts/bin/getascii b/.scripts/getascii diff --git a/.scripts/bin/githubraw b/.scripts/githubraw diff --git a/.scripts/bin/googlegopher b/.scripts/googlegopher diff --git a/.scripts/gophcheck b/.scripts/gophcheck @@ -0,0 +1,79 @@ +#!/bin/sh +# +# gophcheck.sh +# Created by Hayden Hamilton +# +# hayden@haydenvh.com +# Copyright (c) 2020 Hayden Hamilton +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# This work is free. You can redistribute it and/or modify it under the +# terms of the Do What The Fuck You Want To Public License, Version 2, +# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. + +# downloads & caches gophermaps +# compares later updates +# usage: gophcheck (compares the "current" files and "old") +# gophcheck update (moves the "current" files to "old", and pulls in new +# "current" files) + +# configuration: +uris="gopher://1436.ninja/1/Phlog +gopher://nebulacentre.net/1 +gopher://go-beyond.org/ +gopher://bitreich.org/1/news.gph +gopher://baud.baby/1/phlog +gopher://dataswamp.org/1/~solene +gopher://codevoid.de/1" +readcmd="cgo -f" + +cache=${XDG_CACHE_HOME:=$HOME/.cache} +old=$cache/gophcheck/old +current=$cache/gophcheck/current +mkdir -p $old $current + +echo(){ + printf "%s\n" "$@" +} + +[ ! -z $1 ] && { + [ "$1" = "update" ] && { + rm -rf $old/* + mv $current/* $old + for u in $uris + do + name=$(echo "$u" | tr '/' '%') + curl -qs $u > $current/$name && echo "[$(tput setaf 40)OKAY$(tput sgr0)] $u" || echo "[$(tput setaf 88)FAIL$(tput sgr0)] $u" + done + } || { + echo "No such command, edit/read script for configuration/usage" + exit 1 + } +} + +tmp=$HOME/net/gophcheck.tmp +for f in $(ls $current) +do + f2="$old/$f" + f3="$current/$f" + [ -f $f2 ] && { + diff=$(diff $f2 $f3 | grep '^>' | sed -E 's/> (.*)/\1/') + echo "$diff" | grep '[[:alnum:]]' >/dev/null && { + echo "[$(tput setaf 40) DIFF$(tput sgr0)] $(echo "$f" | tr '%' '/')" + echo "i$f null null null" | tr '%' '/' >> $tmp + echo "$diff" >> $tmp + echo "i null null null" >> $tmp + ydiff="y" + } || echo "[$(tput setaf 88)NODIFF$(tput sgr0)] $(echo "$f" | tr '%' '/')" + } || cp $f3 $f2 +done + +trap "rm $tmp; exit 0" 2 +[ "$ydiff" = "y" ] && clear && cgo haydenvh.com/1/gophcheck.tmp diff --git a/.scripts/bin/gopherdl b/.scripts/gopherdl diff --git a/.scripts/bin/gpgimport b/.scripts/gpgimport diff --git a/.scripts/hlpaste b/.scripts/hlpaste @@ -0,0 +1,18 @@ +#!/bin/sh +# usage: <command> | hlpaste [file extension] +# hlpaste [file extension] < /path/to/file + +cp /dev/stdin /tmp/hlpaste +id=$(sha512sum < /tmp/hlpaste | grep -Eo '^.{15}') +fileext="${1:-txt}" +gtype=$(file /tmp/hlpaste | + tr '[:upper:]' '[:lower:]' | + sed -E 's~.*(binary|video|audio).*~9~;s~.*image.*~I~' | + grep -o '^.$' || echo "0") + +file="$id.$fileext" +path="$HOME/net/paste/$file" +uri="gopher://hhvn.uk/$gtype/paste/$file" +mv /tmp/hlpaste "$path" + +echo "$uri" | tee /dev/stderr | tr -d '\n' | xclip diff --git a/.scripts/bin/hmpv b/.scripts/hmpv diff --git a/.scripts/bin/hvol b/.scripts/hvol diff --git a/.scripts/bin/imgclean b/.scripts/imgclean diff --git a/.scripts/bin/infowall b/.scripts/infowall diff --git a/.scripts/kshrcremote b/.scripts/kshrcremote @@ -0,0 +1,30 @@ +#!/bin/sh + +[ -z $1 ] && echo "usage: kshrcremote <[user@]hostname> [other users]" && exit 1 +host=$1 +shift + +for i in 8 9 10 11 12 13 14 15 +do + tput setab $i + printf ' ' + tput sgr0 + tput setaf $i + printf '%03d' $i + tput sgr0 + tput setab $i + printf ' ' + tput sgr0 + echo +done +printf "Colour? " +read c </dev/tty + +rm /tmp/kshrc +cat $HOME/.config/ksh/* | sed -E "s/setaf 5/setaf $c/g;"'s/setaf ([0-9]*)/setaf \1 \1 \1/g' > /tmp/kshrc +scp /tmp/kshrc $host:.profile +for u in $@ +do + ssh -o "ControlMaster=auto" -o "ControlPath=/tmp/kshrcremote.%h.%p.%r.sock" -o "ControlPersist=1m" $host sh -c 'sudo cp $HOME/.profile '"/home/$u/.profile"' && doas cp $HOME/.profile'"/home/$u/.profile" +done +ssh $host diff --git a/.scripts/bin/lsswp b/.scripts/lsswp diff --git a/.scripts/bin/maemo-launch b/.scripts/maemo-launch diff --git a/.scripts/bin/mailselect b/.scripts/mailselect diff --git a/.scripts/man/.incomplete b/.scripts/man/.incomplete @@ -1,161 +0,0 @@ -[ ] bin/passgpg -[ ] bin/newtab -[ ] bin/rmpv -[ ] bin/sshtar -[ ] bin/mpvrcp-tmux -[ ] bin/rfclookup -[ ] bin/terminalimg -[ ] bin/slopvid -[ ] bin/chrtmp -[ ] bin/mpvlisten -[ ] bin/musictag -[ ] bin/ttyblocks -[ ] bin/ytsrch2 -[ ] bin/vimbhist -[ ] bin/thesaurus -[ ] bin/dimg -[ ] bin/dmon -[ ] bin/dmpv -[ ] bin/geo -[ ] bin/wpa2-brute-force -[ ] bin/mkcd -[ ] bin/popupcurl -[ ] bin/surf-css-disable -[ ] bin/number -[ ] bin/chradio -[ ] bin/ix -[ ] bin/whatdoido -[ ] bin/toxclip -[ ] bin/quik -[ ] bin/backronym -[ ] bin/hmpv -[ ] bin/ytchannelid -[ ] bin/currency -[ ] bin/stockcalc -[ ] bin/wifioff -[ ] bin/0x0 -[ ] bin/encsign -[ ] bin/diary -[ ] bin/githubraw -[ ] bin/queuevid -[ ] bin/dupfind -[ ] bin/xman -[ ] bin/convf -[ ] bin/rmsshsock -[ ] bin/getascii -[ ] bin/screenoff -[ ] bin/mkmaildir -[ ] bin/srssbnbc -[ ] bin/topen -[ ] bin/mpvms -[ ] bin/wfnintrpaste -[ ] bin/mailaddheader -[ ] bin/sxhkdrestart -[ ] bin/hlock -[ ] bin/tmuxkillshell -[ ] bin/hbnc -[ ] bin/me0w -[ ] bin/mustfix -[ ] bin/mvmailbackup -[ ] bin/sudo -[ ] bin/sttab -[ ] bin/maemo-launch -[ ] bin/autowifi -[ ] bin/addrbook -[ ] bin/extracthls -[ ] bin/torrentdone -[ ] bin/cu -[ ] bin/bandcampdl -[ ] bin/popupmpv -[ ] bin/monitors.sh -[ ] bin/patchmultibranch -[ ] bin/hlpaste -[ ] bin/mpvrcp-keys -[ ] bin/hvol -[ ] bin/gopherdl -[ ] bin/urlencode -[ ] bin/dinput -[ ] bin/tsclean -[ ] bin/shmenu -[ ] bin/dpass -[ ] bin/popupcgo -[ ] bin/uptimemon -[ ] bin/art -[ ] bin/sshdatesync -[ ] bin/popupcurl2 -[ ] bin/voidupdate -[ ] bin/rmpatch -[ ] bin/servicename -[ ] bin/pipes -[ ] bin/dfm -[ ] bin/wallp -[ ] bin/surf-css-enable -[ ] bin/stupidhash -[ ] bin/cvrestart -[ ] bin/mpvout2asplit -[ ] bin/rand-sig -[ ] bin/wbcachemake -[ ] bin/dict -[ ] bin/irc2matrix -[ ] bin/netread -[ ] bin/infowall -[ ] bin/dbrowse -[ ] bin/kshrcremote -[ ] bin/asplit -[ ] bin/qmv -[ ] bin/dmpvurl -[ ] bin/dnsbl -[ ] bin/trimfiles -[ ] bin/secs2cst -[ ] bin/passgpg2 -[ ] bin/netimg -[ ] bin/wallvar -[ ] bin/fetchmail -[ ] bin/netdownload -[ ] bin/notify -[ ] bin/addtorrent -[ ] bin/netpdf -[ ] bin/manualpatch -[ ] bin/musictaginteractive -[ ] bin/alcl -[ ] bin/nwatched -[ ] bin/colotable -[ ] bin/gophcheck -[ ] bin/srxsrch -[ ] bin/markwatched -[ ] bin/wallblur -[ ] bin/crefresh -[ ] bin/fehffile -[ ] bin/uniqfind -[ ] bin/mailarch -[ ] bin/ytmeta -[ ] bin/finger -[ ] bin/colour-wall -[ ] bin/rmpv-list -[ ] bin/reminder -[ ] bin/filesed -[ ] bin/swamp -[ ] bin/rwall -[ ] bin/slock_mod -[ ] bin/ffflaunch -[ ] bin/mailselect -[ ] bin/pman -[ ] bin/mpvrcp -[ ] bin/torrents -[ ] bin/bandcampsrch -[ ] bin/asciiclip -[ ] bin/urlhand -[ ] bin/qmap -[ ] bin/textdisplay -[ ] bin/dgrep -[ ] bin/googlegopher -[ ] bin/PATH -[ ] bin/urlhand2 -[ ] bin/cst2secs -[ ] bin/pexelgrab -[ ] bin/open -[ ] bin/centre -[ ] bin/radio -[ ] bin/popupw3m -[ ] bin/torlist -[ ] bin/hb diff --git a/.scripts/man/man1/rmpv-list.1 b/.scripts/man/man1/rmpv-list.1 @@ -1,32 +0,0 @@ -.Dd hhvn-scripts -.Dt rmpv-list 1 -.Sh NAME -.Nm rmpv-list -.Nd manipulate -.Xr rmpv-list 5 -files for use with -.Xr rmpv 1 -.Sh SYNOPSIS -.Nm -.Fl c -.Ar directory -.Nm -.Fl m -.Ar list -.Ar file -.Ar weight -.Sh OPTIONS -.Fl c -\ \ create new list from scratch by finding all files in the -.Ar directory . -.Fl m -\ \ edit the weight of the given -.Ar file -in a given -.Ar list . -.Sh SEE ALSO -.Xr rmpv-list 5 , -.Xr rmpv 1 , -.Xr hhvn-scripts 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man1/rmpv.1 b/.scripts/man/man1/rmpv.1 @@ -1,22 +0,0 @@ -.Dd hhvn-scripts -.Dt rmpv 1 -.Sh NAME -.Nm rmpv -.Nd pseudo-random playing of music/video via mpv -.Sh SYNOPSIS -.Nm -.Ar dir/ -.Nm -.Ar dir/list -.Sh DESCRIPTION -Lists are in the -.Xr rmpv-list 5 -format, and allow for more fine-grained tuning of the pseudo-random (you can prefer certain files, or blacklist them, all without messing with the files themsevles). - -If either argument match "music" the --no-video argument will be passed to mpv. -.Sh SEE ALSO -.Xr rmpv-list 1 , -.Xr rmpv-list 5 , -.Xr hhvn-scripts 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man1/seq.1o b/.scripts/man/man1/seq.1o @@ -1,29 +0,0 @@ -.Dd hhvn-obsd-compat -.Dt $PROGNAME 1 -.Sh PROLOGUE -These scripts are barebone replicas of some GNU programs that I miss on openbsd - -IMO, this is the lazy method of ensuring compatibility :) -.Sh NAME -.Nm seq -.Nd sequential number generation -.Sh SYNOPSIS -.Nm -.Ar LAST -.Nm -.Ar FIRST -.Ar LAST -.Nm -.Ar FIRST -.Ar INCREMENT -.Ar LAST -.Sh DESCRIPTION -.Ar FIRST -and -.Ar INCREMENT -default to 1. -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Xr hhvn-obsd-compat 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man1/tac.1o b/.scripts/man/man1/tac.1o @@ -1,19 +0,0 @@ -.Dd hhvn-obsd-compat -.Dt tac 1 -.Sh PROLOGUE -These scripts are barebone replicas of some GNU programs that I miss on openbsd - -IMO, this is the lazy method of ensuring compatibility :) -.Sh NAME -.Nm tac -.Nd print last line of last -.Ar file -(or stdin). -.Sh SYNOPSIS -.Nm -.Ar "[" files "]" -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Xr hhvn-obsd-compat 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man5/rmpv-list.5 b/.scripts/man/man5/rmpv-list.5 @@ -1,15 +0,0 @@ -.Dd hhvn-scripts -.Dt rmpv-list 5 -.Sh NAME -.Nm rmpv-list -.Nd weighted list for a pseudo-random file-picker -.Sh FORMAT -.Ar file -\\t -.Ar weight -.Sh SEE ALSO -.Xr rmpv 1 , -.Xr rmpv-list 1 , -.Xr hhvn-scripts 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man7/hhvn-obsd-compat.7 b/.scripts/man/man7/hhvn-obsd-compat.7 @@ -1,14 +0,0 @@ -.Dd hhvn-obsd-compat -.Dt hhvn-obsd-compat 7 -.Sh NAME -.Nm hhvn-obsd-compat -.Sh DESCRIPTION -These scripts are barebone replicas of some GNU programs that I miss on openbsd - -IMO, this is the lazy method of ensuring compatibility :) -.Sh FILES -$HOME/.scripts/openbsd-compat -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/man7/hhvn-scripts.7 b/.scripts/man/man7/hhvn-scripts.7 @@ -1,11 +0,0 @@ -.Dd hhvn-scripts -.Dt hhvn-scripts 7 -.Sh NAME -.Nm hhvn-scripts -.Nd scripts suited mostly for my (possibly unique) needs -.Sh FILES -$HOME/.scripts/bin -.Sh SEE ALSO -.Xr hhvn-obsd-compat 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/template-obsd.1 b/.scripts/man/template-obsd.1 @@ -1,22 +0,0 @@ -.Dd hhvn-obsd-compat -.Dt $PROGNAME 1 -.Sh PROLOGUE -These scripts are barebone replicas of some GNU programs that I miss on openbsd - -IMO, this is the lazy method of ensuring compatibility :) -.Sh NAME -.Nm $PROGNAME -.Nd $PROGDEF -.Sh SYNOPSIS -.Nm -.Ar $PROGARG -.Fl $PROGOPT -.Sh DESCRIPTION -$PROGDESC - -use: /$$PROG[^ ]* in vim -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Xr hhvn-obsd-compat 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/template-obsd.5 b/.scripts/man/template-obsd.5 @@ -1,18 +0,0 @@ -.Dd hhvn-obsd-compat -.Dt $PROGNAME 5 -.Sh PROLOGUE -These scripts are barebone replicas of some GNU programs that I miss on openbsd - -IMO, this is the lazy method of ensuring compatibility :) -.Sh NAME -.Nm $FORMNAME -.Nd $FORMDEF -.Sh DESCRIPTION -$FORMDESC - -use: /$$FORM[^ ]* in vim -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Xr hhvn-obsd-compat 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/template.1 b/.scripts/man/template.1 @@ -1,17 +0,0 @@ -.Dd hhvn-scripts -.Dt $PROGNAME 1 -.Sh NAME -.Nm $PROGNAME -.Nd $PROGDEF -.Sh SYNOPSIS -.Nm -.Ar $PROGARG -.Fl $PROGOPT -.Sh DESCRIPTION -$PROGDESC - -use: /$$PROG[^ ]* in vim -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/man/template.5 b/.scripts/man/template.5 @@ -1,14 +0,0 @@ -.Dd hhvn-scripts -.Dt $FORMNAME 5 -.Sh NAME -.Nm $FORMNAME -.Nd $FORMDEF -.Sh DESCRIPTION -$FORMDESC - -use: /$$FORM[^ ]* in vim -.Sh SEE ALSO -.Xr hhvn-scripts 7 -.Xr $FORMUSED 1 -.Sh AUTHOR -.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/bin/manualpatch b/.scripts/manualpatch diff --git a/.scripts/bin/markwatched b/.scripts/markwatched diff --git a/.scripts/bin/mkmaildir b/.scripts/mkmaildir diff --git a/.scripts/bin/musictag b/.scripts/musictag diff --git a/.scripts/bin/musictaginteractive b/.scripts/musictaginteractive diff --git a/.scripts/bin/musictagorder b/.scripts/musictagorder diff --git a/.scripts/bin/mustfix b/.scripts/mustfix diff --git a/.scripts/bin/mvmailbackup b/.scripts/mvmailbackup diff --git a/.scripts/bin/netdownload b/.scripts/netdownload diff --git a/.scripts/bin/newtab b/.scripts/newtab diff --git a/.scripts/bin/notify b/.scripts/notify diff --git a/.scripts/bin/notify-send b/.scripts/notify-send diff --git a/.scripts/bin/number b/.scripts/number diff --git a/.scripts/bin/nwatched b/.scripts/nwatched diff --git a/.scripts/bin/open b/.scripts/open diff --git a/.scripts/bin/passgpg b/.scripts/passgpg diff --git a/.scripts/bin/passgpg2 b/.scripts/passgpg2 diff --git a/.scripts/bin/pexelgrab b/.scripts/pexelgrab diff --git a/.scripts/bin/plumb b/.scripts/plumb diff --git a/.scripts/bin/pman b/.scripts/pman diff --git a/.scripts/bin/qmap b/.scripts/qmap diff --git a/.scripts/bin/qmv b/.scripts/qmv diff --git a/.scripts/queuevid b/.scripts/queuevid @@ -0,0 +1,10 @@ +#!/bin/sh + +[ "$1" = "ts" ] && { + mkdir -p $HOME/general/videos/copy + youtube-dl --format="(bestvideo[height<=640]+bestaudio)[ext=webm]/bestvideo[height<=640]+bestaudio/best[height<=640]/bestvideo+bestaudio/best" --add-metadata -ic "$2" -o "$HOME/general/videos/copy/%(uploader)s-%(title)s.%(ext)s" +} + +[ "$1" != "ts" ] && { + ts "$0" "ts" "$1" +} diff --git a/.scripts/bin/quik b/.scripts/quik diff --git a/.scripts/bin/radio b/.scripts/radio diff --git a/.scripts/random/example-args.sh b/.scripts/random/example-args.sh @@ -1,21 +0,0 @@ -#!/bin/sh -# not to be run - -while [ "$#" != "0" ] -do - echo "$1" | grep "[a-zA-Z0-9]=" >/dev/null && { - arg_opt=$(echo "$1" | sed 's/=.*//g') - arg_opr=$(echo "$1" | sed 's/.*=//g') - } || { - arg_opt="$1" - echo "$arg_opt" | grep -E -- '--blargh|-b' >/dev/null && { - shift - arg_opr="$1" - } - } - case "$arg_opt" in - --blargh|-b) do_blargh "$arg_opr" ;; - *) echo "$arg_opt not recognized"; usage ;; - esac - shift -done diff --git a/.scripts/random/gnulinux.sh b/.scripts/random/gnulinux.sh @@ -1,3 +0,0 @@ -echo "I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. -> Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. -> There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!" | cowsay diff --git a/.scripts/random/rev b/.scripts/random/rev @@ -1,14 +0,0 @@ -#!/bin/awk -f - -function reverse_print(fwd, rev, i, n) { - n = length(fwd) - for (i = n; i >= 1; i--) - rev = rev substr(fwd, i, 1); - return rev -} - -{ - for (i = 1; i <= NF; i++) - $i = reverse_print($i) - print -} diff --git a/.scripts/random/ytsrch b/.scripts/random/ytsrch @@ -1,70 +0,0 @@ -#!/bin/sh -# -# ytsrch.sh -# Created by Hayden Hamilton -# -# hayden@haydenvh.com -# Copyright (c) 2020 Hayden Hamilton -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# This work is free. You can redistribute it and/or modify it under the -# terms of the Do What The Fuck You Want To Public License, Version 2, -# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. -# -# usage: ytsrch <search query> [number of results] -# -# TODO: -# - Grab metadata from the search page itself, this will make it a lot faster. -# The reason it grabs from individual pages is because I already had written -# the code for that. [fixed in ytsrch2] - -echo "Use ytsrch2 instead. This is a demo of how not to something" && exit - -tmp=$(mktemp -d) -urls=$(curl -qsL "https://www.youtube.com/results?search_query=$(echo "$1" | xxd -p | tr -d '\n' | sed 's/../%&/g')" | grep -o "/watch?v=[^\"]*" | cut -c-20 | awk '!lines[$0]++ {print "https://www.youtube.com" $0}' | head -n "${2:-20}") -count=0 - -for u in $urls -do - count=$(($count+1)) - ( - touch $tmp/$(printf "%04d.lock" $count) - content=$(curl -qs "$u") - printf "==============[%02d]\n\ - URI: %s\n\ - Title: %s\n\ - Auther: %s\n\ - Auther's atom: %s\n\ - Upload Date: %s\n\ - Veiws: %s\n\ - Length: %s\n" \ - "$count" \ - "$(echo "$u" | sed 's,watch?v=,embed/,')" \ - "$(echo "$content" | grep '\[{\"videoPrimaryInfoRenderer\":{\"title\":{\"runs\"\:\[{\"text\":' | sed 's/.*\[{\"videoPrimaryInfoRenderer\":{\"title\":{\"runs\"\:\[{\"text\":// ; s/}\]}.*// ; s/\\//g ; s/^\"// ; s/.$//')" \ - "$(echo "$content" | grep -o 'author":[^}]*}' | sed -E 's/.*:"([^"]*).*/\1/g')" \ - "$(echo "$content" | grep -o 'channelId":"[^"]*' | sed -E 's~.*"([^"]*)$~https://www.youtube.com/feeds/videos.xml?channel_id=\1~' | head -n 1)" \ - "$(echo "$content" | grep -o 'uploadDate":[^}]*}' | sed -E 's/.*:"([^"]*).*/\1/g; s~([0-9]*)-([0-9]*)-([0-9]*)~\3/\2/\1~')" \ - "$(echo "$content" | grep -o 'viewCount":[^}]*}' | head -n 1 | grep -o 'simpleText":[^}]*}' | sed -E 's/.*:"([^"]*).*/\1/g; s/ views//; s/ Aufrufe//g;s/\./,/g')" \ - "$(echo "$content" | grep '\<meta itemprop=\"duration\"' | sed 's/.*content\=//; s/"//g; s/PT//; s/./\L&/g ; s/.$//')" | sed 's/^[[:space:]]*//' | tr '\t' ' ' > $tmp/$(printf "%04d.lock" $count) - mv $tmp/$(printf "%04d.lock" $count) $tmp/$count.show - ) & - #list=$(printf "%s\n%s\n" "$list" "[$count] $u") -done - -while true; -do - sleep 0.5 - ls $tmp | grep lock >/dev/null || break -done - -cat $tmp/*.show -rm -rf $tmp - -#echo "$list" | dmenu -i -p "Select a uri:" | xargs mpv diff --git a/.scripts/rfclookup b/.scripts/rfclookup @@ -0,0 +1,47 @@ +#!/bin/sh +# +# rfclookup.sh +# Created by Hayden Hamilton +# +# hayden@haydenvh.com +# Copyright (c) 2020 Hayden Hamilton +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# This work is free. You can redistribute it and/or modify it under the +# terms of the Do What The Fuck You Want To Public License, Version 2, +# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. + +index=https://www.ietf.org/download/rfc-index.txt +document="https://tools.ietf.org/rfc/rfc%s.txt" + +usage(){ + base=$(basename "$0") + printf "usage: %s -s <search query>\n" "$base" + printf "\t %s -n <number>\n" "$base" + printf "\t %s -u <number>\n" "$base" +} + +case "$1" in +-s) + curl -Li $index | + tr '\n' '\t' | + sed 's/\t\t/\n/g' | + tr '\t' ' ' | + tr -s ' ' | + grep '^[0-9][0-9][0-9][0-9] ' | + grep -iE "$2" + ;; +-n) + curl -Ls $(printf "$document\n" "$2") | less + ;; +-u) + printf "$document\n" "$2" + ;; +esac diff --git a/.scripts/bin/rmpatch b/.scripts/rmpatch diff --git a/.scripts/bin/rmsshsock b/.scripts/rmsshsock diff --git a/.scripts/bin/rwall b/.scripts/rwall diff --git a/.scripts/bin/scrape/debug b/.scripts/scrape/debug diff --git a/.scripts/bin/scrape/youtube b/.scripts/scrape/youtube diff --git a/.scripts/bin/screenoff b/.scripts/screenoff diff --git a/.scripts/bin/secs2cst b/.scripts/secs2cst diff --git a/.scripts/bin/service b/.scripts/service diff --git a/.scripts/bin/sfeed_addfeed b/.scripts/sfeed_addfeed diff --git a/.scripts/shmenu b/.scripts/shmenu @@ -0,0 +1,62 @@ +#!/bin/sh + +[ -z $1 ] && echo "usage: shmenu <prompt> + +stdin is given to the user to search through +stdout contains the selection +stderr contains the user interface + +Use ctrl+h or ctrl+l to navigate between options." && exit + +cleanup(){ + tput cnorm + stty icanon + clear > /dev/stderr + echo "$files" | grep -i "$query" | tail -n $selected | head -n 1 + exit +} + +trap cleanup 2 + +files=$(cat /dev/stdin) +tput civis +stty -icanon </dev/tty >/dev/stderr + +selected=1 +IFS='' +while true +do + query=".*$(echo "$prev" | sed 's/./&\.\*/g')" # fuzzyfy + output=$(echo "$files" | grep -i "$query") + [ "$output" != "$oldoutput" ] && { + clear > /dev/stderr + echo "$output" | sed 's/^/ /g' > /dev/stderr + printf "$(tput setaf 10)$1>$(tput sgr0) $prev" > /dev/stderr + } + [ $(echo "$output" | wc -l) -gt $(tput lines) ] && { + len=$(($(tput lines)-1-$selected)) + } || { + len=$(($(echo "$output" | wc -l)-$selected)) + } + tput sc >/dev/stderr + tput cup $(($len-1)) 0 >/dev/stderr + printf ' ' >/dev/stderr + tput cup $(($len)) 0 >/dev/stderr + tput setaf 7 >/dev/stderr + printf -- '>-' >/dev/stderr + tput sgr0 >/dev/stderr + tput cup $(($len+1)) 0 >/dev/stderr + printf ' ' + tput rc >/dev/stderr + tput cnorm + key=$(dd bs=1 count=1 </dev/tty 2>/dev/null) + tput civis + oldoutput="$output" + [ "$key" = "$(echo)" ] && cleanup + echo "$key" | grep "">/dev/null && selected=$(($selected+1)) && continue + echo "$key" | grep " ">/dev/null && { [ ! $selected -eq 1 ] && selected=$(($selected-1)); } && continue + newkey=$(echo "$key" | grep '[[:print:]]') + [ "$newkey" = "" ] && prev=$(echo "$prev" | sed 's/.$//') || prev="${prev}${newkey}" +done + +cleanup diff --git a/.scripts/bin/slock_mod b/.scripts/slock_mod diff --git a/.scripts/bin/slopvid b/.scripts/slopvid diff --git a/.scripts/bin/somafm b/.scripts/somafm diff --git a/.scripts/bin/srxsrch b/.scripts/srxsrch diff --git a/.scripts/bin/sshdatesync b/.scripts/sshdatesync diff --git a/.scripts/bin/sshtar b/.scripts/sshtar diff --git a/.scripts/bin/sttab b/.scripts/sttab diff --git a/.scripts/bin/sudo b/.scripts/sudo diff --git a/.scripts/bin/swamp b/.scripts/swamp diff --git a/.scripts/bin/textdisplay b/.scripts/textdisplay diff --git a/.scripts/bin/thesaurus b/.scripts/thesaurus diff --git a/.scripts/bin/tlds b/.scripts/tlds diff --git a/.scripts/bin/tmuxkillshell b/.scripts/tmuxkillshell diff --git a/.scripts/bin/topen b/.scripts/topen diff --git a/.scripts/bin/torlist b/.scripts/torlist diff --git a/.scripts/bin/torrents b/.scripts/torrents diff --git a/.scripts/bin/tsclean b/.scripts/tsclean diff --git a/.scripts/bin/ttyblocks b/.scripts/ttyblocks diff --git a/.scripts/bin/uniqfind b/.scripts/uniqfind diff --git a/.scripts/uptimemon b/.scripts/uptimemon @@ -0,0 +1,44 @@ +#!/bin/sh +# +# uptimemon.sh - monitor and record uptime (records) +# +# hayden@hhvn.uk +# Copyright (c) 2020 Hayden Hamilton +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# This work is free. You can redistribute it and/or modify it under the +# terms of the Do What The Fuck You Want To Public License, Version 2, +# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. + +d=$HOME/net/exec/uptime + +#for s in matrix.hhvn.uk hhvn.uk irc1 irc2 dumbterm.hhvn.uk phony.hhvn.uk port.hhvn.uk mx1.hhvn.uk +for s in hhvn.uk irc1 irc2 dumbterm.hhvn.uk phony.hhvn.uk port.hhvn.uk mx1.hhvn.uk neutron.hhvn.uk +do + curr=$(ssh $s uptime | grep 'days' | awk '{print $3}' | grep '^[^:]*$' || echo 0) + ssh $s uptime >/dev/null && down=n || down=y # run the cmd again - variable can't be set + # in substitions + [ ! -f $d/$s ] && echo "curr $curr" > $d/$s + [ -f $d/$s ] && { + awk -F" " -v "curr=${curr:-0}" ' + $1 == "curr" { + if ($2 > curr) { + print "curr " curr + print "record " $2 + } else { + print "curr " curr + } + } + $1 == "record"' < $d/$s > $d/$s.new + mv $d/$s.new $d/$s + [ "$down" = "y" ] && chmod +x $d/$s || chmod -x $d/$s # use executable perm to + # signal to uptime.dcgi + } +done diff --git a/.scripts/bin/urlencode b/.scripts/urlencode diff --git a/.scripts/bin/urlhand b/.scripts/urlhand diff --git a/.scripts/bin/urlhand2 b/.scripts/urlhand2 diff --git a/.scripts/bin/voidupdate b/.scripts/voidupdate diff --git a/.scripts/bin/wallblur b/.scripts/wallblur diff --git a/.scripts/bin/wallp b/.scripts/wallp diff --git a/.scripts/wbcachemake b/.scripts/wbcachemake @@ -0,0 +1,27 @@ +#!/bin/sh -x +# usage: wbcachemake + +cache=$HOME/general/cache/ + +donorm(){ + [ "$args" = "" ] && { + convert $file -sparse-color Barycentric '0,0 black 0,%h white' -function polynomial 3.5,-3.2,1.15 /tmp/blurmap.png + convert $file /tmp/blurmap.png -compose Blur -set option:compose:args 9 -composite $1 + } || { + convert $file $args $1 + } + files="$files $1" +} + +mkdir -p $cache/wallblur + +files=$(find images/wallpapers/ -type f -name "*.png") + +for file in $files +do + [ ! -f $cache/wallblur/$(basename "$file") ] && { + echo $file start + donorm "$cache/wallblur/$(basename $file)" + echo $file done + } +done diff --git a/.scripts/bin/yt/feed b/.scripts/yt/feed diff --git a/.scripts/bin/yt/meta b/.scripts/yt/meta diff --git a/.scripts/bin/yt/srch2 b/.scripts/yt/srch2 diff --git a/.scripts/bin/yt/srch2-sort b/.scripts/yt/srch2-sort