Compare commits

...

2 Commits

Author SHA1 Message Date
c0dev0id
d0c4c84117 Update 2024-12-22 11:01 OpenBSD/amd64-t14 2024-12-22 11:09:14 +01:00
c0dev0id
4ec4facf23 Update 2024-12-22 09:05 OpenBSD/amd64-t14 2024-12-22 11:09:14 +01:00
8 changed files with 151 additions and 26 deletions

63
.bin/aria Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
DIR="/home/sdk/.aria2"
mkdir -p "$DIR"
for cmd in $@
do
case $cmd in
seed|upload|up)
OPTS="$OPTS
--seed-ratio=0.0
--max-overall-upload-limit=5M
--max-overall-download-limit=1
--check-integrity=true
--bt-hash-check-seed=true
--bt-seed-unverified=true
-j 100
"
shift ;;
download|dl)
OPTS="$OPTS
--max-overall-upload-limit=1
--max-overall-download-limit=85M
--seed-time=0
--lowest-speed-limit=30K
--bt-request-peer-speed-limit=100K
--file-allocation=trunc
-j 6
"
shift ;;
overwrite|over|force)
OPTS="$OPTS
--allow-overwrite=true"
shift ;;
1) OPTS="$OPTS -j 1"
shift ;;
esac
done
DEFAULT="\
--enable-dht=false
--enable-dht6=false
--bt-force-encryption=true
--enable-peer-exchange=false
--auto-save-interval=30
--save-session-interval=30
--bt-enable-lpd=false
--bt-save-metadata=true
--bt-load-saved-metadata=true
--bt-prioritize-piece=head=10M,tail=10M
--log=$DIR/aria2.log
--dht-file-path=$DIR/dht.dat
--dht-file-path6=$DIR/dht6.dat
--save-cookies=$DIR/cookies.dat
--save-session=$DIR/session.dat
"
set -x
if [ -z "$@" ]
then
aria2c $DEFAULT $OPTS *.torrent
else
aria2c $DEFAULT $OPTS "$@"
fi

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")" \
| sed 's/ /%20/g' \
| xclip -f -r
echo
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
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