dot

packages and services management
Log | Files | Refs | README

commit b99282722ea66bb2423b0fa4deec04f635de6972
parent c8198154812b81b83082c27616f0b10af711bc33
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 25 Aug 2017 08:20:07 +0200

moved binaries out of repo

Diffstat:
Ddevel/git/bin/git-all | 8--------
Ddevel/git/bin/git-count | 5-----
Ddevel/git/bin/git-status | 47-----------------------------------------------
Ddevel/git/bin/git-sync | 6------
Dmail/mblaze/bin/mblaze-filter | 94-------------------------------------------------------------------------------
Dnet/ii/bin/ii-client | 10----------
Dnet/ii/bin/ii-filter | 54------------------------------------------------------
Dnet/ii/bin/no | 8--------
Dsecurity/libbearssl/bin/bot | 48------------------------------------------------
Dsystem/monitor/bin/monitor | 12------------
Dsystem/monitor/bin/monitor-plot | 46----------------------------------------------
Dsystem/monitor/bin/monitor-send | 0
Dsystem/monitor/bin/monitor-step | 51---------------------------------------------------
Dsystem/monitor/bin/plot | 51---------------------------------------------------
Dtext/iomenu/bin/io | 42------------------------------------------
Dtext/iomenu/bin/io-agenda | 5-----
Dtext/iomenu/bin/io-cache | 63---------------------------------------------------------------
Dtext/iomenu/bin/io-jobs | 1-
Dtext/iomenu/bin/io-mail | 10----------
Dtext/iomenu/bin/io-music | 3---
Dtext/iomenu/bin/io-search | 8--------
Dtext/iomenu/bin/io-unicode | 60------------------------------------------------------------
22 files changed, 0 insertions(+), 632 deletions(-)

diff --git a/devel/git/bin/git-all b/devel/git/bin/git-all @@ -1,8 +0,0 @@ -command="$1" -shift - -find "$HOME" -name .git | while IFS='' read repo -do - printf '\n%s\n' "${repo%/.git}" - (cd "${repo%/.git}" && "$command" "$@") -done diff --git a/devel/git/bin/git-count b/devel/git/bin/git-count @@ -1,5 +0,0 @@ -echo "$(( - $(git diff | grep ^+ | wc -l) - - $(git diff | grep ^- | wc -l) -))" - diff --git a/devel/git/bin/git-status b/devel/git/bin/git-status @@ -1,47 +0,0 @@ -git rev-parse 2> /dev/null || exit 1 - -git status --porcelain -b | awk ' - -/^## / { - branch = $0; - sub(/^## /, "", branch); - sub(/\.\.\..*/, "", branch); - - if ($0 ~ /ahead /) { - ahead = $0; - sub(/.*ahead /, "", ahead); - sub(/\].*|, .*/, "", ahead); - } - - if ($0 ~ /behind /) { - behind = $0; - sub(/.*behind /, "", behind); - sub(/\].*|, .*/, "", behind); - } - - next; -} - -/^\?\? / { untracked++; next; } -/^U. / { conflicts++; next; } -/^.U / { conflicts++; next; } -/^DD / { conflicts++; next; } -/^AA / { conflicts++; next; } -/^.M / { changed++; } -/^.D / { changed++; } -/^[^ ]. / { staged++; } - -END { - printf("\033[1;30m%s\033[m", branch); - - if (untracked) printf(" \033[33m?\033[m%d", untracked); - if (conflicts) printf(" \033[31mx\033[m%d", conflicts); - if (changed ) printf(" \033[32m+\033[m%d", changed); - if (staged ) printf(" \033[34m#\033[m%d", staged); - if (behind ) printf(" \033[35m↓\033[m%d", behind); - if (ahead ) printf(" \033[36m↑\033[m%d", ahead); -}' - -[ -d "$(git rev-parse --git-dir)/rebase-merge" ] && printf ' rebase' - -printf '\n' diff --git a/devel/git/bin/git-sync b/devel/git/bin/git-sync @@ -1,6 +0,0 @@ -find "$HOME/srv/git" -mindepth 1 -maxdepth 1 -type d | -while IFS='' read -r repo -do - git -C "$repo" fetch origin master:master - git -C "$repo" push --all -done diff --git a/mail/mblaze/bin/mblaze-filter b/mail/mblaze/bin/mblaze-filter @@ -1,94 +0,0 @@ -# filter mails using mblaze - - -filter() -{ - mlist "$MAIL" | magrep "$1" | while IFS='' read -r mail - do - mkdir -p "${MAIL%/*}/$2/cur" - mkdir -p "${MAIL%/*}/$2/new" - mkdir -p "${MAIL%/*}/$2/tmp" - mv "$mail" "${MAIL%/*}/$2/new" - done -} - - -minc "$MAIL" | mscan - - -# Social networking - -filter from:'lobste.rs' lobsters - -filter from:'reddit' reddit - -filter from:'disqus' disqus - -filter from:'nixers.net' nixers - -filter from:'researchgate' researchgate - - -# Mailing lists - -filter from:'sachachua.com' sachachua - -filter cc:'mmh@marmaro.de' mmh -filter to:'mmh@marmaro.de' mmh - -filter subject:'\[gobolinux-' gobolinux - -filter from:'suckless.org' suckless -filter to:'suckless.org' suckless -filter cc:'suckless.org' suckless - -filter from:'fsf.org' fsf - -filter to:'listes.etudiant.univ-rennes1.fr' univ-rennes1 -filter List-Id:'foad.univ-rennes1.fr' univ-rennes1 -filter Received:'vmsympa1.univ-rennes1.fr' univ-rennes1 -filter Return-Path:'listes.univ-rennes1.fr' univ-rennes1 - -filter from:'amnesty' amnesty - -filter List-Id:'breizh-entropy.org' breizh-entropy - - -# Services - -filter subject:'\[repo.or.cz\]' repo.or.cz - -filter from:'github.com' github - -filter from:'stackexchange.com' stackexchange - -filter from:'bandcamp.com' bandcamp -filter from:'Cryo Chamber' bandcamp - -filter from:'keybase.io' keybase -filter :rom 'wordpress.com' wordpress - -filter from:'google.com' google - - -# Payments - -filter from:'@free-mobile.fr' utilities - -filter from:'@paypal' payment -filter from:'coinbase.com' payment - -filter from:'gandi.net' webservices - -filter from:'@amazon' webstores - -filter from:'crous-rennes.fr' housing - -filter from:'sncf.com' transports -filter from:'captaintrain.com' transports -filter from:'flixbus' transports -filter from:'megabus' transports -filter from:'ouigo' transports -filter from:'ouibus' transports -filter from:'keolis.com' transports -filter from:'BlaBlaCar' transports diff --git a/net/ii/bin/ii-client b/net/ii/bin/ii-client @@ -1,10 +0,0 @@ -# Simple tiny ii client - -[ -d "$1" ] || exit 1 - -tail -n 80 -f "$1/out" | ii-filter & - -while IFS='' read -r line -do - printf '%s\n' "$line" > "$1/in" -done diff --git a/net/ii/bin/ii-filter b/net/ii/bin/ii-filter @@ -1,54 +0,0 @@ -# http://tools.suckless.org/ii - -awk ' - -BEGIN { - WIDTH = 80 - 17 -} - -date != $1 { - printf("\n----------------------------------") - printf(" %s ", date) - printf("----------------------------------\n") - - date = $1 - nick = "" -} - -{ - if ($3 ~ "<.*>" || $3 ~ "-!-") { - sub("<", "", $3) - sub(">", "", $3) - - if (nick != $3) { - printf("\n") - printf("%s %10s ", $2, $3) - nick = $3 - } else { - printf("%s %10s ", $2, "") - } - - sub("[^ ]* [^ ]* [^ ]* ", "") - - } else { - printf("%s %10s ", $2, "") - sub("[^ ]* [^ ]* ", "") - } - - sub("^\001ACTION ", "~~ ") - sub("\001$", " ~~") - - for (offset = 0; length($0) > 0; offset = 18) { - row = substr($0, 1, WIDTH) - - if (length(row) >= WIDTH) - sub(" [^ ]*$", "", row) - - $0 = substr($0, length(row) + 1) - sub(" *", "") - - printf("%" offset "s%s\n", "", row) - } - - system("") -}' diff --git a/net/ii/bin/no b/net/ii/bin/no @@ -1,8 +0,0 @@ -printf 'I think it could be ok...\n' > "$1"; sleep 2 -printf ' thin it cou d b ok...\n' > "$1"; sleep 1 -printf ' h n t c b ok .\n' > "$1"; sleep 1 -printf ' n t c o .\n' > "$1"; sleep 1 -printf ' n c o .\n' > "$1"; sleep 1 -printf ' n o .\n' > "$1"; sleep 1 -printf ' n o .\n' > "$1"; sleep 1 -printf ' no.\n' > "$1"; sleep 1 diff --git a/security/libbearssl/bin/bot b/security/libbearssl/bin/bot @@ -1,48 +0,0 @@ -DESC='a small git that prints bot status' -HOST=unix.chat -CHAN=#commits -NICK=${0##*/} -PASS=$PASS - -mkdir -p "$ROOT/var/irc/$HOST" -cd "$ROOT/var/irc/$HOST" || exit - -case "$1" in -(git) - : ${GIT_DIR:?this must be run from a git hook} - printf 'PRIVMSG %s :[%s/%s\n' "$CHAN" "$( - git -C "$GIT_DIR" rev-parse --show-toplevel | xargs basename - )" "$( - git -C "$GIT_DIR" show --name-only --format='%h] %cn: %s' - )" > bot - ;; -(-d) - [ -p bot ] || mkfifo bot - - tail -f bot | brssl client "$HOST:6697" | tee /dev/stderr | - while IFS='' read -r line - do - case "$line" in - ('PING :'*) - printf '%s\n' "$line" - sleep 1 - printf 'PONG%s\n' "${line#PING}" > bot - printf 'PONG%s\n' "${line#PING}" - ;; - (*) - printf '%s\n' "$line" - ;; - esac - done | sed -r -n 's/^:?[^:]*:// p' >> out & - - sleep 5 - printf 'USER %s +i * :%s\n' "$NICK" "$DESC" > bot - printf 'NICK %s\n' "$NICK" > bot - sleep 5 - printf 'PRIVMSG NickServ :IDENTIFY %s\n' "$PASS" > bot - sleep 5 - printf 'JOIN %s\n' "$CHAN" > bot - - wait - ;; -esac diff --git a/system/monitor/bin/monitor b/system/monitor/bin/monitor @@ -1,12 +0,0 @@ -# script monitoring performances and recording data to $ROOT/var/stat - -STEP="${1:-900}" - -mkdir -p "$ROOT/var/stat" - -while true -do - monitor-step "$STEP" >> "$ROOT/var/stat/data" - tail -n 100 "$ROOT/var/stat/data" | - monitor-plot "$STEP" > "$ROOT/var/stat/graph" -done diff --git a/system/monitor/bin/monitor-plot b/system/monitor/bin/monitor-plot @@ -1,46 +0,0 @@ -# read the data from stdin and fills missing entries with "?" - -awk -v STEP="${1:?argument missing} step}" ' - -BEGIN { - fields[2] = "time" - fields[3] = "mem" - fields[4] = "cpu" - fields[5] = "load" - fields[6] = "diskio" - fields[7] = "storage" -} - -{ - nfields = split($0, line, " ") - - for (i = 1; i <= nfields; i++) - data[i"]["NR] = line[i] -} - -END { - # find the alignment of the data timestamps (phase) - for (i = 1; i <= NR; i++) - start += data[2"]["i] % STEP - start = int(start / NR + STEP / 2) - start += data[2"]["1] - data[2"]["1] % STEP - - for (i = 3; i <= nfields; i++) { - offset = start - printf "%s", fields[i] - for (j = 1; j <= NR; j++) { - while (data[2"]["j] > offset) { - printf " ?" - offset += STEP - } - offset += STEP - printf " %s", data[i"]["j] - } - print "" - } -}' | while read field line -do - printf '\n[ %s ] \n\n' "$field" - printf %s "$line" | plot -h 30 - printf '\n' -done diff --git a/system/monitor/bin/monitor-send b/system/monitor/bin/monitor-send diff --git a/system/monitor/bin/monitor-step b/system/monitor/bin/monitor-step @@ -1,51 +0,0 @@ -# ressources monitoring script - -# It will produce one line with the following values, separated with a space: -# -# 1. hostname 5. load average (1 minute) -# 2. unix time 6. disk I/O -# 3. free memory 7. total free storage -# 4. cpu usage - -case "$(uname)" in -(Linux ) mem=free cpu=id bi=bi bo=bo ;; -(*BSD ) mem=fre cpu=id bi='' bo='' ;; -(Solaris) mem=free cpu=id bi='' bo='' ;; -(SunOS ) mem=free cpu=id bi='' bo='' ;; -esac - -vmstat "${1:-15}" 2 | -awk -v mem="$mem" -v cpu="$cpu" -v bi="$bi" -v bo="$bo" ' - -BEGIN { - "date +%s" | getline time - "hostname" | getline host - "uptime" | getline load - - sub(/.* /, "", load) - - while ("df" | getline) - if ($1 ~ "^/dev/" || $1 == "zroot") stor += $4 -} - -NR == 2 { - split($0, keys) - - for (key in keys) - if (keys[key] ~ /0$/) disks[i++] = keys[key] -} - -NR >= 4 { - for (i = 1 + split($0, values); i > 0; i--) - table[keys[i]] = values[i] - - mem = table[mem] - cpu = 100 - table[cpu] - load = load - diskio = table[bi] + table[bo] - - for (disk in disks) - diskio += table[disks[disk]] - - print host " " time " " mem " " cpu " " load " " diskio " " stor -}' diff --git a/system/monitor/bin/plot b/system/monitor/bin/plot @@ -1,51 +0,0 @@ -awk ' - -BEGIN { - for (i = 1; i < ARGC; i++) { - if (ARGV[i] == "-h" && i + 1 < ARGC && ARGV[i]) height = ARGV[++i] - else { - print "Usage: plot [-h height]" - exit 1 - } - } - - ARGC = 0 -} - -{ - maxx = split($0, dots) - stepy = 1 - - # find the max and the steps - for (x = 1; x <= maxx; x++) { - if (skip[x] = (dots[x] == "?")) dots[x] = 0 - if (maxy < dots[x]) maxy = dots[x] - } - if (!height) height = maxy - height -= - height % 2 - stepy = maxy / height - - # draw the grid - margin = (length(maxy) < 15) ? 15 : length(maxy) - float = (stepy < 1) - for (y = height - height % 2; y >= 0; y -= 2) { - if (num = !num) { - if (float) printf "%" margin ".2f -|", (y + 1) * stepy - else printf "%" margin "d -|", (y + 1) * stepy - } else printf "%" margin "s |", "" - - for (x = 1; x <= maxx; x++) - printf "%s", (dots[x] > (y + 1) * stepy ? ":" : \ - dots[x] > (y ) * stepy ? "." : " ") - print "" - } - - # draw 'x' axis - printf "%" margin "s0 +", "" - for (x = 1; x <= maxx; x++) - printf skip[x] ? "x" : "-" - print "+ " maxx - - exit -} -' "$@" diff --git a/text/iomenu/bin/io b/text/iomenu/bin/io @@ -1,42 +0,0 @@ -# attach to an abduco sessions and manage the names - -export LC_COLLATE=C - -mkdir -p "$HOME/.abduco" -touch "$HOME/.abduco/names" - -# --- update sessions list ----------------------------------------------------- - -[ "$(abduco | wc -l | tr -cd 0-9)" = 1 ] && rm "$HOME/.abduco/names" || -grep -F -e "$( - abduco | awk -F '\t' 'NR > 1 { print $3 " " }' -)" "$HOME/.abduco/names" | sort -uk 2,2 -o "$HOME/.abduco/names" - -# build arguments -------------------------------------------------------------- - -if [ $# -gt 0 ] -then - for path in "$@"; do :; done # set path to last arg -else - selection=$({ - cut -d ' ' -f 3- "$HOME/.abduco/names" - cat "$ROOT/var/cache/io" - } | iomenu -p io -# | sed 's/# //') - - command=$(printf %s "$selection" | cut -d ' ' -f 1) - path=$( printf %s "$selection" | cut -d ' ' -f 2-) - - set -- $command "$path" -fi - -[ -z "$path" ] && exit 1 -[ -e "$path" ] && path=$(cd "$(dirname "$path")" && pwd)/$(basename "$path") -[ $# = 1 ] && set -- $EDITOR "$@" - -hash=$(printf %s "$path" | cksum | cut -d ' ' -f 1) - -# create session or attach to it ----------------------------------------------- - -printf '%s %s\n' "$hash" "$path" >> "$HOME/.abduco/names" -[ "$SSH_TTY" ] && e='^\' || e='^Z' -[ "$ABDUCO" != "$hash" ] && ABDUCO=$hash exec abduco -e "$e" -A "$hash" "$@" diff --git a/text/iomenu/bin/io-agenda b/text/iomenu/bin/io-agenda @@ -1,5 +0,0 @@ -find "$CONFIG/cal" -type f | while IFS='' read -r calendar -do - printf '# %s\n' "${calendar##*/}" - tac "$calendar" -done | iomenu -p calendar -# diff --git a/text/iomenu/bin/io-cache b/text/iomenu/bin/io-cache @@ -1,63 +0,0 @@ -mkdir -p "$ROOT/var/cache" -touch "$ROOT/var/cache/io" - -find "$ROOT" \ - -path "*/.git/*" -prune -o \ - -path "*/.hg/*" -prune -o \ - -path "${MAIL%/*}/*/*" -prune -o \ - -type d -exec printf '%s/\n' {} + -o \ - -print 2> /dev/null | sort | - -awk -v MAIL="${MAIL%/*}" ' - - $0 ~ ENVIRON["ROOT"] "/var/irc/.*/$" { - ircv[ircc++] = $0 - } - - $0 ~ MAIL "/*/" { - mailv[mailc++] = $0 - } - - $0 ~ "/[.]git/$" || $0 ~ "/src/[^/]*/$" { - sub("/[.]git/$", "/") - searchv[searchc++] = $0 - } - - $0 ~ ENVIRON["ROOT"] "/var/music" { - musicv[musicc++] = $0 - } - - $0 ~ ".*/man/.*[.][0-9]p?(.gz)?$" { - manv[manc++] = $0 - } - - $0 !~ "/$" { - filesv[filesc++] = $0 - } - - END { - print "# ii-client" - for (i = 0; i < ircc; i++) print(ircv[i] ) - - print "# io-mail" - for (i = 0; i < mailc; i++) print(mailv[i] ) - - print "# io-search" - for (i = 0; i < searchc; i++) print(searchv[i]) - - print "# io-music" - for (i = 0; i < musicc; i++) print(musicv[i] ) - - print "# mandoc -a" - for (i = 0; i < manc; i++) print(manv[i] ) - - print "# " ENVIRON["EDITOR"] - for (i = 0; i < filesc; i++) print(filesv[i] ) - } -' > "$ROOT/var/cache/io" - -{ - printf '# uri\n' - cat "$ROOT/lib/url"/* "$ROOT/pkg/lib/url" - cut -d ' ' -f 1 "$ROOT/.ssh/known_hosts" | sed -r 's|^|ssh://root@|' -} >> "$ROOT/var/cache/io" diff --git a/text/iomenu/bin/io-jobs b/text/iomenu/bin/io-jobs @@ -1 +0,0 @@ -fg `jobs | iomenu | sed -r 's/\[(0-9)\].*/\1/'` diff --git a/text/iomenu/bin/io-mail b/text/iomenu/bin/io-mail @@ -1,10 +0,0 @@ -# list mail from all inboxes using mblaze - -# sort messages -mdirs "$1" | mlist | mthread | msort -r -d | mseq -S | - -# prompt for a mail with iomenu -mscan -f '%6n %u %D %20f %t%2i%120S' | iomenu -p mail | - -# open it -sed -r 's/^ *([0-9]*) .*/\1/'| xargs mless diff --git a/text/iomenu/bin/io-music b/text/iomenu/bin/io-music @@ -1,3 +0,0 @@ -# play all music from directories and files passed as argument with mplayer - -mplayer `find "$1" -type f -name '*.flac' | sort` diff --git a/text/iomenu/bin/io-search b/text/iomenu/bin/io-search @@ -1,8 +0,0 @@ -# interactively search a string in all code of a directory - -io "$( - find "$1" -type f ! -path '*/.git/*' | sort | xargs -n 1 awk ' - FNR == 1 { printf("# %s\n", FILENAME); } - { printf("%7s\t%s\n", FNR, $0); } - ' | iomenu -# -p search | sed -e 's/^# //' -e 's/ .*//' -)" diff --git a/text/iomenu/bin/io-unicode b/text/iomenu/bin/io-unicode @@ -1,60 +0,0 @@ -# prompt for an unicode character - -URL=http://www.unicode.org/Public/UNIDATA/UnicodeData.txt - -if ! [ -f "$ROOT/var/cache/unicode" ] -then - mkdir -p "$ROOT/var/cache" - - wget -O - "$URL" | while IFS=';' read -r hex str trail - do - r=$((0x$hex)) - - if [ $r -le $((0x0000007f)) ] - then - o=\\$((r)) - - elif [ $r -le $((0x000007ff)) ] - then - o=\\$((0xc0 | (0x1f & (r >> 6)))) - o=$o\\$((0x80 | (0x3f & (r)))) - - elif [ $r -le $((0x0000ffff)) ] - then - o=\\$((0xe0 | (0x0f & (r >> 12)))) - o=$o\\$((0x80 | (0x3f & (r >> 6 )))) - o=$o\\$((0x80 | (0x3f & (r )))) - - elif [ $r -le $((0x001fffff)) ] - then - o=\\$((0xf0 | (0x07 & (r >> 18)))) - o=$o\\$((0x80 | (0x3f & (r >> 12)))) - o=$o\\$((0x80 | (0x3f & (r >> 6 )))) - o=$o\\$((0x80 | (0x3f & (r )))) - - elif [ $r -le $((0x03ffffff)) ] - then - o=\\$((0xf0 | (0x03 & (r >> 24)))) - o=$o\\$((0x80 | (0x3f & (r >> 18)))) - o=$o\\$((0x80 | (0x3f & (r >> 12)))) - o=$o\\$((0x80 | (0x3f & (r >> 6)))) - o=$o\\$((0x80 | (0x3f & (r )))) - - elif [ $r -le $((0x7fffffff)) ] - then - o=\\$((0xfc | (0x01 & (r >> 30)))) - o=$o\\$((0x80 | (0x3f & (r >> 24)))) - o=$o\\$((0x80 | (0x3f & (r >> 18)))) - o=$o\\$((0x80 | (0x3f & (r >> 12)))) - o=$o\\$((0x80 | (0x3f & (r >> 6)))) - o=$o\\$((0x80 | (0x3f & (r )))) - else - o='' - fi - - printf '%s\n' "$o" - - done > "$ROOT/var/cache/unicode" -fi - -iomenu < "$ROOT/var/cache/unicode"