config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit ed382b41f158df428208aaf28c4e53e7ae620f1e
parent 63909435644da731550f05163c1824f302765301
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Thu, 18 Feb 2021 11:18:34 -0800

Remove unused scripts

I don't feel like rewriting them and I never use them so they are
better off deleted.

Diffstat:
Dlocal/scripts/.local/bin/sfeed.awk | 19-------------------
Dlocal/scripts/.local/bin/tb | 16----------------
Dlocal/scripts/.local/bin/w3 | 27---------------------------
Dlocal/scripts/.local/bin/webq | 36------------------------------------
4 files changed, 0 insertions(+), 98 deletions(-)

diff --git a/local/scripts/.local/bin/sfeed.awk b/local/scripts/.local/bin/sfeed.awk @@ -1,19 +0,0 @@ -#!/usr/bin/awk -f -#! sfeed.awk -- display sfeed(5) lines as html - -BEGIN { - FS = "\t" -} - -function html(title, link, author, content) { - gsub(/\\[nt]/, " ", content); - if (link == "") { - link = "#"; - } - printf "<article><header><h1><a href=\"%s\">%s</a></h1><h2><address>by %s</address></h2></header>%s</article>\n", link, title, author, content -} - - -{ - html($2, $3, $7, $4); -} diff --git a/local/scripts/.local/bin/tb b/local/scripts/.local/bin/tb @@ -1,16 +0,0 @@ -#!/usr/local/bin/rc -e -#! tb -- tor browser -#! -#! Unportably run vimb(1) routing through tor on OpenBSD. - -MIRROR = 'http://7tcuoi57curagdk7nsvmzedcxgwlrq2d6jach4ksa3vj72uxrzadmqqd.onion' - -if (test `{ id -u } -eq 0) { - printf '%s: Cannot be run as root\n' `{ basename $0 } - exit 1 -} - -rcctl check tor >/dev/null || doas rcctl start tor - -HTTP_PROXY = socks://localhost:9050 -vimb -C 'shortcut-add tb='^$MIRROR^'?q=$0&catagories=general&language=en-US' -C 'shortcut-default tb' $* diff --git a/local/scripts/.local/bin/w3 b/local/scripts/.local/bin/w3 @@ -1,27 +0,0 @@ -#!/usr/bin/env dash -#! w3 -- build a searx search from the given arguments - -set -eu - -# configuration -browser=w3m -mirror=searx.prvcy.eu -lang=en-US - -# display usage -usage() { echo "usage: `basename $0` [-eho] [search-term ...]" ;} - -case "${1:-"-h"}" -in - -e) shift; browser=$BROWSER;; - -h) usage; exit 1;; - -o) shift; output=1;; -esac - -query="$(echo -n $@ | sed "s/ /%20/g")" -if [ ${output:-0} -eq 1 ] -then - echo "https://${mirror}/?q=${query}&categories=general&language=${lang}" -else - $browser "https://${mirror}/?q=${query}&categories=general&language=${lang}" -fi diff --git a/local/scripts/.local/bin/webq b/local/scripts/.local/bin/webq @@ -1,36 +0,0 @@ -#!/usr/bin/env dash -#! webq -- primitive non-interactive web browser - -set -eu - -# settings -useragent="shell script to use searx without a browser" -ttl=1024 -delay=12 - -# display usage -usage() { echo "usage, `basename $0` [query ...]" ;} -curl() { command curl -sSH "User-Agent: $useragent" $@ ;} -format() { cut -d',' -f1,2 | egrep -v ",$" ;} - -if [ $# -eq 0 ]; then - usage; exit 1 -fi - -first=1 -while [ $# -ne 0 ] -do - cache="$HOME/.cache/webq/`echo $1 | sed -E "s/[[:space:]]+/-/g"`" - if [ -f "$cache" ]; then - lifetime=$((`date +%s` - `stat -f %c $cache`)) - else - lifetime=-1 - fi - if [ $lifetime -gt $ttl ] || [ $lifetime -lt 0 ]; then - [ $first -eq 1 ] && sleep $delay - curl "`w3 -o "$1"`&format=csv" | format > $cache - first=0 - fi - cat $cache - shift -done