Update 2024-01-01 23:15 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2024-01-01 23:15:04 +01:00
parent bc71b393c6
commit 279ad0606f
6 changed files with 120 additions and 210 deletions

View File

@ -43,6 +43,7 @@ CPAN
Crates.io
DuckDuckGo Web Search
DuckDuckGo Image Search
Startpage Web Search
GLIB Documentation
Github
LibSOUP Documentation
@ -80,7 +81,7 @@ Zalando"
*.io|*.sh|*.pw|*.party) DEFAULT="OPEN (default)"; C="http://${C}"; ;;
*.coffee|*.me|*.cloud) DEFAULT="OPEN (default)"; C="http://${C}"; ;;
*.[a-zA-Z]*/*) DEFAULT="OPEN (default)"; C="http://${C}"; ;;
*) DEFAULT="DuckDuckGo Web Search (default)"; ;;
*) DEFAULT="Startpage Web Search (default)"; ;;
esac
local S="$(printf "%s\n%s" "${DEFAULT}" "${SE}" \
@ -96,6 +97,7 @@ Zalando"
LibSOUP*) URI="https://libsoup.org/libsoup-3.0/index.html?q=${C}"; ;;
Github) URI="https://github.com/search?q=${C}"; ;;
D*Web*) URI="https://html.duckduckgo.com/html?q=${C}"; ;;
Startpage*) URI="https://eu.startpage.com/do/search?prfe=00d4bb7f075582be9304aaad813ac6b4dc4bd733a098955c35c0586a99eaddf123ac81f1301f1e4f06fd014082141134ec5e0c5441250cf4c05557bed28fcfbced8de0007d01a0254332962533&query=${C}"; ;;
D*Ima*) URI="https://duckduckgo.com/?q=${C}&iax=images&ia=images"; ;;
S*Web*) URI="https://searx.bar/search?q=${C}&category_general=on"; ;;
S*Ima*) URI="https://searx.bar/search?q=${C}&category_images=on"; ;;

View File

@ -223,7 +223,7 @@ bind[focus_next] = MOD+Down
bind[focus_prev] = MOD+Up
bind[focus_prev] = MOD+Shift+Tab
bind[focus_urgent] = MOD+u
#bind[focus_free] = MOD+Shift+BackSpace
bind[focus_free] = Super_L
# ICONFIY / HIDE
bind[uniconify] = MOD+Shift+i

View File

@ -1,95 +1,137 @@
########################################################################
# PORT TOOLS
# OPENBSD PORT TOOLS
########################################################################
#
# CONFIGURATION
#
MAKE_JOBS=$(sysctl -n hw.ncpuonline)
FETCH_JOBS=12
CVSROOT=sdk@cvs.openbsd.org:/cvs
case $(hostname -s) in
x13) PKGOPT="-Dsnap"; ;;
openbsd) PKGOPT="-Dsnap"; ;;
esac
MAKE_JOBS=$(sysctl -n hw.ncpuonline)
#
# ALIASES
#
alias refake="rm -f pkg/*.orig; make clean=fake && make fake"
alias reinstall="remake && make reinstall"
# navigation
alias port-jump="_portjump"
# cleaning
alias port-sweep="_portsweep"
alias port-clean="_portclean"
# making
alias port-refake="_refake"
alias port-reinstall="_reinstall"
alias port-repackage="_repackage"
alias port-remake="_remake"
# checking
alias port-check="_portcheck"
alias port-lib-depends-check="_portlibcheck"
# source control
alias port-diff="_portdiff"
alias cvs-update="_cvsupdate"
alias cvs-update-all="_cvsupdateall"
make-install() {
make install \
&& doas pkg_add -aa "$(make show=FULLPKGNAME)"
}
make-reinstall() {
remake \
&& doas pkg_add -aa "$(make show=FULLPKGNAME)"
#
# FUNCTIONS
#
_portsweep() {
find . \( -name "*.orig" \
-o -name "*.rej" \
-o -empty \
\) -delete
}
########################################################################
# OPENBSD PORT TOOLS
########################################################################
_portjump() {
[ -z $1 ] && exit 0
{
cd /usr/ports \
&& cd $1 \
|| cd */$1 \
|| cd */$1* \
|| cd */*$1 \
|| cd */*$1*
} 2>/dev/null
}
# CVS
export CVSROOT=sdk@cvs.openbsd.org:/cvs
alias cvs-diff="doas -u sdk cvs -d $CVSROOT diff -uNp"
alias cvs-commit="doas -u sdk cvs -d $CVSROOT commit"
alias cvs-update="doas -u sdk cvs -z1 -d $CVSROOT -q up -Pd -A"
_remake() {
make clean=all
make -j$FETCH_JOBS fetch
make
}
cvs-update-all() {(
set -x
cd /usr/src && cvs-update
cd /usr/xenocara && cvs-update
cd /usr/ports && cvs-update
cd /usr/www && cvs-update
_repackage() {
make clean=package
make package
}
_refake() {
rm -f pkg/*.orig
make clean=fake
make fake"
}
_reinstall() {
make reinstall"
}
_portdiff() {(
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
cvs -d $CVSROOT diff -uNp "${PD}" > ~/diffs/${PN}.diff
echo ~/diffs/${PN}.diff
)}
alias cvs-release="doas -u sdk cvs -d $CVSROOT release"
alias cvs-checkout="doas -u sdk cvs -z 1 -qd $CVSROOT checkout -P"
cvs-import-simulate() {
doas -u sdk cvs -d sdk@cvs.openbsd.org:/cvs \
-n import ports/$(dirname $PWD)/$(basename $PWD) sdk sdk_$(date +"%Y%m%d")
}
cvs-sync-sunny() {
rsync -arv --delete /usr/ports/ root@sunny:/usr/ports/
rsync -arv --delete /usr/src/ root@sunny:/usr/src/
rsync -arv --delete /usr/xenocara/ root@sunny:/usr/xenocara/
}
full-update() {(
set -x
pkg_add -u
cvs-update-all
doas sysupgrade -sn
)}
set_autoconf() {
set -x
export AUTOMAKE_VERSION=1.16
export AUTOCONF_VERSION=2.69
set +x
}
# PORTS
portclean() {(
_portclean() {(
set -x
cd /usr/ports
doas rm -rf pobj/* plist logs packages bulk update distfiles/*
mkdir -p plist logs packages bulk update
doas make fix-permissions
)}
_cvsupdate() {
doas -u sdk cvs -z1 -d $CVSROOT -q up -Pd -A
}
_cvsupdateall() {(
set -x
cd /usr/src && _cvsupdate
cd /usr/xenocara && _cvsupdate
cd /usr/ports && _cvsupdate
cd /usr/www && _cvsupdate
)}
# CVS
alias cvs-diff="doas -u sdk cvs -d $CVSROOT diff -uNp"
alias cvs-commit="doas -u sdk cvs -d $CVSROOT commit"
alias cvs-update="doas -u sdk cvs -z1 -d $CVSROOT -q up -Pd -A"
alias cvs-release="doas -u sdk cvs -d $CVSROOT release"
alias cvs-checkout="doas -u sdk cvs -z 1 -qd $CVSROOT checkout -P"
# PORTS
pmark() { pwd > /var/cache/pmark; }
p() { cd "$(</var/cache/pmark)"; }
pj() { cd "/usr/ports/$(portjump $1)"; }
po() { cd "$(</var/cache/pmark)" && cd "$(make show=WRKSRC)"; }
alias portsweep='doas find . \( -name "*.orig" -or -empty \) -delete'
pdiff() {(
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 -u sdk 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
@ -101,10 +143,3 @@ proot-rebuild() {
alias proot-do="doas chroot /home/dpb/"
alias dpb-control="ssh openbsd.codevoid.de \"doas nc -U /usr/ports/logs/amd64/control-openbsd-*\""
dpb-log() {
ssh openbsd.codevoid.de "tail -n 500 /usr/ports/logs/amd64/paths/$1.log"
}
dpb-logf() {
ssh openbsd.codevoid.de "tail -n 500 -f /usr/ports/logs/amd64/paths/$1.log"
}

139
.kshrc
View File

@ -73,9 +73,6 @@ stty -ixon -ixoff
set -o emacs
set bell-style none
alias sudo="doas"
alias su="doas su"
########################################################################
# MODULE LOADER
########################################################################
@ -84,17 +81,20 @@ load() { [ -f ~/.ksh/$1 ] && . ~/.ksh/$1; }
load environment.ksh
load functions.ksh
load aliases.ksh
load email.ksh
load porttools.ksh
load remind.ksh
load ytdl.ksh
load gnupg.ksh
########################################################################
# ALIASES
# ALIASES (MISC)
########################################################################
alias sudo="doas"
alias su="doas su"
# packages
alias pkg_add="doas \pkg_add ${PKGOPT}"
alias pkg_delete="doas \pkg_delete ${PKGOPT}"
@ -107,49 +107,6 @@ umount_tank() { awk '$3=="nfs"{print $2}' /etc/fstab | xargs -n1 doas umount; }
pw() { pwgen -1 -y --remove-chars=\~\`\"\'{}\(\)\[\]\*.\;\|,\<\> 22; }
# monitoring
lr() {
[ -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"
}
l() {
[ -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"
}
# cam
alias camformats="ffplay -f v4l2 -list_formats all -i /dev/video"
alias cam="ffplay -loglevel quiet -f v4l2 -input_format mjpeg -video_size 640x480 -i /dev/video"
setcam() {
_dev=$1
echo ln -sf /dev/video${_dev:=0} /dev/video
doas ln -sf /dev/video${_dev:=0} /dev/video
}
alias mypkg_add="PKG_PATH=http://openbsd.codevoid.de/pub/OpenBSD/snapshots/packages/amd64 pkg_add -Dsnap -Dunsigned"
alias mypkg_info="PKG_PATH=http://openbsd.codevoid.de/pub/OpenBSD/snapshots/packages/amd64 pkg_info -Dsnap -Dunsigned"
openbsd-gitupdate() {
cd ~/code/OpenBSD/src && git pull
cd ~/code/OpenBSD/ports && git pull
cd ~/code/OpenBSD/xenocara && git pull
cd ~/code/OpenBSD
}
# mygdb <breakpoint> <program> <arguments>
mygdb() {
[ -z $3 ] \
&& echo "mygdb <breakpoint> <program> <arguments>" \
&& return
break="$1"; shift; prog="$1"; shift; args="$@";
egdb -ex "break $break" -ex "run $args" $prog
}
########################################################################
# KERNEL STUFF
########################################################################
@ -228,89 +185,3 @@ doupload-gopher() {
[ -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 }'
}
xrandr_list() {
echo "primary: " $(xr_primary)
echo "secondary:" $(xr_secondary)
echo "offline: " $(xr_off)
}
xrandr_set() {
set -x
for scr in $(xr_secondary)
do
xrandr --output $scr --$1 $(xr_primary) --$2 $3
done
for scr in $(xr_off)
do
xrandr --output $scr --off
done
}
xrandr_only_primary() {
pri=$(xr_primary)
sec=$(xr_secondary)
off=$(xr_off)
set -x
xrandr --output $pri --auto
for scr in $sec $off
do
xrandr --output $scr --off
done
}
xrandr_mirror() {
xrandr_set same-as auto
}
xrandr_mirror_hd() {
xrandr_set same-as mode 1920x1080
}
xrandr_extend_above() {
xrandr_set above auto
}
xrandr_extend_right() {
xrandr_set right-of auto
}
xrandr_extend_left() {
xrandr_set left-of auto
}
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
}
alias xrandr_portrait="xrandr --output DP-1 --rotate left"
alias xrandr_mirror_hdmi="xrandr --output HDMI-A-0 --same-as eDP --mode 1920x1080"
########################################################################
# GNUPG AGENT
########################################################################
#eval $(keychain -Q -q --noask --agents ssh,gpg --noask --eval --eval id_rsa id_dsa id_ed25519)
if [ -f $HOME/.enable_gpg ]
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

View File

@ -116,7 +116,7 @@ send2-hook '~f ^.*@ptrace.org' 'set sendmail = "msmtp -a private"'
send2-hook '~f ^.*@stefanhagen.de' 'set sendmail = "msmtp -a private"'
send2-hook '~f ^.*@textmail.me' 'set sendmail = "msmtp -a private"'
send2-hook '~f ^.*@mailbox.org' 'set sendmail = "msmtp -a mboxorg"'
send2-hook '~f ^.*@openbsd.org' 'set sendmail = "~/.mutt/scripts/sendmail-openbsd.sh"'
send2-hook '~f ^.*@openbsd.org' 'set sendmail = "ssh cvs.openbsd.org /usr/sbin/sendmail"'
set help = no

View File

@ -1,2 +1,4 @@
#!/bin/sh
ssh sdk@cvs.openbsd.org "/usr/sbin/sendmail -F 'Stefan Hagen' -f sdk@openbsd.org -t"
echo $@
ssh cvs.openbsd.org "/usr/sbin/sendmail -t"