Update 2023-01-10 22:18 OpenBSD/amd64

This commit is contained in:
c0dev0id 2023-01-10 22:18:46 +01:00
parent 4f96b5ce5a
commit 024c87e623
12 changed files with 106 additions and 148 deletions

15
.bin/bookmarks Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
clean() {
cat ~/.browser_history \
| sort -k 3 \
| uniq -f2 \
| sort \
> /tmp/browser_history \
&& mv /tmp/browser_history ~/.browser_history
echo done.
}
case "$1" in
clean) clean; ;;
*) vim ~/.browser_history; ;;
esac

18
.bin/catgirl Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
[ -z "$1" ] \
&& return 2
/usr/local/bin/catgirl \
-C copy \
-N notify-send \
-O nnn.sh \
-C xcoopy \
-i "* [JPQ][OAU][IR][NT]" \
-l \
-h shell.codevoid.de \
-p 40004 \
-r x \
-u sdk \
-n sdk \
-w "sdk@$(hostname -s)/${1}:$(pass Internet/znc)"

5
.bin/edit-dns Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
ssh -t dns.codevoid.de \
"doas vim /var/nsd/zones/master/codevoid.de \
&& doas nsd-control reload"

5
.bin/netrestart Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh -x
doas ifconfig trunk0 destroy
doas sh /etc/netstart
doas rcctl restart resolvd
doas rcctl restart dhcpleased

186
.kshrc
View File

@ -6,7 +6,6 @@
### SEARCH PATHS
PATH=\
~/bin\
:~/.bin\
:/bin\
:/sbin\
@ -24,7 +23,6 @@ PATH=${PATH}:/opt/zodiac/bin
PATH=${PATH}:/opt/stagit/bin
export PATH
MANPATH=/usr/share/man:/usr/X11R6/man:/usr/local/man
export MANPATH
@ -46,11 +44,7 @@ export LANG LC_ALL LC_MESSAGES LC_NUMERIC LC_TIME
# INTERACTIVE ENVIRONMENT
########################################################################
HOSTNAME=$(hostname)
set -A UNAME -- $(uname -a)
export HOSTNAME UNAME
case ${HOSTNAME} in
case $(hostname) in
*.home.codevoid.de) PKGOPT="-Dsnap"; ;;
openbsd.codevoid.de) PKGOPT="-Dsnap"; ;;
esac
@ -69,9 +63,12 @@ export CDPATH
EDITOR="vim"
VISUAL="vim"
BROWSER="luakit -un"
TUIR_BROWSER="$BROWSER"
PAGER="less"
export EDITOR VISUAL BROWSER TUIR_BROWSER PAGER
export EDITOR VISUAL BROWSER PAGER
### TUIR (reddit)
TUIR_BROWSER="$BROWSER"
export TUIR_BROWSER
### NNN
NNN_OPTS="cErxAJBR"
@ -79,14 +76,13 @@ NNN_OPENER="nnn.sh"
NNN_FIFO=/tmp/nnn.fifo
NNN_PLUG='o:-!mpv "$nnn";x:!imagesort;p:!pdfarranger "$nnn" > /dev/null 2>&1 &'
NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$"
NNN_SSHFS='doas sshfs -d -o reconnect -o uid=1000 -o gid=1000'
NNN_COLORS='#0a1b2c3d;1234'
NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
export NNN_OPTS NNN_OPENER NNN_PLUG NNN_ARCHIVE NNN_SSHFS
export NNN_OPTS NNN_OPENER NNN_PLUG NNN_ARCHIVE
export NNN_COLORS NNN_FCOLORS NNN_FIFO
# LESS
LESS="--buffers=-1 -g -i -J -M --tilde -R"
LESS="-giJmR--tilde"
LESSHISTFILE="$HOME/.less-history"
export LESS LESSHISTFILE
@ -98,8 +94,7 @@ export SLRNPULL_ROOT NNTPSERVER
### GOT
GOT_AUTHOR="Stefan Hagen <sh+got@codevoid.de>"
TOG_COLORS=1
export GOT_AUTHOR
export TOG_COLORS
export GOT_AUTHOR TOG_COLORS
### BUPSTASH
BUPSTASH_REPOSITORY=ssh://sdk@storage.bupstash.io
@ -114,7 +109,7 @@ export PASSWORD_STORE_ENABLE_EXTENSIONS
# PROMPT (SIMPLE)
########################################################################
PS1="\${?}\w\\$ "
PS1="\h|\${?}\w\\$ "
########################################################################
# SHELL SETTINGS
@ -136,45 +131,17 @@ 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"
alias dev-kernconf="doas vim /sys/arch/amd64/conf/GENERIC.MP"
alias bookmarks="vim ~/.browser_history"
bookmarks-clean() {
cat ~/.browser_history \
| sort -k 3 \
| uniq -f2 \
| sort \
> /tmp/browser_history \
&& mv /tmp/browser_history ~/.browser_history
}
# remind
alias rem="remind -c+cl3 ~/.reminders"
alias rem-edit="cd ~/.reminders && ./edit.sh"
alias rem-week="remind -c+cl1 ~/.reminders"
alias rem-all="remind -s -n1 ~/.reminders | sort"
alias rem="remind -s+2 -ga ~/.reminders | cut -d' ' -f1 -f6- | cut -d'|' -f1"
alias rem-edit-birthdays="vim ~/.reminders/birthdays.rem"
alias rem-edit-personal="vim ~/.reminders/personal.rem"
rem-fetch-uugrn() {
ssh vorstand.uugrn.org \
"cat /home/vorstand/private/Kalender/uugrn.rem" \
> ~/.reminders/uugrn/uugrn.rem
}
rem-edit-uugrn() {
vim sftp://vorstand@vorstand.uugrn.org/private/Kalender/uugrn.rem \
&& ssh -q sdk@vorstand.uugrn.org /home/sdk/.bin/make_calendar.sh
}
# mastodon
alias toot-sh="toot tui -u sh@bsd.network"
alias toot-uug="toot tui -u uugrn@chaos.social"
alias webtorrent="~/node_modules/.bin/webtorrent"
# vim-snippets
alias snip_sh="vim ~/.vim/bundle/vim-snipmate/snippets/sh.snippets"
alias snip_c="vim ~/.vim/bundle/vim-snipmate/snippets/c.snippets"
alias snip__="vim ~/.vim/bundle/vim-snipmate/snippets/_.snippets"
alias toot-sh="toot activate sh@bsd.network && toot tui"
alias toot-uug="toot activate uugrn@chaos.social && toot tui"
mpi() { curl -s "$(xclip -o)" | imv -; }
# mupdf
alias mupdf="mupdf-gl -XJ"
# system
alias sudo="doas"
@ -188,54 +155,16 @@ alias trans-de="trans -l en -s de -t en --no-ansi"
alias pkg_add="doas \pkg_add ${PKGOPT}"
alias pkg_delete="doas \pkg_delete ${PKGOPT}"
alias pkg_info="\pkg_info ${PKGOPT}"
pkg_reset() { pkg_delete -cIX $(</home/sdk/.pkglist); }
# programs
alias mupdf="mupdf-gl -XJ"
# network
alias edit_dns="ssh -t dns.codevoid.de \"doas vim /var/nsd/zones/master/codevoid.de && doas nsd-control reload\""
alias edit_gopher="vim sftp://gopher.codevoid.de/../www/htdocs/gopher/"
# servers
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'; }
netrestart() {(
set -x
doas ifconfig trunk0 destroy
doas sh /etc/netstart
doas rcctl restart resolvd
doas rcctl restart dhcpleased
)}
scr() {
[ -z "$1" ] \
&& doas wsconsctl -n display.brightness \
|| doas wsconsctl display.brightness="$1"
}
pass-reinit() {
pass git pull
pass init $(<~/.password-store/.gpg-id)
pass git push
}
cg() {
[ -z "$1" ] && return 2
catgirl \
-C copy \
-N notify-send \
-O nnn.sh \
-C xcoopy \
-i "* [JPQ][OAU][IR][NT]" \
-l \
-h shell.codevoid.de \
-p 40004 \
-r x \
-u sdk \
-n sdk \
-w "sdk@$(hostname -s)/${1}:$(pass Internet/znc)"
}
scr() { [ -z "$1" ] && doas wsconsctl -n display.brightness \
|| doas wsconsctl display.brightness="$1"; }
# mount
alias mount_msdos="doas \mount_msdos -o nodev,nosuid,noatime -u 1000 -g 1000"
@ -248,9 +177,10 @@ alias hn="sacc gopher://codevoid.de/1/hn"
alias cv="sacc gopher://codevoid.de"
# pim
alias notes="vim scp://shell.codevoid.de/work/notes/notes.txt"
alias events="vim scp://shell.codevoid.de/work/notes/events.txt"
caly() { ncal -C $(date +%Y); }
alias notes="vim sftp://shell.codevoid.de/work/notes/notes.txt"
alias events="vim sftp://shell.codevoid.de/work/notes/events.txt"
alias caly="ncal -Cy"
alias calm="ncal -3C"
# music
alias music_psychedelik="mpg123 -b 1024 http://62.210.114.63:8000"
@ -262,12 +192,15 @@ alias music_bitreich="mpv gopher://bitreich.org/9/radio/listen"
alias flac_encode="flac -e --best --delete-input-file"
# security
alias gpa="gpa -k"
alias htpasswd-openssl="openssl passwd -apr1"
alias ssh-keygen-ed25519="ssh-keygen -t ed25519 -a 420 -C sh@codevoid.de"
alias insecuresh="ssh -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes256-cbc"
pw() { pwgen -1 -y --remove-chars=\~\`\"\'{}\(\)\[\]\*:/.\;\|,\<\> 22; }
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"
alias pw="pwgen -1 -y --remove-chars=\~\`\"\'{}\(\)\[\]\*.\;\|,\<\> 22"
# backup
alias tarsnap="doas \tarsnap"
@ -377,48 +310,43 @@ alias omisc="mutt -f $MUTT_HOST/Virtual/OpenBSD-misc"
# OPENBSD PORT TOOLS
########################################################################
# CVS
CVSROOT=sdk@cvs.openbsd.org:/cvs
alias cvs-diff="cvs -d $CVSROOT diff -uNp"
alias cvs-commit="doas cvs -d $CVSROOT commit"
alias cvs-update="doas cvs -z 1 -d $CVSROOT -q up -Pd -A"
alias cvs-release="cvs -d $CVSROOT release"
alias cvs-checkout="doas cvs -z 1 -qd $CVSROOT checkout -P"
cvs-import-simulate() {
cvs -d sdk@cvs.openbsd.org:/cvs -n import \
ports/$(dirname $PWD)/$(basename $PWD) sdk sdk_$(date +"%Y%m%d")
cvs -d sdk@cvs.openbsd.org:/cvs \
-n import ports/$(dirname $PWD)/$(basename $PWD) sdk sdk_$(date +"%Y%m%d")
}
pkg-reset() {
pkg_delete -cIX $(</home/sdk/pkg)
}
pmark() { echo "$PWD" | tee /var/cache/pmark; }
portclean() {
doas rm -rf /usr/ports/{pobj/*,plist,logs,packages,bulk,update}
cd /usr/ports && doas make fix-permissions > /dev/null
}
p() { cd "$(</var/cache/pmark)" && echo $PWD; }
pj() { cd "$(port jump $1)" && echo $PWD; }
# 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)"; }
po() { cd "$(</var/cache/pmark)" && cd "$(make show=WRKSRC)"; }
alias portsweep='doas find . \( -name "*.orig" -or -empty \) -delete'
pdiff() {(
_name="$(make show=PKGNAME)"
_epoch="$(make show=EPOCH)"
_rev="$(make show=REVISION)"
_patchname="${_name}${_epoch:+v$_epoch}${_rev:+p$_rev}"
_portdir="$(echo "$PWD" | awk -F'/' '{ print $(NF-1)"/"$NF; }')"
cd ../../
doas cvs -d sdk@cvs.openbsd.org:/cvs diff -uNp "$_portdir" \
> "/home/sdk/diffs/${_patchname}.diff"
echo "/home/sdk/diffs/${_patchname}.diff"
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"
)}
alias port-modgo-update='make MODGO_VERSION=latest modgo-gen-modules > modules.inc'
# DPB
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"
@ -476,6 +404,7 @@ doupload-http() {
ssh codevoid.de "doas mv /tmp/$_name /home/www/htdocs/http/$_name"
echo "https://codevoid.de/h/$_name";
}
doupload-gopher() {
[ ! -f "$1" ] && return 2
chmod ugo+r "$1"
@ -578,14 +507,13 @@ xrandr_1080p() {
xrandr_4k() {
xrandr --output $(xr_primary) --mode 3840x2160
}
alias xrandr_portrait="sync; xrandr --output DP-1 --rotate left"
alias xrandr_portrait="xrandr --output DP-1 --rotate left"
########################################################################
# GNUPG AGENT
########################################################################
if [ -f $HOME/.enable_gpg ];
if [ -f $HOME/.enable_gpg ]
then
GPG_TTY=$(tty)
SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)

View File

@ -1,14 +1,14 @@
BANNER %
INCLUDE /home/sdk/.reminders/personal/
INCLUDE /home/sdk/.reminders/uugrn/
REM 9 Jan 2023 ++1 MSG Not so important
REM 10 Jan 2023 ++7 MSG Way in the future
REM 11 Jan 2023 MSG Important Reminder
REM 12 Jan 2023 ++1 MSG Not so important - B
REM 10 Jan 2023 ++1 MSG Not so important
REM 12 Jan 2023 ++7 MSG Way in the future
REM 13 Jan 2023 MSG Important Reminder
REM 14 Jan 2023 ++1 MSG Not so important - B
BANNER %
FSET sortbanner(x) iif(x == today(), \
"***** THINGS TO DO TODAY *****", \
"----- Things to do %b -----")

View File

@ -1,13 +0,0 @@
iSeries
pdfgrep
Wireshark
ABAP
roundtrip
runtimes
STFK
ingwwdf1
saprouter
sapserv2
saprouttab
Steampunk
umkonfigurieren

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
execute pathogen#infect()
" Helptags
Helptags
" VIM CORE
set nocompatible