Update 2024-02-14 07:51 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id
2024-02-14 07:54:31 +01:00
parent b55e6a3616
commit 9624895938
373 changed files with 19074 additions and 3045 deletions

View File

@@ -0,0 +1,10 @@
#!/bin/sh
#
DATE="$(date +%F_%H-%M-%S)"
SRC="/"
DST="sdk@192.168.1.20:/tank/BACKUP/"
ROPTS="--archive --human-readable --progress --size-only"
rsync --archive --human-readable --progress --size-only --link-dest $PWD/current source "$PWD/destination"

76
.bin/OLD/KAPUTT/ccc-streams.sh Executable file
View File

@@ -0,0 +1,76 @@
#!/bin/sh
sformat="webm"
squality="sd"
translated="native"
mediaplayer="mpv"
usage() {
printf "Available rooms:\n" >&2
printf " a|ada|1\n" >&2
printf " b|borg|2\n" >&2
printf " c|clarke|3\n" >&2
printf " d|dijkstra|4\n" >&2
printf " e|elize|5\n" >&2
printf " chaoswest|150\n" >&2
printf " openinfrastructure|oio\n" >&2
printf " wiki|151\n\n" >&2
exit 1
}
[ -z $1 ] && usage;
hall="$1"
case "$hall" in
1|2|3|4|5|150|151|oio)
;;
a|ada)
hall="1"
;;
b|borg)
hall="2"
;;
c|clarke)
hall="3"
;;
d|dijkstra)
hall="4"
;;
e|eliza)
hall="5"
;;
chaoswest)
hall="150"
;;
open*)
hall="oio"
;;
wiki*)
hall="151"
;;
*)
usage;
;;
esac
webmbase="http://cdn.c3voc.de/s%s_%s_%s.webm"
hlsbase="http://cdn.c3voc.de/hls/s%s_%s_%s.m3u8"
audiobase="http://cdn.c3voc.de/s%s_%s.%s"
slink=""
case "$sformat" in
webm)
slink="$(printf "$webmbase" "${hall}" "${translated}" "${squality}")"
;;
m3u8|hls)
slink="$(printf "$hlsbase" "${hall}" "${translated}" "${squality}")"
;;
*)
printf "Only the stream formats »webm« and »hls« are available.\n" >&2
exit 1
;;
esac
$mediaplayer "$slink"

2
.bin/OLD/KAPUTT/chrome Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
/usr/local/bin/chrome --enable-unveil --enable-features=WebUIDarkMode --force-dark-mode $@

View File

@@ -0,0 +1,35 @@
#!/bin/sh
# essential
pkg_add rsync wget curl lftp mc ranger vim speedtest-cli autocutsel git ectags
# dwm
pkg_add dmenu jq scrot slop
# pass
pkg_add password-store gnupg pinentry
doas ln -s /usr/local/bin/pinentry /usr/bin/pinentry
# mutt
pkg_add mutt w3m urlview msmtp offlineimap mu par
# irssi
pkg_add irssi
# luakit
pkg_add luafs luajit gmake webkitgtk4
# multimedia
pkg_add ffmpeg ffmpegthumbnailer youtube-dl ImageMagick
# tor
pkg_add tor torsocks
# X11
pkg_add mupdf zathura zathura-pdf-mupdf sxiv seafile-client pidgin telegram-purple
# other
pkg_add nload htop nmap ncdu tig xosd sshfs-fuse
# BIG ones
pkg_add firefox libreoffice gimp smtube fnaify vimb

383
.bin/OLD/KAPUTT/openup Executable file
View File

@@ -0,0 +1,383 @@
#!/bin/sh
#
# Copyright (c) 2013 - 2017 M:tier Ltd.
#
# Permission to use, copy, modify, and 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.
#
# Author: Antoine Jacoutot <antoine@mtier.org>
# Maintainer: M:Tier Ltd. <info@mtier.org>
# ChangeLog
# https://gitlab.com/mtier/openup/commits/master
########################################################################
### DO NOT EDIT THIS FILE!!! ###
### User defined variables: overrides are read from /etc/openup.conf ###
########################################################################
# URL to the latest openup version
OPENUP_URL="https://stable.mtier.org/openup"
# signify(1) public key
PKG_PUBKEY_URL="https://stable.mtier.org/mtier-$(uname -r | tr -d '.')-pkg.pub"
# PKG_PATH for currently running OpenBSD release
PKG_PATH_MAIN="https://ftp.fr.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(arch -s)"
# ERRATA_PATH
ERRATA_PATH="https://ftp.fr.openbsd.org/pub/OpenBSD/patches/$(uname -r)/common"
# PKG_PATH for the corresponding release stable service
PKG_PATH_UPDATE="https://stable.mtier.org/updates/$(uname -r)/$(arch -s)"
# PKG_PATH addition for the corresponding LTS release stable service
#PKG_PATH_UPDATE_LTS="https://user%domain.tld:password@stable.mtier.org/updates-lts/$(uname -r)/$(arch -s)"
# URL to the latest vuxml (vulnerabilities database)
VUXML_URL="https://stable.mtier.org/vuxml/$(uname -r | tr -d '.').xml"
# fetch command (must behave like "ftp -o"); e.g. "wget -qO"
FETCH="ftp -MVo"
# exclusion list: pkg names without version/flavor, separated by space
EXCLUDE_PKG=""
########################################################################
### End of user defined variables ###
########################################################################
usage() {
echo
echo "Usage: ${0##*/} [-K][-Se|c]" >&2
echo
echo "Options:"
echo " -K do not check for kernel binpatches (when running non GENERIC)"
echo " -N do not check for syspatches"
echo " -S ignore binpatch/package signatures"
echo " -c check/cron mode, report only (cannot be used with -S)"
echo " -e echo the PKG_PATH that ${0##*/} would use"
echo
exit 1
}
pr_err() {
echo "!!! ${@}"
}
bye_bye() {
rm -rf ${_TMPDIR} ${_PID}
exit 1
}
pr() {
if [ -z "${checkrun}" ]; then
echo "===> ${@}"
fi
}
get_key() {
[ -r /etc/signify/mtier-${_REL_INT}-pkg.pub ] && return
pr "Downloading and installing public key"
${FETCH} ${_TMPKEY} ${PKG_PUBKEY_URL} || bye_bye
install -m0644 ${_TMPKEY} /etc/signify/mtier-${_REL_INT}-pkg.pub || bye_bye
}
show_env() {
echo PKG_PATH=${PKG_PATH_UPDATE_LTS}:${PKG_PATH_UPDATE}:${PKG_PATH_MAIN}
exit 0
}
check_openupd() {
local _U
pr "Checking for openup update"
_U="${FETCH} - ${OPENUP_URL} | awk -F '=' '/^_OPENUP_VERSION/ { print \$2 }'"
_U=$(eval $_U)
if [ -z "${_U}" ]; then
pr_err "Cannot retrieve ${OPENUP_URL}"
pr_err "Please verify your Internet connection, proxy settings and firewall."
bye_bye
fi
if [ "${_OPENUP_VERSION}" -lt "${_U}" ]; then
pr_err "New openup release (version ${_U}) available; please update with:"
pr_err "${FETCH} $(readlink -f $0) ${OPENUP_URL}"
bye_bye
fi
}
# check that we have no installed binpatches from a previous release and
# if so remove the entries manually (we don't want pkg_delete to
# modify nor error out on installed files from newer release/binpatch)
rm_old_bp() {
local _bp
local _BPDB=$(ls -d /var/db/binpatch/{binpatch-,}[0-9]* 2>/dev/null |grep -v ${_REL})
local _BPPKG=$(ls -d /var/db/pkg/binpatch* 2>/dev/null |grep -v binpatch${_REL_INT})
if [ -n "${_BPPKG}" -o -n "${_BPDB}" ]; then
pr "Removing old release binpatch entries"
fi
for _bp in ${_BPPKG} ${_BPDB}; do
rm -rf ${_bp}
done
}
update_syspatches() {
pr "Installing/updating syspatches"
syspatch
if [ $? -gt 0 ]; then
pr_err "syspatch failed; please run syspatch manually"
bye_bye
fi
}
update_binpatches() {
local _BP _b _e
# binpatches can only be found in PKG_PATH_UPDATE{,_LTS) and we
# want to make sure we search in all paths and don't stop at the
# first match we find
for i in ${PKG_PATH_UPDATE_LTS} ${PKG_PATH_UPDATE}; do
_BP="$(pkg_info -Q binpatch${_REL_INT}-${_ARCH} | sed 's/.[^-]*$//' | sort -u)${_BP:+ ${_BP}}"
done
if [ -n "${_BP}" ]; then
for _e in ${EXCLUDE_PKG}; do
set -A _BP -- ${_BP}
_BP="$(for _b in ${_BP[@]}; do echo ${_b} | grep -v "^${_e}$"; done)"
done
_BP=$(echo "${_BP}" | tr '\n' ' ')
pr "Installing/updating binpatch(es)"
pkg_add ${pkgopt} ${_BP} || bye_bye
fi
}
update_pkg() {
local _PKG _e _p
_PKG=$(pkg_info -q | grep -v binpatch${_REL_INT}-${_ARCH})
if [ -n "${_PKG}" ]; then
for _e in ${EXCLUDE_PKG}; do
set -A _PKG -- ${_PKG}
_PKG="$(for _p in ${_PKG[@]}; do echo ${_p} | grep -v "^${_e}-.*"; done)"
done
_PKG=$(echo "${_PKG}" | tr '\n' ' ')
pr "Updating package(s)"
pkg_add -quz ${pkgopt} ${_PKG} || bye_bye
fi
}
# this only outputs the missing syspatches on the system
check_syspatches() {
_SYSPATCHES=$(syspatch -c)
for _p in ${_SYSPATCHES}; do
${FETCH} ${_TMPERRATA} ${ERRATA_PATH}/${_p}.patch.sig
[ -e ${_TMPERRATA} ] || continue
echo "--- ${_p} ---"
echo -n "Available errata: "
awk '/OpenBSD/{f=1;next} /Apply/{f=0;next} f' ${_TMPERRATA} | grep -ve '^$'
done
}
# this only outputs the most recent vulnerability for each matching pkg
check_vuxml() {
local _BP_MATCH _OUTDATED _PKG_MATCH _b _e _p
${FETCH} ${_TMPVUXML} ${VUXML_URL} || bye_bye
perl -pi -e 's,\$ARCH,'"${_ARCH}"',g' ${_TMPVUXML}
if [ "${_REL_INT}" -lt 61 ]; then
_BP_MATCH="$(grep binpatch ${_TMPVUXML} | sed -e 's,<name>,,g;s,</name>,,g;s,\$ARCH,'"${_ARCH}"',g' | sort -u)"
for _e in ${EXCLUDE_PKG}; do
set -A _BP_MATCH -- ${_BP_MATCH}
_BP_MATCH="$(for _b in ${_BP_MATCH[@]}; do echo ${_b} | grep -v "^${_e}$"; done)"
done
fi
_PKG_MATCH=$(pkg_info -q | grep -v binpatch${_REL_INT}-${_ARCH})
for _e in ${EXCLUDE_PKG}; do
set -A _PKG_MATCH -- ${_PKG_MATCH}
_PKG_MATCH="$(for _p in ${_PKG_MATCH[@]}; do echo ${_p} | grep -v "^${_e}-.*"; done)"
done
if [ "${_REL_INT}" -lt 61 ]; then
# set to "quirks" if empty to prevent running pkg_add against an empty pkg list
_OUTDATED=$((pkg_add -Iqn -Dnosig -Dunsigned ${_BP_MATCH:=quirks}; pkg_add -Iqnuz -Dnosig -Dunsigned ${_PKG_MATCH:=quirks}) 2>&1 | \
grep '^NOT CHECKING DIGITAL SIGNATURE FOR ' | \
sed -e 's,^NOT CHECKING DIGITAL SIGNATURE FOR ,,g' | \
grep -v '^quirks-' | \
perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"' | \
sort -u)
else
# set to "quirks" if empty to prevent running pkg_add against an empty pkg list
_OUTDATED=$((pkg_add -Inuvz -Dnosig -Dunsigned ${_PKG_MATCH:=quirks}) 2>&1 | \
grep '^Adding.*(pretending)' | sort -u | sed -e 's,Adding ,,;s,(pretending),,;s,->.*,,' | \
grep -v '^quirks-' | \
perl -ne '/^(.*)-(\d[^-]*)[-]?(\w*)(.*)$/ && print "$1\n"' | \
sort -u)
fi
for p in ${_OUTDATED}
do
echo "--- ${p} ---\n"
echo "Available update(s): "
# XXX how do we print only the 1st matching range in awk?
awk "/<name>${p}<\/name>/,/<\/vuln>/" ${_TMPVUXML} | \
sed '/<\/vuln>/,$d' | \
sed -n -e 's/.*<range><lt>\(.*\)<\/lt><\/range>.*/\1/p' \
-e 's/.*<p>\(.*\)<\/p>.*/\1/p' | uniq | \
while read l; do echo -n "${l} "; done
echo "\n"
done | fmt | sed '/^$/d'
}
do_i_need_to_reboot() {
# XXX hardcoded PKG_DBDIR
local osversion=$(sysctl -n kern.osversion)
local kern_version=$(sysctl -n kern.version | head -1)
local booted_version=$(what -s /bsd | tail -1 | tr -d '\t')
local booted_time=$(sysctl -n kern.boottime)
local kern_time=$(stat -qf "%Um" /bsd)
local warn=0
# Check /bsd.booted first if available due to kernel relinking
if [ -e /bsd.booted ]; then
[ X"${kern_version}" != X"${booted_version}" ] && warn=1
else
[ "${booted_time}" -lt "${kern_time}" ] && warn=1
fi
if [ ${warn} -gt 0 ]; then
pr_err
pr_err "System must be rebooted after the last kernel update"
pr_err
fi
}
patch_syspatch() {
pr_err
pr_err "Patching syspatch(8) to use syspatches signed by MTier."
pr_err
cp /usr/sbin/syspatch /usr/sbin/syspatch.pre-mtier
sed -i \
"s,openbsd-\${_OSrev}-syspatch.pub,mtier-\${_OSrev}-pkg.pub,g; \
s,/etc/installurl,/etc/installurl-mtier,g" \
/usr/sbin/syspatch
[ -e /etc/installurl-mtier ] || echo https://stable.mtier.org > /etc/installurl-mtier
}
trap "bye_bye" 1 2 3 13 15
if [ -f /etc/openup.conf ]; then
if [ $(stat -f "%SMp%SLp" /etc/openup.conf) != "------" ]; then
pr_err "Unsecure permissions on /etc/openup.conf; please run:"
pr_err "chmod 0600 /etc/openup.conf"
exit 1
fi
. /etc/openup.conf
fi
# regex taken from fw_update(1)
set -A _REL -- $(sysctl -n kern.version | sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
_REL_INT="$(echo ${_REL[0]} | tr -d '.')"
_OPENUP_MINREL=60
_OPENUP_VERSION=33
if [ -n "${_REL[1]}" -a "${_REL[1]}" != "-stable" ]; then _badrel=1; fi
if [ "${_REL_INT}" -lt "${_OPENUP_MINREL}" ]; then _badrel=1; fi
if [ -n "${_badrel}" ]; then
pr_err "${_REL[0]}${_REL[1]} is not a supported release"
exit 1
fi
while getopts 'KNSce' arg; do
case ${arg} in
K) if [ "${_REL_INT}" -lt 61 ]; then nokrn=1; fi ;;
N) nosyspatch=1 ;;
S) nosig=1; pkgopt="${pkgopt} -Dnosig -Dunsigned" ;;
c) checkrun=1 ;;
e) showenv=1 ;;
*) usage ;;
esac
done
[ $# = $(($OPTIND-1)) ] || usage
[ -n "${showenv}" ] && show_env
if [ "$(id -u)" -ne 0 ]; then
pr_err "Need root privileges to run this script"
usage
fi
[ -n "${checkrun}" -a -n "${nosig}" -a -n "${showenv}" ] && usage
_ARCH=$(arch -s)
_PID="/var/run/${0##*/}.pid"
_TMP="${TMPDIR:=/tmp}"
_TMPDIR=$(mktemp -dp ${_TMP} .openup-XXXXXXXXXX) || exit 1
_TMPKEY="${_TMPDIR}/key"
_TMPVUXML="${_TMPDIR}/vuxml"
_TMPERRATA="${_TMPDIR}/errata"
export PKG_PATH=${PKG_PATH_UPDATE_LTS}:${PKG_PATH_UPDATE}:${PKG_PATH_MAIN}
if [ -f ${_PID} ]; then
pr_err "openup is already running ($(cat ${_PID})):"
pr_err "${_PID}"
exit 1
fi
echo $$ >${_PID}
if [ -n "${nokrn}" ]; then
EXCLUDE_PKG="binpatch${_REL_INT}-${_ARCH}-kernel ${EXCLUDE_PKG}"
fi
if [ -n "${EXCLUDE_PKG}" ]; then
pr "Excluded package(s)/binpatch(es): ${EXCLUDE_PKG}"
fi
check_openupd
if [ -z "${nosyspatch}" -a -e /usr/sbin/syspatch ]; then
_sum=$(sha256 -q /usr/sbin/syspatch)
case "${_sum}"
in
# 6.1 syspatch
b8b9c4bec128884498b5c3e77a350f42079f7987ef862a1ec452f489403dfbe6)
patch_syspatch
;;
esac
fi
if [ "${checkrun}" ]; then
if [ "${_REL_INT}" -ge 61 -a -z "${nosyspatch}" ]; then
check_syspatches
fi
check_vuxml
else
[ -z "${nosig}" ] && get_key
rm_old_bp
if [ "${_REL_INT}" -lt 61 -a -z "${nosyspatch}" ]; then
update_binpatches
else
[ -z "${nosyspatch}" ] && update_syspatches
fi
update_pkg
fi
do_i_need_to_reboot
rm -rf ${_TMPDIR}
rm ${_PID}

2
.bin/OLD/KAPUTT/osd_pipe.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
osd_cat -l1 -p top -o 1 -A right -O 1 -s 1 -o 40 -w -d4 -i 20 -c "#eeeeee" -f "-xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso8859-15" -

15
.bin/OLD/KAPUTT/rec_encode Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
_vidfile="/home/sdk/work/rec-screen.mkv"
_micfile="/home/sdk/work/rec-mic-clean.wav"
_outfile="${_vidfile%%.*}-$(date "+%Y%m%d_%H%M%S").mp4"
ffmpeg -y -i $_vidfile \
-i $_micfile \
-c:v libx265 \
-c:a aac -shortest \
-crf 21 -s 1920x1080 \
-preset medium -movflags faststart \
-threads $(sysctl -n hw.ncpuonline) \
$_outfile \
&& echo "Done encoding $(readlink -f $_outfile)"

View File

@@ -0,0 +1,13 @@
#!/bin/sh
_vidfile="/home/sdk/work/rec-screen.mkv"
_outfile="${_vidfile%%.*}-$(date "+%Y%m%d_%H%M%S").mp4"
ffmpeg -y -i $_vidfile \
-c:v libx265 \
-c:a aac -shortest \
-crf 21 -s 1920x1080 \
-preset medium -movflags faststart \
-threads $(sysctl -n hw.ncpuonline) \
$_outfile \
&& echo "Done encoding $(readlink -f $_outfile)"

79
.bin/OLD/KAPUTT/rec_scr Executable file
View File

@@ -0,0 +1,79 @@
#!/bin/sh
screen=0
microphone=0
system_audio=0
select _sel in \
"Record screen" \
"Record microphone" \
"Record system audio" \
"Start recording" \
"Quit"
do
case "$_sel" in
"Record screen") screen=1; ;;
"Record microphone") microphone=1; ;;
"Record system audio") system_audio=1; ;;
"Start recording") break; ;;
"Quit") exit 0; ;;
esac
[ screen -eq 1 ] && echo "Screen recording: enabled" \
|| echo "Screen recodding: disabled"
[ microphone -eq 1 ] && echo "Microphone recording: enabled" \
|| echo "Microphone recodding: disabled"
done
clear
set -x
AUDIOMONDEVICE=snd/0.mon
AUDIOPLAYDEVICE=snd/0.default
AUDIORECDEVICE=snd/0.rec
AUDIOMONPID=X
AUDIORECPID=X
trap rec_stop 0 1 2 3 6
rec_stop() {
kill $AUDIORECPID $AUDIOMONPID
}
rec_mon() {
aucat -f $AUDIOMONDEVICE -o $HOME/work/rec-mon.wav &
AUDIOMONPID=$!
}
rec_mic() {
aucat -o $HOME/work/rec-mic.wav &
AUDIORECPID=$!
}
rec_screen() {
echo 'Press q to stop.'
ffmpeg -y -loglevel warning -hide_banner \
-fflags genpts \
-flags low_delay \
-thread_queue_size 256 \
-framerate 30 \
-f x11grab \
-probesize 16M \
-i :0.0 \
-c:v libx264rgb \
-crf 0 \
-qp 0 -framerate 30 \
-sws_flags neighbor \
-preset ultrafast \
-tune zerolatency \
$HOME/work/rec-screen.mkv
}
rec_mon
rec_mic
rec_screen
rec_stop
shotcut --noupgrade --fullscreen --clear-recent $HOME/work/rec-screen.mkv $HOME/work/rec-*.wav

83
.bin/OLD/KAPUTT/rec_screen Executable file
View File

@@ -0,0 +1,83 @@
#!/bin/sh
audio() {
# set mixer controls
print configuring microphone
mixerctl -q record.adc-0:1_source=mic2
mixerctl -q record.adc-2:3_source=mic2
mixerctl -q inputs.mix_source=mic2
}
webcam() {
printf 'start webcam\n'
doas mpv --quiet \
--panscan=1 \
--framedrop=vo \
--ontop av://v4l2:/dev/video0 \
--profile=low-latency \
--untimed \
--vf=hflip \
--geometry=220x180 2>&1 > /dev/null &
print move the picture to the right place and press any key
read
}
capture() {
printf 'starting recording... press q to stop\n'
RES=$(xwininfo -root | grep 'geometry' | awk '{print $2;}' |cut -d"+" -f1)
ffmpeg -y -loglevel warning \
-thread_queue_size 256 \
-probesize 10000000 \
-hide_banner \
-f sndio \
-i default \
-c:a flac \
-f x11grab \
-s $RES \
-i :0.0 \
-r 25 \
-c:v libx265 \
-crf 0 \
-qp 0 \
-preset ultrafast \
-g 50 \
-keyint_min 25 \
$HOME/work/rec_screen.mkv
}
encode() {
printf 'encoding video\n'
ffmpeg -y \
-i $HOME/work/rec_screen.mkv \
-c:v libx265 \
-crf 21 \
-s 1920x1080 \
-preset medium \
$HOME/work/rec_screen.mp4
}
printf '
(1) desktop only (works on linux)
(2) desktop + audio
(3) desktop + webcam + audio
'
printf ": "
read sel
case $sel in
1) capture;
encode;
;;
2) audio;
capture;
encode;
;;
3) audio;
webcam;
capture;
encode;
;;
esac

71
.bin/OLD/KAPUTT/recscr Executable file
View File

@@ -0,0 +1,71 @@
#!/bin/sh -xe
clear
AUDIOPLAYDEVICE=snd/0.default
AUDIORECDEVICE=snd/0.rec
AUDIOMONDEVICE=snd/0.mon
AUDIOMONPID=X
AUDIORECPID=X
trap rec_stop 1 2 3 6
rec_stop() {
kill $AUDIORECPID $AUDIOMONPID
}
rec_mon() {
aucat -f $AUDIOMONDEVICE -o $HOME/work/rec-mon.wav &
AUDIOMONPID=$!
}
rec_mic() {
aucat -j on -c 0:0 -o $HOME/work/rec-mic.wav &
AUDIORECPID=$!
}
rec_screen() {
echo 'Press q to stop.'
#ffmpeg -y \
# -loglevel warning \
# -hide_banner \
# -fflags genpts \
# -flags low_delay \
# -thread_queue_size 256 \
# -framerate 30 \
# -f x11grab \
# -probesize 16M \
# -i :0.0 \
# -c:v libx264rgb \
# -crf 0 \
# -qp 0 -framerate 30 \
# -sws_flags neighbor \
# -preset ultrafast \
# -tune zerolatency \
# $HOME/work/rec-screen.mkv
ffmpeg -y -loglevel warning -hide_banner \
-f x11grab -i :0.0 -c:v libx264rgb -crf 0 -qp 0 -framerate 30 -sws_flags neighbor -preset ultrafast -tune zerolatency $HOME/work/rec-screen.mkv \
-f sndio -i $AUDIORECDEVICE -c:a copy $HOME/work/rec-mic.wav \
-f sndio -i $AUDIOMONDEVICE -c:a copy $HOME/work/rec-mon.wav
}
#rec_mon
#rec_mic
rec_screen
#rec_stop
sleep 0.5
sox $HOME/work/rec-mic.wav -n trim 0 5 noiseprof \
| sox $HOME/work/rec-mic.wav $HOME/work/rec-mic-clean.wav \
noisered - 0.2 bass 5 contrast
#sox $HOME/work/rec-mic.wav $HOME/work/rec-mic-clean.wav bass 5 contrast
printf "[A]utoencode or [S]hotcut: "
read S
case $S in
[aA]) rec_encode; ;;
[sS]) shotcut --noupgrade --fullscreen --clear-recent $HOME/work/rec-screen.mkv $HOME/work/rec-*.wav; ;;
*) ;;
esac

2
.bin/OLD/KAPUTT/screen-make Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
ssh ld7078 "screen -S make -p 0 -X stuff \"./mymake.sh -p krn/ms prg;`echo '\015'`\""

4
.bin/OLD/KAPUTT/sdedit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dawt.useSystemAAFontSettings=on'
export _JAVA_AWT_WM_NONREPARENTING=1
java -jar $HOME/.bin/sdedit-*.jar

BIN
.bin/OLD/KAPUTT/sdedit-4.2.1.jar Executable file

Binary file not shown.

2
.bin/OLD/KAPUTT/select_audio Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh

View File

@@ -0,0 +1,15 @@
#!/bin/sh
while true;
do
FILES=$(ls -1 | grep -v shotwell | grep -vi xmp | grep -vi jpg | wc -l | awk '{ print $1 }')
THUMBS=$(ls -1 | grep shotwell | grep -vi "xmp\|jpg\|jpeg" | wc -l | awk '{ print $1 }')
OUT="T: $THUMBS | F: $FILES"
printf "$OUT\n"
if [ "$FILES" == "$THUMBS" ];
then notify-send "Shotwell Import Finished: ${PWD##*/} $OUT"
printf "${PWD##*/}" | xclip -r
exit 0
fi
sleep 5
done

28
.bin/OLD/KAPUTT/subfzf Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/sh
subsonic() {
subsonic-cli -c /home/sdk/.subsonic-cli.conf $@
}
next=1
offset=0
until [ $next -eq 0 ]
do
_someAlbums=$(subsonic \
-p type alphabeticalByArtist \
-p size 500 -p offset $offset getAlbumList2 \
| jq .albumList2.album[])
offset=$(( offset + 500 ))
_fullAlbums="\
$_fullAlbums
$_someAlbums
"
if [ -z "$_someAlbums" ]
then
next=0
fi
done
echo $_fullAlbums | jq

View File

@@ -0,0 +1,3 @@
#!/bin/sh
doas curl "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts" -o /etc/hosts
#doas curl "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-social/hosts" -o /etc/hosts

6
.bin/OLD/KAPUTT/vidoas Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/ksh
TMP=$(mktemp)
cp /etc/doas.conf $TMP
$EDITOR $TMP
doas -C $TMP && mv $TMP /etc/doas.conf;
rm -f $TMP