URI:
       Ditch more unused stuff - scripts - various script and utils
  HTML git clone git://z3bra.org/scripts
   DIR Log
   DIR Files
   DIR Refs
       ---
   DIR commit bda57d820711f01e0d45e5a707fbf45c60305fb6
   DIR parent 3f6adf5e489be5b511849cea75dfe04b10dc32c3
  HTML Author: Willy Goiffon <dev@z3bra.org>
       Date:   Thu, 20 Aug 2026 23:58:03 +0000
       
       Ditch more unused stuff
       
       Diffstat:
         D bak                                 |      88 -------------------------------
         D fadevid                             |      30 ------------------------------
         R pio -> io                           |       0 
         D ix                                  |       3 ---
         D record                              |      22 ----------------------
         D tone                                |       6 ------
       
       6 files changed, 0 insertions(+), 149 deletions(-)
       ---
   DIR diff --git a/bak b/bak
       @@ -1,88 +0,0 @@
       -#!/bin/sh
       -#
       -# z3bra - (c) wtfpl 2014
       -# Backup a file, and rotate backups : file.0.BAK - file.1.BAK, ...
       -#
       -# Based on a original idea from Ypnose. Thanks mate !
       -# <http://ypnose.org/blog/2014/bakup-snippet.html>
       -
       -EXT=${EXT:-BAK} # extension used for backup
       -LIM=${LIM:-9}   # maximum number of version to keep
       -PAD=${PAD:-0}   # number to start with
       -
       -usage() {
       -    cat <<EOF
       -usage: `basename $0` [-hrv] <file>
       -        -h          : print this help
       -        -r <num>    : perform <num> rotations if \$LIM is reached
       -EOF
       -}
       -
       -# report action performed in verbose mode
       -log() {
       -    # do not log anything if not in $VERBOSE mode
       -    test -z $VERBOSE && return
       -
       -    # add a timestamp to the message 
       -    echo "[$(date +%Y-%m-%d\ %H:%M)] - $*"
       -}
       -
       -# rotate backups to leave moar room
       -rotate() {
       -    # do not rotate if the rotate flags wasn't provided
       -    test -z $ROTATE && return
       -
       -    # delete the oldest backup
       -    rm ${FILE}.${PAD}.${EXT}
       -
       -    # move every file down one place
       -    for N1 in `seq $PAD $LIM`; do
       -        N2=$(( N1 + ROTATE ))
       -
       -        # don't go any further
       -        test -f ${FILE}.${N2}.${EXT} || return
       -
       -        # move file down $ROTATE place
       -        log "${FILE}.${N2}.${EXT} -> ${FILE}.${N1}.${EXT}"
       -        mv ${FILE}.${N2}.${EXT} ${FILE}.${N1}.${EXT}
       -    done
       -}
       -
       -# actually archive files
       -archive() {
       -    # test the presence of each version, and create one that doesn't exists
       -    for N in `seq $PAD $LIM`; do
       -        if test ! -f ${FILE}.${N}.${EXT}; then
       -
       -            # cope the file under it's new name
       -            log "Created: ${FILE}.${N}.${EXT}"
       -            cp ${FILE} ${FILE}.${N}.${EXT}
       -
       -            exit 0
       -        fi
       -    done
       -}
       -
       -while getopts "hrv" opt; do
       -    case $opt in
       -        h) usage; exit 0 ;;
       -        r) ROTATE=1 ;;
       -        v) VERBOSE=1 ;;
       -        *) usage; exit 1 ;;
       -    esac
       -done
       -
       -shift $((OPTIND - 1))
       -
       -test $# -lt 1 && usage && exit 1
       -
       -FILE=$1
       -
       -# in case limit is reach, remove the oldest backup
       -test -f ${FILE}.${LIM}.${EXT} && rotate
       -
       -# if rotation wasn't performed, we'll not archive anything
       -test -f ${FILE}.${LIM}.${EXT} || archive
       -
       -echo "Limit of $LIM .$EXT files reached run with -r to force rotation"
       -exit 1
   DIR diff --git a/fadevid b/fadevid
       @@ -1,30 +0,0 @@
       -#!/bin/sh
       -
       -# fuck you, ffmpeg banner
       -exec 2>/dev/null
       -
       -#FONT="$HOME/.fonts/bitmicro.ttf"
       -FONT="$HOME/.fonts/SGK001.ttf"
       -OUTDIR="./faded"
       -FADELEN=30
       -FONTPARAM="fontfile=$FONT:shadowx=4:shadowy=4:fontcolor=white:fontsize=28:x=w-tw-28:y=h-th-28"
       -
       -getname() {
       -    echo $1 | sed 's/\(.*\)\.[^.]*/\L\1/'
       -}
       -
       -getframes() {
       -    ffprobe -count_frames -show_entries stream=nb_read_frames $IN|cut -sd= -f2
       -}
       -
       -test ! -d $OUTDIR && mkdir -p $OUTDIR
       -
       -for IN in $@; do
       -    printf "%s ... " "$(getname $IN)"
       -    NBFRAME=$(getframes)
       -    VFILTER="fade=in:0:$FADELEN"
       -    VFILTER="$VFILTER,fade=out:$((NBFRAME - FADELEN)):$FADELEN"
       -    #VFILTER="$VFILTER,drawtext=$FONTPARAM:text=$(getname $IN)"
       -    ffmpeg -i $IN -vf "$VFILTER" -b:v 5M -y $OUTDIR/$IN
       -    printf "OK\n"
       -done
   DIR diff --git a/pio b/io
   DIR diff --git a/ix b/ix
       @@ -1,3 +0,0 @@
       -#!/bin/sh
       -
       -curl -sF "f:1=<-" ix.io
   DIR diff --git a/record b/record
       @@ -1,22 +0,0 @@
       -#!/bin/sh
       -
       -PIDNAME=recorder
       -FRAMERATE=25
       -RES=$(wattr wh `lsw -r` | tr \  x)
       -SND="-an" # no sound by default
       -
       -usage() {
       -        echo "usage: $(basename $0) [-fk] <filename>" >&2
       -        exit 1
       -}
       -
       -case $1 in
       -        -s) SND="-f alsa -i hw:0 -c:v pcm_s16le"; shift 1 ;;
       -        -f) FRAMERATE=50; shift 1 ;;
       -        -k) kill $(pidof -s $PIDNAME); exit 0 ;;
       -esac
       -
       -test -n "$1" || usage
       -
       -echo Framerate: $FRAMERATE
       -ffmpeg -f x11grab -s $RES -r $FRAMERATE -i :0.0 ${SND} -c:v libvpx -b:v 5M -crf 10 -quality realtime -threads 0 -y $1
   DIR diff --git a/tone b/tone
       @@ -1,6 +0,0 @@
       -#!/bin/sh
       -#
       -# record an audio file
       -# credits to FRIGN
       -
       -ffmpeg -f alsa -ac 1 -i plughw:1,0 -sameq -strict -2 -acodec libmp3lame -qscale 8