Skip to content

Instantly share code, notes, and snippets.

Avatar
🐱
I'm a cat

Linus Xanoni xanoni

🐱
I'm a cat
View GitHub Profile
@xanoni
xanoni / testobfs4.py
Created November 2, 2021 00:03 — forked from mrphs/testobfs4.py
testing obfs4 performance
View testobfs4.py
#!/usr/bin/env python
import csv
import datetime
import os
import os.path
import re
import sys
import time
import urllib2
@xanoni
xanoni / cheatsheet.md
Created October 10, 2021 06:44 — forked from masklinn/cheatsheet.md
launchctl/launchd cheat sheet
View cheatsheet.md

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,

View Xanoni GitHub Key (81C3E127) – Public.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGDf0tEBEADL+hsFUzyJu1YDYizizhETMiX0Jaut9cGvOLcy0AUrTVsOb+8G
wchNmoqDtuJth2JQ12zFAEV6uWHvVv0otPnepRRNpl14T5/4NvKeHRGgzZ/I8aIx
2s6TJPeRcuszCotbnqwj/1p8uB8F+OaqM4BShPzu/dC3vUv/fBKHJ8cnv8nKSw4B
3oz0WvskTcA97eU5h2JaGOmNcWZN0SzkQTbhl5Vd37GEgnSLd1btn3g1dQiFgXqn
2afCqZyNOlw/TnB0iQEoR0Kzbe1xsRZ18AyA4qOSsrE6HzKguNdNKLILaKzIVPIL
L1ZLA775NnjwYZmQ5f/euV2bvWLlvD8SYUzH29Qoc4hK4MosOKtcHG5NeM9BLjdU
ilBjBxXVSJzsUKTG95OagHxqKSir1UOztgAUmBs74fCmfWXpTAG/BSzdXB7O0Hs8
7W2j6vzU0053Kv/tmqjKn39BVBKdd00UP1pqpNgWvak+tsIzPj72XNIWSUr5Bsxm
@xanoni
xanoni / img-sanitize.sh
Created September 18, 2021 15:59
Sanitize image files (strip tags and pick random filename)
View img-sanitize.sh
#! /usr/bin/env -S bash -e
function rand-rename {
local oldnames=("${@}")
local newname
local baseascii
for oldname in "${oldnames[@]}"; do
if [ -f "${oldname}" ]; then
baseascii="$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | \
sha256sum | head -c15)"
@xanoni
xanoni / process_names.txt
Created September 9, 2021 06:06 — forked from miguelmota/process_names.txt
macOS process whitelist
View process_names.txt
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"
@xanoni
xanoni / socat_socks_proxy.sh
Created September 6, 2021 07:18 — forked from lene/socat_socks_proxy.sh
Using tor as SOCKS proxy with SOCAT
View socat_socks_proxy.sh
socat TCP-LISTEN:<localport> SOCKS4A:localhost:<host>:<remoteport>,socksport=9050
# for example, to ssh into secret.shell.server.org via tor, do:
$ socat TCP-LISTEN:22222 SOCKS4A:localhost:secret.shell.server.org:22,socksport=9050 &
$ ssh localhost -p 22222
@xanoni
xanoni / MyMonero-Tor.sh
Created September 5, 2021 22:22
Running MyMonero over Tor (MacOS)
View MyMonero-Tor.sh
#! /usr/bin/env bash -ex
## Please note that MyMonero sucks, avoid it unless you have no better alternative
SCRIPT_DIR="$(dirname $(realpath $0))"
WRAPPER_CMD="/usr/local/bin/torsocks"
export HTTP_PROXY="127.0.0.1:8118"
export HTTPS_PROXY="${HTTP_PROXY}"
@xanoni
xanoni / macos-tmux-256color.md
Created August 12, 2021 05:52 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS
View macos-tmux-256color.md

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@xanoni
xanoni / luks-benchmark.sh
Created August 10, 2021 23:09
LUKS: benchmark encrypted disk
View luks-benchmark.sh
#! /usr/bin/env -S bash -e
#drive="/dev/sdd2"
drive="/dev/mapper/croot"
if ! [ -z ${1} ]; then
drive=${1}
fi
function benchmark_cryptsetup {
@xanoni
xanoni / luks-create-4k-drive.sh
Last active August 14, 2021 07:27
LUKS: create 4096B sector drive for Raspberry Pi
View luks-create-4k-drive.sh
Moved here: https://github.com/xanoni/RaspberryPi-4B-LUKS-Scripts/blob/main/scripts/luks-create-4k-drive.sh