general cleanup

This commit is contained in:
Felix Van der Jeugt 2024-07-24 08:35:41 +02:00
parent ffced8fca4
commit 3ffb35cc2e
No known key found for this signature in database
GPG Key ID: 58B209295023754D
25 changed files with 149 additions and 120 deletions

View File

@ -12,7 +12,7 @@ color = dark red
path = /data/calendar/default/default
[[sigasi]]
path = /data/calendar/sigasi/fzzurm
path = /data/calendar/sigasi/jbdhqd
color = dark blue
[[twist]]

View File

@ -1,2 +1,3 @@
audio_cache = false
gapless = true
audio_backend = "pipe"

View File

@ -1,8 +1,7 @@
#!/usr/bin/python
from qutebrowser.api import interceptor
from PyQt5.QtCore import QUrl, QUrlQuery
from unalix import clear_url
from PyQt6.QtCore import QUrl, QUrlQuery
config.backend = "webengine"
config.load_autoconfig(False)
@ -48,10 +47,6 @@ c.url.searchengines = { "startpage": "https://startpage.com/do/search?query={}"
, "mellowchan": "https://srx.mellowchan.xyz/?q={}"
, "DEFAULT": "https://srx.mellowchan.xyz/?q={}"
}
c.colors.webpage.preferred_color_scheme = "dark"
c.colors.webpage.darkmode.enabled = True
#c.colors.webpage.darkmode.policy.images = "never"
c.colors.webpage.bg = 'black'
# Privacy
c.content.proxy = "socks://localhost:9050"
@ -159,10 +154,10 @@ config.bind("<Alt+j>", "prompt-item-focus next", mode="prompt")
config.bind("<Alt+k>", "prompt-item-focus prev", mode="prompt")
config.bind("<Alt+l>", "fake-key -g /", mode="prompt")
config.bind("<Alt+h>", "rl-unix-filename-rubout", mode="prompt")
config.bind("o", "set-cmd-text -s :open -s ", mode="normal")
config.bind("O", "set-cmd-text -s :open -s -t ", mode="normal")
config.bind("\\", "set-cmd-text -s :open ", mode="normal")
config.bind("|", "set-cmd-text -s :open -t ", mode="normal")
config.bind("o", "cmd-set-text -s :open -s ", mode="normal")
config.bind("O", "cmd-set-text -s :open -s -t ", mode="normal")
config.bind("\\", "cmd-set-text -s :open ", mode="normal")
config.bind("|", "cmd-set-text -s :open -t ", mode="normal")
config.bind(";t", "hint links spawn --detach tempbrowser {hint-url}", mode="normal")
config.bind(";n", "hint links spawn --detach newbrowser {hint-url}", mode="normal")
config.bind("gt", "spawn --detach tempbrowser {url}", mode="normal")
@ -241,7 +236,7 @@ def intercept(info: interceptor.Request) -> None:
if not info.request_url.scheme().startswith('http'):
return
new_url = QUrl(clear_url(info.request_url.url()))
new_url = QUrl(info.request_url.url())
if new_host := redirects.get(new_url.host()):
new_url.setHost(new_host)

View File

@ -3,3 +3,5 @@ resume
stats.json
torrents
settings.json.tmp.*
stats.json.tmp.*
bandwidth-groups.json

View File

@ -6,11 +6,16 @@
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"announce-ip": "",
"announce-ip-enabled": false,
"anti-brute-force-enabled": false,
"anti-brute-force-threshold": 100,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"default-trackers": "",
"dht-enabled": true,
"download-dir": "/data/torrents",
"download-queue-enabled": true,
@ -21,7 +26,7 @@
"incomplete-dir": "/data/torrents",
"incomplete-dir-enabled": false,
"lpd-enabled": false,
"message-level": 1,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
@ -30,7 +35,7 @@
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"peer-socket-tos": "le",
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
@ -47,13 +52,18 @@
"rpc-host-whitelist-enabled": true,
"rpc-password": "{ea038685697d9155c4feac212ab27e76b9738fd5lYASTkIh",
"rpc-port": 9091,
"rpc-socket-mode": "0750",
"rpc-url": "/transmission/",
"rpc-username": "",
"rpc-whitelist": "127.0.0.1",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-added-enabled": false,
"script-torrent-added-filename": "",
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "BLAH BLABLAH BLAH",
"script-torrent-done-seeding-enabled": false,
"script-torrent-done-seeding-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
@ -61,8 +71,10 @@
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"tcp-enabled": true,
"torrent-added-verify-mode": "fast",
"trash-original-torrent-files": false,
"umask": 18,
"umask": "022",
"upload-slots-per-torrent": 14,
"utp-enabled": true
}

View File

@ -21,7 +21,7 @@ password.fetch = ["command", "pass", "other/vdirsyncer"]
[pair posteo_arbeit]
a = "arbeit_local"
b = "arbeit_remote"
collections = ["fzzurm"]
collections = ["jbdhqd"]
[storage arbeit_local]
type = "filesystem"
@ -30,7 +30,7 @@ fileext = ".ics"
[storage arbeit_remote]
type = "caldav"
url = "https://posteo.de:8443/calendars/felix.vanderjeugt/fzzurmm/"
url = "https://posteo.de:8443/calendars/felix.vanderjeugt/jbdhqd/"
username = "felix.vanderjeugt@posteo.net"
password.fetch = ["command", "pass", "other/vdirsyncer"]
@ -54,6 +54,7 @@ password.fetch = ["command", "pass", "other/vdirsyncer"]
a = "contacts_local"
b = "contacts_remote"
collections = ["from a", "from b"]
conflict_resolution = "a wins"
[storage contacts_local]
type = "filesystem"
@ -65,17 +66,3 @@ type = "carddav"
url = "https://posteo.de:8843/addressbooks/felix.vanderjeugt/default"
username = "felix.vanderjeugt@posteo.net"
password.fetch = ["command", "pass", "other/vdirsyncer"]
[pair stellaris]
a = "stellaris_remote"
b = "readonly_local"
collections = null
[storage readonly_local]
type = "filesystem"
path = "/data/calendar/readonly"
fileext = ".ics"
[storage stellaris_remote]
type = "http"
url = "https://cloud.rxn.be/remote.php/dav/public-calendars/fzNBCHE6EBffA6Ft?export"

View File

@ -40,25 +40,25 @@ local hr = token('hr', lpeg.Cmt(l.starts_line(S(' \t')^0 * lpeg.C(S('*-_'))),
end))
-- Span elements.
local dq_str = token(l.STRING, l.delimited_range('"', false, true))
local sq_str = token(l.STRING, l.delimited_range("'", false, true))
local paren_str = token(l.STRING, l.delimited_range('()'))
local link = token('link', P('!')^-1 * l.delimited_range('[]') *
local dq_str = token(l.STRING, l.range('"', false, true))
local sq_str = token(l.STRING, l.range("'", false, true))
local paren_str = token(l.STRING, l.range('()'))
local link = token('link', P('!')^-1 * l.range('[]') *
(P('(') * (l.any - S(') \t'))^0 *
(S(' \t')^1 *
l.delimited_range('"', false, true))^-1 * ')' +
S(' \t')^0 * l.delimited_range('[]')) +
l.range('"', false, true))^-1 * ')' +
S(' \t')^0 * l.range('[]')) +
P('http://') * (l.any - l.space)^1)
local link_label = token('link_label', l.delimited_range('[]') * ':') * ws *
local link_label = token('link_label', l.range('[]') * ':') * ws *
token('link_url', (l.any - l.space)^1) *
(ws * (dq_str + sq_str + paren_str))^-1
local strong = token('strong', (P('**') * (l.any - '**')^0 * P('**')^-1) +
(P('__') * (l.any - '__')^0 * P('__')^-1))
local em = token('em',
l.delimited_range('*', true) + l.delimited_range('_', true))
l.range('*', true) + l.range('_', true))
local code = token('code', (P('``') * (l.any - '``')^0 * P('``')^-1) +
l.delimited_range('`', true, true))
l.range('`', true, true))
local escape = token(l.DEFAULT, P('\\') * 1)

View File

@ -21,6 +21,13 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
vis:command('set number')
end)
vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, path)
if file.size ~= 0 and file:content(file.size - 1, 1) ~= "\n" then
file:insert(file.size, "\n")
end
return true
end)
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
--------------------------------------------------------------------------------
@ -34,6 +41,15 @@ vis:map(vis.modes.NORMAL, "<Escape>", function()
end
end)
--------------------------------------------------------------------------------
-- Fancy cd
vis:command_register("rcd", function(argv, force, cur_win, selection, range)
handle = io.popen('f=$(mktemp); st -e ranger --choosedir="$f" --show-only-dirs; cat "$f"')
local output = handle:read()
handle:close()
vis:command('cd '..output)
end)
--------------------------------------------------------------------------------
-- Fuzzy search filenames to open files

View File

@ -1,6 +0,0 @@
#!/bin/sh
st -e socat tcp-listen:6667,reuseaddr,fork udp:localhost:20595 &
st -e ssh -R 6667:localhost:6667 Hetzner "grep -q '^AllowTcpForwarding yes$' /etc/ssh/sshd_config && grep -q '^GatewayPorts yes$' /etc/ssh/sshd_config && socat udp-listen:20595,reuseaddr,fork tcp:localhost:6667" &
wait

View File

@ -1,7 +0,0 @@
#!/bin/sh
[ "$#" -eq 0 ] && exit
torsocks curl -O "$@"
image="$(basename "$@")"
rifle -fF "$image"
mv "$image" /data/pictures/anselmages/
ln -s ../anselmages/"$image" /data/pictures/background-source/"$image"

View File

@ -25,20 +25,24 @@ mantle)
--exclude '/etc/sudoers.dist' \
--exclude '/etc/kernel.d/post-install/50-grub' \
--exclude '/etc/kernel.d/post-remove/50-grub' \
--exclude '/etc/mumble/mumble-server.ini' \
--exclude '/etc/.pwd.lock' \
--exclude '/etc/gshadow-' \
--exclude '/etc/passwd-' \
--exclude '/etc/shadow-' \
--exclude '/etc/shadow' \
--exclude '/etc/ssh/ssh_*_key' \
--exclude '/etc/tcsd.conf' \
--exclude '/etc/gshadow' \
--exclude '/var/tmp/*' \
--exclude '/var/db/*' \
--exclude '/var/cache' \
--exclude '/var/lib/alsa' \
--exclude '/var/lib/dkms/mok.key' \
--exclude '/var/lib/tor' \
--exclude '/var/lib/random-seed' \
--exclude '/var/lib/seedrng' \
--exclude '/var/lib/tpm' \
--exclude '/var/log/tallylog' \
--exclude '/var/log/btmp' \
--exclude '/var/log/dmesg.log' \
@ -151,7 +155,7 @@ info "Pruning repository"
borg prune \
--list \
--prefix '{hostname}-' \
--glob-archives '{hostname}-*' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \

View File

@ -1,6 +0,0 @@
#!/usr/bin/python3
import sys
from clirail.clirail_main import main
main(*sys.argv[1:])

1
local/bin/clirail Symbolic link
View File

@ -0,0 +1 @@
/home/ninewise/.local/pipx/venvs/clirail/bin/clirail

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec qutebrowser --basedir "$HOME/.config/facebrowser" --config-py "$HOME/.config/qutebrowser/config.py" 'https://www.facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion/messages'

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec qutebrowser --basedir "$HOME/.config/googlebrowser"

View File

@ -11,7 +11,8 @@ to the current date. Finally, it opens the end of the file in $EDITOR.
Bonus over 'hledger add': interactive matching it easier, and
transaction formatting is retained because it's just a copy.
add_file The transaction is appended to this file.
add_file The transaction is appended to this file. Using -
will output the transaction to stdout instead.
Default (if set): \$LEDGER_ADD_FILE
Default (otherwise): \$LEDGER_FILE
@ -37,18 +38,24 @@ done
shift $((OPTIND - 1))
# fuzzy select a transaction title
selection="$(sed -n 's/....-..-..\( [*!]\)\? //p' "${@:-$LEDGER_FILE}" | sort | uniq | sk)"
selection="$(sed -n 's/....-..-..\( [*!]\)\? //p' "${@:-$LEDGER_FILE}" | sort | uniq | sk | sed 's_/_\\/_g')"
[ -z "$selection" ] && exit 0 # quit if escaped
sed -n "/....-..-..\( [*!]\)\? ${selection}\$/,/^\$/p" "${@:-$LEDGER_FILE}" | # print matching transactions
sed '${/^$/d}' | # remove trailing empty line
sed -n '/^$/{s/.*//;x;d};H;${x;p}' | # remove all before the last empty line
sed "s/^....-..-..\( [*!]\)\?/$(date +'%Y-%m-%d')/" | # replace date with today, remove marker
sponge -a "$add_file" # append to the file, use sponge in case it's also an input file
if [ "$add_file" = '-' ]; then
cat
else
sponge -a "$add_file" # append to the file, use sponge in case it's also an input file
fi
# review change: open end of the file (if I know how)
case "$EDITOR" in
vi*|nvi*) "$EDITOR" +\$ "$add_file" ;;
emacs) "$EDITOR" "$add_file" -f end-of-buffer ;;
*) "$EDITOR" "$add_file" ;;
esac
if [ "$add_file" != '-' ]; then
case "$EDITOR" in
vi*|nvi*) "$EDITOR" +\$ "$add_file" ;;
emacs) "$EDITOR" "$add_file" -f end-of-buffer ;;
*) "$EDITOR" "$add_file" ;;
esac
fi

View File

@ -1,5 +0,0 @@
#!/bin/sh
notmuch address --output=recipients --output=sender --deduplicate=address from:'*'"$*"'*' OR to:'*'"$*"'*' \
| grep -i "$*" \
| grep -v noreply \
| sort | uniq

View File

@ -1,13 +0,0 @@
#!/bin/sh
set -e
for mid in $(notmuch search --output=messages tag:inbox "$@"); do
printf "%s ? " "$(notmuch show "$mid" | sed -n 's/Subject: //p')"
read ans
case "$ans" in
y*)
notmuch show --format=raw "$mid" | bogofilter -Sn
notmuch tag -inbox -unread +spam -- "$mid"
;;
esac
done

54
local/bin/vcard-simplify.py Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/env python
import sys
def copy(line):
print(line, end="")
def output(key, value):
print(key, value, sep=":", end="\r\n")
for line in sys.stdin:
key, *value = line.strip().split(":")
value = ":".join(value)
if key == "BEGIN" and value == "VCARD":
copy(line)
elif key == "VERSION":
output("VERSION", "2.1")
elif key == "N":
copy(line)
elif key == "FN":
copy(line)
elif key == "ORG":
pass
elif (key == "EMAIL;TYPE=INTERNET;TYPE=WORK" or
key == "EMAIL;TYPE=INTERNET;TYPE=HOME" or
key == "EMAIL;TYPE=INTERNET;TYPE=OTHER"):
output("EMAIL;X-internet", value)
elif (key == "TEL;TYPE=VOICE" or
key == "TEL;TYPE=CELL" or
key == "TEL;TYPE=WORK" or
key == "TEL;TYPE=HOME" or
key == "TEL;TYPE=OTHER"):
if value.startswith("tel:"):
value = value[4:]
output("TEL;VOICE", value.replace(" ", ""))
elif key == "TEL;TYPE=PAGER":
pass
elif (key == "ADR;TYPE=HOME" or key == "ADR;TYPE=OTHER"):
output("ADR;HOME", value)
elif key == "CATEGORIES":
pass
elif key == "NICKNAME":
pass
elif key.startswith("URL"):
pass
elif key == "BDAY;VALUE=date":
pass
elif key.startswith("NOTE"):
pass
elif key.startswith("TITLE"):
pass
elif key == "END" and value == "VCARD":
copy(line)
else:
raise NotImplementedError(line)

View File

@ -2,4 +2,4 @@ text/html: w3m -dump -o display_link_number=1 -I $PIPE_CHARSET -T text/html
text/calendar: cat
application/ics: khal printics
text/plain: mflow -w 72
multipart/encrypted: gpg 2>&1 && exit 64
multipart/encrypted: gpg --decrypt 2>&1 && exit 64

10
root/etc/fonts/local.conf Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>M+ 1mn medium</family>
<prefer>
<family>Noto Color Emoji</family>
</prefer>
</alias>
</fontconfig>

View File

@ -7,8 +7,6 @@ set -e
# Split outbox emails
mlist -d /data/mail/outbox | mpick -t 'from =~~ "posteo"' | mflag -F | mrefile /data/mail/posteo/Sent
mlist -d /data/mail/outbox | mpick -t 'from =~~ "ugent"' | mflag -F | mrefile /data/mail/ugent/Sent
mlist -d /data/mail/outbox | mpick -t 'from =~~ "gmail"' | mflag -F | mrefile /data/mail/gmail/Sent
# check for internet connection
ip route ls | grep -q '.'
@ -31,29 +29,7 @@ minc $(mdirs /data/mail) > "$s"
{
# Ignores
mpick -t 'to =~ "unipept@ugent.be" && subject ~~ "*Mysql2::Error::ConnectionError*"' < "$s"
mpick -t 'to =~ "unipept@ugent.be" && subject =~ "elixir_logo.*not present"' < "$s"
mpick -t 'to =~ "unipept@ugent.be" && subject ~~ "*ActiveRecord::NoDatabaseError*Unknown database *unipept*"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && from =~ "logcheck system account"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "A request took"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "Onderwijsinstelling aangemaakt voor"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "Een gebruiker kon niet inloggen"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "Invalid or unknown LTI provider"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "Faraday::ConnectionFailed"' < "$s"
mpick -t 'to =~ "dodona@ugent.be" && subject =~ "internal error"' < "$s" \
| xargs rg --files-without-match 'judge=>"(java12|haskell|biopythia)"'
mpick -t 'subject =~ "\[hackers\] \[slstatus\]"' < "$s"
mpick -t 'subject =~ "\[hackers\] \[svkdb\]"' < "$s"
mpick -t 'subject ~~ "*Bump * from * to *" && "cc" !~~ "Felix*"' < "$s"
mpick -t 'from =~ "dodona@ugent.be" && subject ~~ "* vraagt om lesgeversrechten"' < "$s"
mpick -t 'from =~ "dodona@ugent.be" && subject ~~ "* Je vraag naar lesgeversrechten werd goedgekeurd"' < "$s"
mpick -t 'from =~ "dodona@ugent.be" && subject ~~ "* Your request for teacher rights was granted"' < "$s"
# Muted mails
for muted in $(cat ~/.mblaze/muted); do
mpick -t '"references" =~~ "'"$muted"'"' < "$s"
done
} | sort | uniq | mflag -Sf > /dev/null
# Clear muted sequence
#mseq -f < ~/.mblaze/muted | mpick -t 'date < "'"$(date -I -d '1 month ago')"'"' | sponge ~/.mblaze/muted

View File

@ -11,6 +11,6 @@ ip route ls | grep -q '.'
# check if the gpg-agent is running
pgrep gpg-agent > /dev/null
torsocks vdirsyncer -v CRITICAL sync 2>&1
vdirsyncer -v CRITICAL sync 2>&1
exec sleep 10m

View File

@ -13,6 +13,7 @@ feeds() {
feed "Saturday Morning Breakfast Cereal" "https://www.smbc-comics.com/comic/rss"
feed "Minute Physics" "https://www.youtube.com/feeds/videos.xml?channel_id=UCUHW94eEFW7hkUMVaZz4eDg"
feed "Minute Food" "https://www.youtube.com/feeds/videos.xml?channel_id=UCA0g3liRXdpqyhxiQiE55tA"
feed "Minute Earth" "https://www.youtube.com/feeds/videos.xml?channel_id=UCeiYXex_fwgYDonaTcSIk6w"
feed "Primitive Technology" "https://www.youtube.com/feeds/videos.xml?channel_id=UCAL3JXZSzSm8AlZyD3nQdBA"
feed "Nicolaas" "http://feeds.soundcloud.com/users/soundcloud:users:454191234/sounds.rss"
feed "Jolla Blog" "https://blog.jolla.com/feed/"
@ -28,4 +29,6 @@ feeds() {
feed "BE-Alert" "https://www.be-alert.be/nl/rss.xml"
feed "Martanne" "https://www.brain-dump.org/blog/index.xml"
# feed "Instagram T21" "https://bibliogram.snopyta.org/u/tvervack/rss.xml"
feed "Pine64" "https://www.pine64.org/feed/"
feed "Punkt reddit" "https://www.reddit.com/r/Punkt/.rss"
}

View File

@ -15,7 +15,6 @@ xset r rate 300 55
forklog $backimg $(find -L /data/pictures/background-source/ -type f | sort -R | head)
forklog redshift
forklog pipewire
forklog pipewire-pulse
forklog dbus-run-session pipewire
exec xmonad

7
zshrc
View File

@ -77,13 +77,16 @@ alias nano="vis"
alias agent='eval "$(ssh-agent)" && ssh-add'
alias unlock='gpg-connect-agent <<<bye'
alias weechat="ssh -t weechat@Hetzner abduco -A weechat"
alias ncspot="abduco -A ncspot ncspot"
alias weechat="ssh -t weechat@Hetzner ./weechat.sh"
function agenda() {
khal calendar --format '{calendar-color}{cancelled}{start-end-time-style}{repeat-symbol} {title}{reset}' ${@:-today 2d}
}
function magnet() {
ssh Tumbrel "transmission-remote --add '$(xclip -o -sel c)'"
}
# Ledger
alias haccounts="hledger -I --alias '/.*:Accounts [^:]*:(.*)/=Accounts:\1' bal accounts"
alias is='hledger is -b $(date -d "7 months ago" +%Y-%m) -e $(date +%Y-%m) -MTA --tree -2'