2022-12-04 22:59:34 +01:00
|
|
|
# ksh environment file
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# ENVIRONMENT VARIABLES
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
### SEARCH PATHS
|
|
|
|
PATH=\
|
|
|
|
:~/.bin\
|
|
|
|
:/bin\
|
|
|
|
:/sbin\
|
|
|
|
:/usr/bin\
|
|
|
|
:/usr/sbin\
|
|
|
|
:/usr/local/bin\
|
|
|
|
:/usr/local/sbin\
|
|
|
|
:/usr/X11R6/bin\
|
|
|
|
:/usr/games\
|
|
|
|
:/usr/ports/infrastructure/bin\
|
|
|
|
:/usr/local/cobol/bin
|
2022-12-17 10:27:50 +01:00
|
|
|
JAVA_HOME=/usr/local/jdk-11/bin
|
|
|
|
PATH=${PATH}:${JAVA_HOME}
|
|
|
|
PATH=${PATH}:/opt/zodiac/bin
|
2022-12-27 19:16:20 +01:00
|
|
|
PATH=${PATH}:/opt/stagit/bin
|
2022-12-04 22:59:34 +01:00
|
|
|
export PATH
|
|
|
|
|
|
|
|
MANPATH=/usr/share/man:/usr/X11R6/man:/usr/local/man
|
|
|
|
export MANPATH
|
|
|
|
|
|
|
|
### LANGUAGE
|
|
|
|
LANG=en_US.UTF-8
|
|
|
|
LC_ALL=en_US.UTF-8
|
|
|
|
LC_MESSAGES=C
|
|
|
|
LC_NUMERIC=C
|
|
|
|
LC_TIME=en_US.UTF-8
|
|
|
|
export LANG LC_ALL LC_MESSAGES LC_NUMERIC LC_TIME
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# STOP HERE IF NON INTERACTIVE
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# INTERACTIVE ENVIRONMENT
|
|
|
|
########################################################################
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
case $(hostname) in
|
2022-12-04 22:59:34 +01:00
|
|
|
*.home.codevoid.de) PKGOPT="-Dsnap"; ;;
|
|
|
|
openbsd.codevoid.de) PKGOPT="-Dsnap"; ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
### HISTORY
|
|
|
|
HISTCONTROL=ignoredups:ignorespace:erasedups
|
|
|
|
HISTFILE=$HOME/.ksh-history
|
|
|
|
HISTSIZE=2000
|
|
|
|
export HISTCONTROL HISTFILE HISTSIZE
|
|
|
|
|
|
|
|
### CDPATH
|
|
|
|
CDPATH=.:/usr/ports:~/code
|
|
|
|
export CDPATH
|
|
|
|
|
|
|
|
### SOFTWARE PREFERENCES
|
|
|
|
EDITOR="vim"
|
|
|
|
VISUAL="vim"
|
2022-12-23 09:36:12 +01:00
|
|
|
BROWSER="luakit -un"
|
2022-12-04 22:59:34 +01:00
|
|
|
PAGER="less"
|
2023-01-10 22:18:46 +01:00
|
|
|
export EDITOR VISUAL BROWSER PAGER
|
|
|
|
|
|
|
|
### TUIR (reddit)
|
|
|
|
TUIR_BROWSER="$BROWSER"
|
|
|
|
export TUIR_BROWSER
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
### NNN
|
2022-12-19 09:51:31 +01:00
|
|
|
NNN_OPTS="cErxAJBR"
|
2022-12-04 22:59:34 +01:00
|
|
|
NNN_OPENER="nnn.sh"
|
2022-12-08 14:26:14 +01:00
|
|
|
NNN_FIFO=/tmp/nnn.fifo
|
2022-12-27 19:16:20 +01:00
|
|
|
NNN_PLUG='o:-!mpv "$nnn";x:!imagesort;p:!pdfarranger "$nnn" > /dev/null 2>&1 &'
|
2022-12-04 22:59:34 +01:00
|
|
|
NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$"
|
|
|
|
NNN_COLORS='#0a1b2c3d;1234'
|
|
|
|
NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
|
2023-01-10 22:18:46 +01:00
|
|
|
export NNN_OPTS NNN_OPENER NNN_PLUG NNN_ARCHIVE
|
2022-12-08 14:26:14 +01:00
|
|
|
export NNN_COLORS NNN_FCOLORS NNN_FIFO
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
# LESS
|
2023-01-10 22:18:46 +01:00
|
|
|
LESS="-giJmR--tilde"
|
2022-12-04 22:59:34 +01:00
|
|
|
LESSHISTFILE="$HOME/.less-history"
|
|
|
|
export LESS LESSHISTFILE
|
|
|
|
|
|
|
|
### SLNR
|
|
|
|
SLRNPULL_ROOT=$HOME/.slrnpull
|
|
|
|
NNTPSERVER=read.news.tnib.de
|
|
|
|
export SLRNPULL_ROOT NNTPSERVER
|
|
|
|
|
|
|
|
### GOT
|
|
|
|
GOT_AUTHOR="Stefan Hagen <sh+got@codevoid.de>"
|
|
|
|
TOG_COLORS=1
|
2023-01-10 22:18:46 +01:00
|
|
|
export GOT_AUTHOR TOG_COLORS
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
### BUPSTASH
|
|
|
|
BUPSTASH_REPOSITORY=ssh://sdk@storage.bupstash.io
|
|
|
|
#export BUPSTASH_KEY=/home/sdk/backups.key
|
|
|
|
export BUPSTASH_REPOSITORY
|
|
|
|
|
|
|
|
### PASSWORD-STORE
|
|
|
|
PASSWORD_STORE_ENABLE_EXTENSIONS=true
|
|
|
|
export PASSWORD_STORE_ENABLE_EXTENSIONS
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# PROMPT (SIMPLE)
|
|
|
|
########################################################################
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
PS1="\h|\${?}\w\\$ "
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# SHELL SETTINGS
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
ulimit -c 0
|
|
|
|
stty -ixon -ixoff
|
|
|
|
set -o emacs
|
|
|
|
set bell-style none
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# ALIASES
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
# configuration files
|
|
|
|
alias ssh-config="gpg-edit ~/.ssh/config"
|
|
|
|
alias kshrc="vim ~/.kshrc"
|
|
|
|
alias muttrc="vim ~/.mutt/rc-common"
|
|
|
|
alias vimrc="vim ~/.vim/vimrc"
|
|
|
|
alias kludges="vim ~/.notion/cfg_kludges.lua"
|
|
|
|
alias spectrwmrc="vim ~/.config/spectrwm/spectrwm.conf"
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# remind
|
|
|
|
alias rem="remind -c+cl3 ~/.reminders"
|
2023-01-07 15:07:46 +01:00
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# mastodon
|
|
|
|
alias toot-sh="toot tui -u sh@bsd.network"
|
|
|
|
alias toot-uug="toot tui -u uugrn@chaos.social"
|
2022-12-21 08:41:17 +01:00
|
|
|
|
2023-01-13 13:46:11 +01:00
|
|
|
alias toot-sh-post="toot post -u sh@bsd.network -e vim"
|
|
|
|
alias toot-uug-post="toot post -u uugrn@chaos.social -e vim"
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# mupdf
|
|
|
|
alias mupdf="mupdf-gl -XJ"
|
2023-01-07 15:07:46 +01:00
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
# system
|
|
|
|
alias sudo="doas"
|
|
|
|
alias su="doas su"
|
|
|
|
|
|
|
|
# translation
|
|
|
|
alias trans-en="trans -l de -s en -t de --no-ansi"
|
|
|
|
alias trans-de="trans -l en -s de -t en --no-ansi"
|
|
|
|
|
|
|
|
# packages
|
|
|
|
alias pkg_add="doas \pkg_add ${PKGOPT}"
|
|
|
|
alias pkg_delete="doas \pkg_delete ${PKGOPT}"
|
|
|
|
alias pkg_info="\pkg_info ${PKGOPT}"
|
2023-01-10 22:18:46 +01:00
|
|
|
pkg_reset() { pkg_delete -cIX $(</home/sdk/.pkglist); }
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# servers
|
2022-12-04 22:59:34 +01:00
|
|
|
x() { ssh -t home.codevoid.de 'tmux -u attach || tmux -u'; }
|
|
|
|
t() { ssh -t tweety.home.codevoid.de 'tmux -u attach || tmux -u'; }
|
|
|
|
b() { ssh -t barton.oldbsd.de 'tmux -u attach || tmux -u'; }
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
scr() { [ -z "$1" ] && doas wsconsctl -n display.brightness \
|
|
|
|
|| doas wsconsctl display.brightness="$1"; }
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
# mount
|
|
|
|
alias mount_msdos="doas \mount_msdos -o nodev,nosuid,noatime -u 1000 -g 1000"
|
|
|
|
mount_tank() { awk '$3=="nfs"{print $2}' /etc/fstab | xargs -n1 doas mount; }
|
|
|
|
umount_tank() { awk '$3=="nfs"{print $2}' /etc/fstab | xargs -n1 doas umount; }
|
|
|
|
|
|
|
|
# gopher bookmarks
|
|
|
|
alias fefe="sacc gopher://codevoid.de/1/fefe"
|
|
|
|
alias hn="sacc gopher://codevoid.de/1/hn"
|
|
|
|
alias cv="sacc gopher://codevoid.de"
|
|
|
|
|
|
|
|
# pim
|
2023-01-11 08:25:32 +01:00
|
|
|
alias notes="vim ~/Documents/notes/notes.txt"
|
|
|
|
alias events="vim ~/Documents/events.txt"
|
2023-01-10 22:18:46 +01:00
|
|
|
alias caly="ncal -Cy"
|
|
|
|
alias calm="ncal -3C"
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
# music
|
|
|
|
alias music_psychedelik="mpg123 -b 1024 http://62.210.114.63:8000"
|
|
|
|
alias music_progressive="mpg123 -b 1024 http://62.210.114.63:8010"
|
|
|
|
alias music_drum-n-bass="mpg123 -b 1024 http://62.210.114.63:8030"
|
|
|
|
alias music_ambient="mpg123 http://62.210.114.63:8002/listen.mp3"
|
|
|
|
alias music_tilderadio="ogg123 https://tilderadio.org/listen"
|
|
|
|
alias music_bitreich="mpv gopher://bitreich.org/9/radio/listen"
|
|
|
|
alias flac_encode="flac -e --best --delete-input-file"
|
|
|
|
|
|
|
|
# security
|
|
|
|
alias htpasswd-openssl="openssl passwd -apr1"
|
2023-01-10 22:18:46 +01:00
|
|
|
alias inssh="ssh -o HostKeyAlgorithms=+ssh-rsa \
|
|
|
|
-o KexAlgorithms=+diffie-hellman-group1-sha1 \
|
|
|
|
-o Ciphers=+aes256-cbc"
|
|
|
|
alias my-ssh-pubkey="pass Keystore/ssh-private | head -n1"
|
|
|
|
alias my-ssh-seckey="pass Keystore/ssh-private | tail -n7"
|
|
|
|
alias my-gpg-pubkey="gpg --export-options export-minimal --export -a 52BE43BA"
|
|
|
|
alias my-gpg-seckey="gpg --export-options export-minimal --export-secret-keys -a 52BE43BA"
|
2023-01-11 09:38:57 +01:00
|
|
|
pw() { pwgen -1 -y --remove-chars=\~\`\"\'{}\(\)\[\]\*.\;\|,\<\> 22; }
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
# backup
|
|
|
|
alias tarsnap="doas \tarsnap"
|
|
|
|
|
|
|
|
# archives
|
|
|
|
alias innoextract="\innoextract -g --no-gog-galaxy"
|
|
|
|
|
|
|
|
# games
|
|
|
|
alias quake="\vkquake +game id1"
|
|
|
|
alias quake-mp1-scourge_of_armagon="\vkquake +game hipnotic"
|
|
|
|
alias quake-mp2-dissolution_of_eternity="\vkquake +game rogue"
|
|
|
|
alias quake2="\quake2 +game baseq2"
|
|
|
|
alias quake2-mp1-the_reconning="\quake2 +game xatrix"
|
|
|
|
alias quake2-mp2-ground_zero="\quake2 +game rogue"
|
|
|
|
alias quake2-ex1-jaggernaut="\quake2 +game jaggernaut"
|
|
|
|
alias quake2-ex2-zaero="\quake2 +game zaero"
|
|
|
|
alias doom3="dhewm3 +set r_fullscreen 1 +set com_fixedtic -1"
|
|
|
|
alias steam-list="steamctl --user sdk82 apps list"
|
|
|
|
alias steam-download="steamctl --user sdk82 depot download -os linux64 -a"
|
|
|
|
|
|
|
|
# terminal internet stuff
|
|
|
|
alias terminal_map="telnet mapscii.me"
|
|
|
|
alias terminal_bofh="telnet towel.blinkenlights.nl 666"
|
|
|
|
alias terminal_starwars="telnet towel.blinkenlights.nl 23"
|
|
|
|
alias terminal_cnn="links http://lite.cnn.io/en"
|
|
|
|
alias terminal_8ball="lynx -width=300 --dump https://codevoid.de/8Ball"
|
|
|
|
alias terminal_weather="curl wttr.in/Hockenheim"
|
|
|
|
alias terminal_bbs="telnet gopher.su 1234"
|
|
|
|
alias terminal_unix50="ssh unix50@unix50.org"
|
|
|
|
|
|
|
|
# bookmarks
|
2023-01-07 15:07:46 +01:00
|
|
|
alias uug-mastodon="firefox https://chaos.social/@uugrn"
|
2022-12-04 22:59:34 +01:00
|
|
|
alias uug-twitter="firefox https://twitter.com/@uugrn"
|
|
|
|
alias discord-me="firefox https://discord.com/channels/@me"
|
|
|
|
alias discord-immortals="firefox https://discord.com/channels/991041843871502366/1000826654974812160"
|
|
|
|
alias cups-config="firefox http://localhost:631"
|
|
|
|
|
|
|
|
# monitoring
|
|
|
|
lr() {
|
2022-12-13 23:16:23 +01:00
|
|
|
[ -z "$1" ] && return 2
|
|
|
|
[ -z "$2" ] \
|
|
|
|
&& ssh -t "$1" -- doas tail -n 4000 -f /var/log/{messages,daemon,secure,maillog} \
|
|
|
|
|| ssh -t "$1" -- doas tail -n 4000 -f /var/log/{messages,daemon,secure,maillog} \
|
|
|
|
| fgrep -i "$2"
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
|
|
|
l() {
|
2022-12-13 23:16:23 +01:00
|
|
|
[ -z "$1" ] \
|
|
|
|
&& doas tail -n 4000 -f /var/log/{messages,daemon,secure,maillog} \
|
|
|
|
|| doas tail -n 4000 -f /var/log/{messages,daemon,secure,maillog} \
|
|
|
|
| fgrep -i "$1"
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# EMAIL HANDLING
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
# mailboxes
|
|
|
|
MUTT_HOST="imaps://mail.codevoid.de"
|
|
|
|
|
|
|
|
# account aliases
|
|
|
|
alias mutt-acc-gmx="\mutt -F $HOME/.mutt/rc-account-gmx"
|
|
|
|
alias mutt-acc-priv="\mutt -F $HOME/.mutt/rc-account-private"
|
|
|
|
alias mutt-acc-work="\mutt -F $HOME/.mutt/rc-account-work"
|
|
|
|
alias mutt-acc-offl="\mutt -F $HOME/.mutt/rc-account-offline"
|
|
|
|
alias mutt-acc-mborg="\mutt -F $HOME/.mutt/rc-account-mborg"
|
|
|
|
alias mutt-acc-uugrn="\mutt -F $HOME/.mutt/rc-account-uugrn"
|
|
|
|
|
|
|
|
# default
|
|
|
|
alias mutt="mutt-acc-priv"
|
|
|
|
alias muttopen="\mutt -F ~/.mutt/rc-common -f"
|
|
|
|
|
|
|
|
# select mailbox
|
|
|
|
mutt-textmail() { mutt-acc-priv -f $MUTT_HOST/Mailboxes/textmail.me/$1; }
|
|
|
|
mutt-codevoid() { mutt-acc-priv -f $MUTT_HOST/Mailboxes/codevoid.de/sh+$1; }
|
|
|
|
|
|
|
|
# shortcuts
|
|
|
|
alias mutt-all="mutt -f $MUTT_HOST/Virtual/ALL"
|
|
|
|
alias mutt-amazon="mutt-textmail amazon"
|
|
|
|
alias mutt-ccc-intern="mutt-textmail ccc-intern"
|
|
|
|
alias mutt-last-day="mutt -f $MUTT_HOST/Virtual/LAST_DAY"
|
|
|
|
alias mutt-last-week="mutt -f $MUTT_HOST/Virtual/LAST_WEEK"
|
|
|
|
alias mutt-last-month="mutt -f $MUTT_HOST/Virtual/LAST_MONTH"
|
|
|
|
alias mutt-last-year="mutt -f $MUTT_HOST/Virtual/LAST_YEAR"
|
|
|
|
alias mutt-lieferando="mutt-textmail lieferando"
|
|
|
|
alias mutt-mutt-users="mutt-codevoid mutt-users"
|
|
|
|
alias mutt-openbsd-all="mutt -f $MUTT_HOST/Virtual/OpenBSD"
|
|
|
|
alias mutt-openbsd-bugs="mutt-codevoid openbsd-bugs"
|
|
|
|
alias mutt-got="mutt-codevoid got"
|
|
|
|
alias mutt-openbsd-hackers="mutt-codevoid openbsd-hackers"
|
|
|
|
alias mutt-openbsd-misc="mutt-codevoid openbsd-misc"
|
|
|
|
alias mutt-openbsd-ports-bugs="mutt-codevoid openbsd-ports-bugs"
|
|
|
|
alias mutt-openbsd-ports-cvs="mutt-codevoid openbsd-ports-cvs"
|
|
|
|
alias mutt-openbsd-ports="mutt-codevoid openbsd-ports"
|
|
|
|
alias mutt-openbsd-x11="mutt-codevoid openbsd-x11"
|
|
|
|
alias mutt-openbsd-sparc="mutt-codevoid openbsd-sparc"
|
|
|
|
alias mutt-openbsd-src-cvs="mutt-codevoid openbsd-src-cvs"
|
|
|
|
alias mutt-openbsd-tech="mutt-codevoid openbsd-tech"
|
|
|
|
alias mutt-paypal="mutt-textmail paypal"
|
|
|
|
alias mutt-uugrn="mutt-codevoid uugrn"
|
|
|
|
alias mutt-vorstand="mutt-codevoid vorstand"
|
|
|
|
alias otech="mutt -f $MUTT_HOST/Virtual/OpenBSD-tech"
|
|
|
|
alias oports="mutt -f $MUTT_HOST/Virtual/OpenBSD-ports"
|
|
|
|
alias omisc="mutt -f $MUTT_HOST/Virtual/OpenBSD-misc"
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# OPENBSD PORT TOOLS
|
|
|
|
########################################################################
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# CVS
|
2022-12-04 23:08:46 +01:00
|
|
|
CVSROOT=sdk@cvs.openbsd.org:/cvs
|
|
|
|
alias cvs-diff="cvs -d $CVSROOT diff -uNp"
|
2022-12-13 23:16:23 +01:00
|
|
|
alias cvs-commit="doas cvs -d $CVSROOT commit"
|
2022-12-04 23:08:46 +01:00
|
|
|
alias cvs-update="doas cvs -z 1 -d $CVSROOT -q up -Pd -A"
|
2022-12-13 23:16:23 +01:00
|
|
|
alias cvs-release="cvs -d $CVSROOT release"
|
|
|
|
alias cvs-checkout="doas cvs -z 1 -qd $CVSROOT checkout -P"
|
|
|
|
cvs-import-simulate() {
|
2023-01-10 22:18:46 +01:00
|
|
|
cvs -d sdk@cvs.openbsd.org:/cvs \
|
|
|
|
-n import ports/$(dirname $PWD)/$(basename $PWD) sdk sdk_$(date +"%Y%m%d")
|
2023-01-08 17:34:37 +01:00
|
|
|
}
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# PORTS
|
|
|
|
portclean() {(
|
|
|
|
cd /usr/ports
|
|
|
|
doas rm -rf pobj/* plist logs packages bulk update
|
|
|
|
doas make fix-permissions > /dev/null
|
|
|
|
)}
|
|
|
|
pmark() { pwd > /var/cache/pmark; }
|
|
|
|
p() { cd "$(</var/cache/pmark)"; }
|
|
|
|
pj() { cd "$(port jump $1)"; }
|
2022-12-13 23:16:23 +01:00
|
|
|
po() { cd "$(</var/cache/pmark)" && cd "$(make show=WRKSRC)"; }
|
2022-12-04 22:59:34 +01:00
|
|
|
alias portsweep='doas find . \( -name "*.orig" -or -empty \) -delete'
|
2022-12-13 23:16:23 +01:00
|
|
|
pdiff() {(
|
2023-01-10 22:18:46 +01:00
|
|
|
pwd | fgrep -q '/usr/ports/' || return 1
|
|
|
|
set -A N $(make show="PKGNAME EPOCH REVISION")
|
|
|
|
PN="${N[0]}${N[1]:+v${N[1]}}${N[2]:+p${N[2]}}"
|
|
|
|
PD=$(pwd | cut -d"/" -f4,5)
|
|
|
|
cd /usr/ports
|
|
|
|
doas cvs -d sdk@cvs.openbsd.org:/cvs diff -uNp "${PD}" \
|
|
|
|
> "/home/sdk/diffs/${PN}.diff"
|
|
|
|
echo "/home/sdk/diffs/${PN}.diff"
|
2022-12-13 23:16:23 +01:00
|
|
|
|
|
|
|
)}
|
2022-12-04 22:59:34 +01:00
|
|
|
alias port-modgo-update='make MODGO_VERSION=latest modgo-gen-modules > modules.inc'
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
# DPB
|
2022-12-04 22:59:34 +01:00
|
|
|
alias proot-rebuild="doas proot -c /etc/proot.conf; doas chroot /home/dpb pkg_add ccache"
|
|
|
|
alias proot-do="doas chroot /home/dpb/"
|
|
|
|
alias dmake="doas /usr/ports/infrastructure/bin/dpb -B /home/dpb -c -p 4 -j 4"
|
|
|
|
|
2022-12-13 23:16:23 +01:00
|
|
|
########################################################################
|
|
|
|
# KERNEL STUFF
|
|
|
|
########################################################################
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2022-12-13 23:16:23 +01:00
|
|
|
alias update-ksh="cd /usr/src/bin/ksh \
|
|
|
|
&& doas make clean \
|
|
|
|
&& doas make obj \
|
|
|
|
&& doas make \
|
|
|
|
&& doas make install"
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# TWITCH FROM CLI
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
alias twitch-play="mpv https://www.twitch.tv/c0dev0id"
|
|
|
|
twitch-stream() {
|
|
|
|
local API_KEY=$(pass Internet/Twitch | head -1)
|
|
|
|
local RES=$(xrandr | grep "*+" | awk '{print $1}')
|
|
|
|
local FAUX_OPTS="-d snd/default -m -vmic 5.0 -vmon 0.2 -r $RES -f 20 -b 4000"
|
2022-12-13 23:16:23 +01:00
|
|
|
fauxstream $FAUX_OPTS rtmp://live-ams.twitch.tv/app/$API_KEY
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# DOTFILES WITH GIT
|
|
|
|
########################################################################
|
|
|
|
|
2022-12-17 23:03:45 +01:00
|
|
|
alias config='git --git-dir=${HOME}/.cfg/ --work-tree=${HOME}'
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
dotfiles_autoupdate() {
|
|
|
|
config add -u && \
|
|
|
|
config commit -m "Update $(date +"%Y-%m-%d %H:%M") \
|
|
|
|
$(uname -s)/$(uname -m)" && config push
|
|
|
|
}
|
|
|
|
|
|
|
|
dotfiles_init() {
|
|
|
|
git --no-replace-objects clone --bare --depth 1 \
|
2023-01-10 14:18:52 +01:00
|
|
|
_gitea@git.uugrn.org:sdk/dotfiles.git $HOME/.cfg;
|
2022-12-04 22:59:34 +01:00
|
|
|
config config --local status.showUntrackedFiles no;
|
|
|
|
config checkout -f
|
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# FILE SHARING
|
|
|
|
########################################################################
|
|
|
|
|
2022-12-13 23:16:23 +01:00
|
|
|
doupload-http() {
|
|
|
|
[ ! -f "$1" ] && return 2
|
|
|
|
chmod ugo+r "$1"
|
|
|
|
_name=$(basename "$1");
|
|
|
|
scp -r "$1" codevoid.de:/tmp
|
|
|
|
ssh codevoid.de "doas mv /tmp/$_name /home/www/htdocs/http/$_name"
|
|
|
|
echo "https://codevoid.de/h/$_name";
|
|
|
|
}
|
2023-01-10 22:18:46 +01:00
|
|
|
|
2022-12-13 23:16:23 +01:00
|
|
|
doupload-gopher() {
|
|
|
|
[ ! -f "$1" ] && return 2
|
|
|
|
chmod ugo+r "$1"
|
|
|
|
_name=$(basename "$1");
|
|
|
|
scp -r "$1" codevoid.de:/tmp
|
|
|
|
ssh codevoid.de "doas mv /tmp/$_name /home/www/htdocs/gopher/p/$_name"
|
|
|
|
case "$(file --mime-type -b "$1")" in
|
|
|
|
image/*) S="I";;
|
|
|
|
text/*) S="0";;
|
|
|
|
message/*) S="0";;
|
|
|
|
*/x-shellscript) S="0";;
|
|
|
|
*/pgp-keys) S="0";;
|
|
|
|
application/*) S="9";;
|
|
|
|
esac
|
|
|
|
echo "https://codevoid.de/$S/p/$_name";
|
|
|
|
echo "gopher://codevoid.de/$S/p/$_name";
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# YOUTUBE-DL
|
|
|
|
########################################################################
|
2022-12-13 23:16:23 +01:00
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
YTDL_AGENT="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4506.0 Safari/537.36"
|
|
|
|
YTDL_OPTS="-i --no-part --abort-on-unavailable-fragment --buffer-size 16K --fragment-retries 100 --http-chunk-size 10M"
|
|
|
|
ytdl() {
|
|
|
|
local FMT="bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best"
|
|
|
|
yt-dlp $YTDL_OPTS --user-agent "$YTDL_AGENT" -f "$FMT" "$@";
|
|
|
|
}
|
|
|
|
|
|
|
|
ytdl_playlist() {
|
|
|
|
local FMT="bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best"
|
|
|
|
yt-dlp $YTDL_OPTS --user-agent "$YTDL_AGENT" -f "$FMT" -o '%(playlist_title)s/%(title)s.%(ext)s' "$@";
|
|
|
|
}
|
|
|
|
|
|
|
|
ytdl_channel() {
|
|
|
|
local FMT="bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"
|
|
|
|
yt-dlp $YTDL_OPTS --user-agent "$YTDL_AGENT" --download-archive ytdl_channel.txt -f "$FMT" \
|
|
|
|
-o '%(upload_date)s - %(title)s.%(ext)s' "$@";
|
|
|
|
}
|
|
|
|
ytdl_bandcamp() {
|
|
|
|
yt-dlp $YTDL_OPTS --user-agent "$YTDL_AGENT" -x --audio-format mp3 -i --embed-thumbnail \
|
|
|
|
--add-metadata -o '%(artist)s/%(album)s/%(track_number)02d - %(track)s.%(ext)s' "$@";
|
|
|
|
}
|
|
|
|
ytdl_audio() {
|
|
|
|
yt-dlp $YTDL_OPTS --user-agent "$YTDL_AGENT" -f bestaudio --extract-audio --embed-thumbnail \
|
|
|
|
--add-metadata -o "%(title)s-%(id)s.%(ext)s" "$@";
|
|
|
|
}
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# KSH COMPLETIONS
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
[ -f $HOME/.ksh-complete ] && . $HOME/.ksh-complete
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# SCREEN CONFIGURATION
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
xr_primary() {
|
|
|
|
xrandr --listmonitors | awk '/ 0:/{ print $4 }'
|
|
|
|
}
|
|
|
|
xr_secondary() {
|
|
|
|
xrandr | awk '/ connected/ { print $1 }' | fgrep -v $(xr_primary)
|
|
|
|
}
|
|
|
|
xr_off() {
|
|
|
|
xrandr | awk '/disconnected/ { print $1 }'
|
|
|
|
}
|
2022-12-13 23:16:23 +01:00
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
xrandr_set() {
|
|
|
|
for scr in $(xr_secondary)
|
|
|
|
do
|
2022-12-13 23:16:23 +01:00
|
|
|
xrandr --output $scr --$1 $(xr_primary) --mode auto
|
2022-12-04 22:59:34 +01:00
|
|
|
done
|
|
|
|
for scr in $(xr_off)
|
|
|
|
do
|
|
|
|
xrandr --output $scr --off
|
|
|
|
done
|
|
|
|
}
|
|
|
|
xrandr_mirror() {
|
|
|
|
xrandr_set same-as
|
|
|
|
}
|
|
|
|
xrandr_extend_above() {
|
|
|
|
xrandr_set above
|
|
|
|
}
|
|
|
|
xrandr_extend_right() {
|
|
|
|
xrandr_set right-of
|
|
|
|
}
|
|
|
|
xrandr_extend_left() {
|
|
|
|
xrandr_set left-of
|
|
|
|
}
|
|
|
|
xrandr_native() {
|
|
|
|
xrandr --output $(xr_primary) --auto
|
|
|
|
}
|
|
|
|
xrandr_720p() {
|
|
|
|
xrandr --output $(xr_primary) --mode 1280x720
|
|
|
|
}
|
|
|
|
xrandr_1080p() {
|
|
|
|
xrandr --output $(xr_primary) --mode 1920x1080
|
|
|
|
}
|
|
|
|
xrandr_4k() {
|
|
|
|
xrandr --output $(xr_primary) --mode 3840x2160
|
|
|
|
}
|
2023-01-10 22:18:46 +01:00
|
|
|
alias xrandr_portrait="xrandr --output DP-1 --rotate left"
|
2022-12-13 23:16:23 +01:00
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
# GNUPG AGENT
|
|
|
|
########################################################################
|
|
|
|
|
2023-01-10 22:18:46 +01:00
|
|
|
if [ -f $HOME/.enable_gpg ]
|
2022-12-04 22:59:34 +01:00
|
|
|
then
|
|
|
|
GPG_TTY=$(tty)
|
|
|
|
SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
|
|
|
SSH_AUTH_SOCK_EXTRA=${SSH_AUTH_SOCK%%.ssh}.extra
|
|
|
|
export GPG_TTY SSH_AUTH_SOCK SSH_AUTH_SOCK_EXTRA
|
|
|
|
pgrep -qu sdk gpg-agent || gpg-connect-agent -q /bye
|
|
|
|
fi
|