Skip to content

Instantly share code, notes, and snippets.

View obfusk's full-sized avatar
🏳️‍🌈
hacking ⇒ ¬sleeping 😸

FC (Fay) Stegerman obfusk

🏳️‍🌈
hacking ⇒ ¬sleeping 😸
View GitHub Profile
@obfusk
obfusk / logcat-pkg.sh
Last active December 1, 2020 19:27
quick and dirty logcat for specific package only
#!/bin/bash
PACKAGE="$1" PIDS=()
adb logcat | while read -r _date _time pid _tid _prio tag data; do
data="${data#: }"
if [[ "$data" =~ ^'Start proc '([0-9]+):"$PACKAGE" ]]; then
PIDS+=( "${BASH_REMATCH[1]}" )
elif [[ " ${PIDS[*]} " =~ " $pid " ]]; then
printf '[%-20s] %s\n' "${tag%:}" "$data"
fi
done
@obfusk
obfusk / hub.sh
Created November 30, 2020 19:47
frequently used bash commands
unbuffer hub ci-status -v | sort -k2 -V | sed 's!https:.*!!'
unbuffer hub issue -f '%sC%>(3)%i%Creset %t [%L]%n' | sed 's/enhancement/enh/; s/good first issue/1st/; s/help wanted/help/'
@obfusk
obfusk / bdiff.sh
Last active May 6, 2024 02:28
diff + bat
#!/bin/bash
diff -Naur "$@" | bat -p -l diff
@obfusk
obfusk / build-and-install.sh
Created November 12, 2020 16:02
fake python3-vagrant package (to install fdroidserver w/o vagrant)
equivs-build python3-vagrant-equivs.control
sudo dpkg -i python3-vagrant_1.0_all.deb
@obfusk
obfusk / strip-ansi.sh
Last active October 23, 2020 19:57
strip ansi escape (e.g. colour) codes
#!/bin/bash
sed -r 's/\x1b\[[;?0-9]*[a-zA-Z]//g'
@obfusk
obfusk / eq.sh
Created August 2, 2020 20:13
quick command line string equality test
#!/bin/bash
set -e
a="$1" b="$2"
if [ $# -lt 1 ]; then read -r -p "A: " && a="$REPLY"; fi
if [ $# -lt 2 ]; then read -r -p "B: " && b="$REPLY"; fi
test "$a" = "$b" && echo OK
@obfusk
obfusk / radicals.sh
Created July 30, 2020 20:22
radicals
for x in {1..214}; do
echo $x
curl -s -- "https://en.wikipedia.org/wiki/Radical_$x" \
| ( grep -E -A5 '>(without|0|no)( additional)? strokes|>0(<|$)|\+ ?0(<|$)' || echo ) \
| tail -n +2 | tr '\n' ' ' | sed 's!</tr>.*!!' | tr -d '0-9A-Za-z"=<> :/.%#()+_&;?-'
echo
done
@obfusk
obfusk / gitattributes
Created July 12, 2020 12:07
git diff xml.gz
*.xml.gz diff=gzip
@obfusk
obfusk / dot.cargo_config
Created June 23, 2020 22:26
.cargo/config to use local/offline debian packages instead of crates.io
[source.crates-io]
replace-with = "debian-local"
[source.debian-local]
directory = "/usr/share/cargo/registry"
@obfusk
obfusk / jitsi.md
Last active May 23, 2020 03:55
jitsi security

Scanning the internet for jitsi servers is pretty trivial. If you run your own server without authentication:

  • Anyone can use your server.
  • Vanity URLs are not safe.

In other words: you have pretty much the same security problems as when using meet.jit.si (except it's slightly harder to find and you presumably don't have to worry about the current lack of e2ee -- assuming you trust your hosting provider -- since you control the server).

My recommendations:

  • Always use authentication on self-hosted servers unless you intend for them to be used by anyone (like meet.jit.si and other public servers).