Skip to content

Instantly share code, notes, and snippets.

@angdraug
angdraug / fediblock-import.sh
Last active February 2, 2023 00:34
Scan and import FediBlock domain block list
#!/bin/sh
# Set TOKEN following steps in https://docs.joinmastodon.org/client/authorized/
$SERVER=$1
tr , ' ' | \
while read DOMAIN SEVERITY COMMENT; do
curl -H "Authorization: Bearer $TOKEN" \
-F domain=$DOMAIN \
-F severity=$SEVERITY \
-F public_comment="$PUBLIC_COMMENT" \
https://$SERVER/api/v1/admin/domain_blocks
@angdraug
angdraug / keybase.md
Created October 21, 2019 00:09
keybase.md

Keybase proof

I hereby claim:

  • I am angdraug on github.
  • I am angdraug (https://keybase.io/angdraug) on keybase.
  • I have a public key ASDaVdfUOg_ulpD_6Qhn57FoGJIMQd6Dh_qZVKUZzi8cJgo

To claim this, I am signing this object:

@angdraug
angdraug / openvpn-client.conf
Created January 5, 2016 04:34
VPN kill switch with Linux network namespaces
# . . .
script-security 2
up '/etc/openvpn/vpn-init start'
down '/etc/openvpn/vpn-init stop'
down-pre
@angdraug
angdraug / display
Created January 5, 2016 04:09
Detect and enable external display's preferred resolution
#!/bin/bash
INTERNAL=eDP1
COMMAND=$(xrandr |awk '/^Screen|^'$INTERNAL'|disconnected/ { output=0; next }
/\<connected\>/ { output=$1 }
/^ /{if(output && $0 ~ /+/) print "xrandr --output "output" --mode "$1" --above '$INTERNAL'"}')
[ -n "$COMMAND" ] && $COMMAND