Update 2024-12-22 09:05 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2024-12-22 09:05:32 +01:00
parent d49eb5d52f
commit 4ec4facf23
7 changed files with 88 additions and 26 deletions

View File

@ -1,6 +1,6 @@
#!/bin/ksh
FILE="$HOME/.ksh.complete"
FILE="$HOME/.kshrc.autocomplete"
rm -f "${FILE}"
@ -37,6 +37,17 @@ add "set -A complete_kill_1 -- " "-9 -HUP -INFO -KILL -TERM"
#
add "set -A complete_ifconfig_1 -- " "$(ifconfig | grep ^[a-z] | cut -d: -f1)"
#
# manpages
#
S1="$(man -s 1 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
S2="$(man -s 2 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
S3="$(man -s 3 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
S4="$(man -s 4 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
S5="$(man -s 5 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
S8="$(man -s 8 -k any= | cut -d"(" -f1 | tr -d "," | xargs)"
add "set -A complete_man_1 -- " "$S1 $S5 $S8"
#
# AMUSED
#

View File

@ -1,25 +1,24 @@
#!/bin/sh -e
file="$1"
[ -z $file ] \
&& file="$(find $PWD $HOME $HOME/Downloads -maxdepth 2 -type f \
| fgrep -v "/." \
| sort -u \
| fzf -e -x -i)"
[ -z $file ] \
&& exit 0
scp "$file" \
sdk@home.codevoid.de:make-web/src/paste/
ssh sdk@home.codevoid.de \
"cd ~/make-web && make install"
echo "https://ptrace.org/$(basename "$file")" \
if [ x"$1" == x"rm" ]
then
shift
for file in $@
do
ssh sdk@codevoid.de "cd /home/www/htdocs/ptrace/paste/ && rm -v $(basename "$file")" || true
done
elif [ x"$1" == x"ls" ]
then
shift
ssh sdk@codevoid.de "cd /home/www/htdocs/ptrace/paste/ && ls -1 | xargs -n1 -I{} echo https://ptrace.org/{}"
else
for file in $@
do
chmod o+rw,g+r "$file"
scp "$file" sdk@codevoid.de:/home/www/htdocs/ptrace/paste/
echo "https://ptrace.org/$(basename "$file")" \
| sed 's/ /%20/g' \
| xclip -f -r
echo
echo
done
fi

2
.kshrc
View File

@ -107,7 +107,7 @@ set bell-style none
# LOAD COMPLETION FILE
########################################################################
[ -f ~/.ksh.complete ] && . ~/.ksh.complete
[ -f ~/.kshrc.autocomplete ] && . ~/.kshrc.autocomplete
########################################################################
# PROMPT

15
.kshrc.autocomplete Normal file

File diff suppressed because one or more lines are too long

View File

@ -212,7 +212,7 @@ alternative_order text/plain text/enriched text/html
auto_view text/html text/enriched text/calendar
# Preview HTML
macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/portpatch2.sh /tmp/muttpatch.diff<enter>"
macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/apply_patch.sh /tmp/muttpatch.diff<enter>"
# Save Patch
#macro pager \cs "<shell-escape>rm -f /tmp/mutt-patch.diff<enter><copy-message>/tmp/mutt-patch.diff<enter><enter-command>echo 'Saved as /tmp/mutt-patch.diff'<enter><shell-escape>~/.mutt/scripts/portpatch.sh /tmp/mutt-patch.diff<enter>"

35
.mutt/scripts/apply_patch.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/ksh -e
# needs converters/qprint
# mutt: macro pager,attach \cs "<pipe-message>cat > /tmp/muttpatch.diff<enter><shell-escape>~/.mutt/scripts/apply_patch.sh /tmp/muttpatch.diff<enter>"
clear
printf '\n---------------------------------------------------------------------\n'
grep -E 'Subject: |^Index|^RCS|^diff --git|^file +|^[-+]{3} ' "${1}"
printf '---------------------------------------------------------------------\n\n'
printf "Base path for the patch?\n"
printf "Example: /usr/ports or /usr/src\n"
printf ": "
read -r _path
cd $_path
print "Using: $_path"
printf "Fix quoted-printable mangeled patch? [y/N]: "
read -r _qprint
case ${_qprint} in
[y|Y]) _catcmd="qprint -d"; ;;
*) _catcmd="cat"; ;;
esac
printf "Strip? [0]: "
read -r _strip
echo "CMD: ${_catcmd} "${1}" | doas -u sdk patch -E -pp${_strip:=0} -d ${_path}"
${_catcmd} "${1}" | doas -u sdk patch -E -N -p${_strip:=0} -d ${_path}
echo ${_path} | xclip
echo "done."
read

View File

@ -73,6 +73,7 @@ set wildmode=full
""map :q map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
nmap Q :qall!
nmap k :HugoHelperLink
let g:currentmode={
\ 'n' : 'NORMAL',
@ -347,3 +348,4 @@ augroup END
augroup diffsyntax
autocmd! OptionSet diff syntax off
augroup END
autocmd FocusLost <buffer> silent write