Skip to content

Instantly share code, notes, and snippets.

@aerth
aerth / sbbuild
Created May 26, 2020 18:47
SlackBuild builder (saves to /root/sbos/ and prints the amount of time it took to build)
#!/bin/bash
if [ ! "$USER" = "root" ]; then
echo must run as root
exit 111
fi
if [ ! -f *.info ]; then
echo '*.info not found'
exit 112
@aerth
aerth / scp_age.md
Created May 14, 2020 21:23
Asymmetric Backups over SSH using 'age' encryption (https://github.com/FiloSottile/age)

You should edit all variables and filenames :)

==> backup_homes.bash <==

set -e
RECIPIENT_KEY=github://aerth
FILENAME="/tmp/backup_$(date +%s).dat"
DIR_TO_BACKUP=/home/

# pipe tar into age and then echo the filename when finished
var printf = fmt.Printf
var fprintf = fmt.Fprintf
var newerr = fmt.Errorf
@aerth
aerth / donate
Last active February 28, 2021 08:23
aerth donate address
AQUA: 0x81C6F3459CF418D4B92aDfEE41D5b2AB545316fa
ETH: 0x81C6F3459CF418D4B92aDfEE41D5b2AB545316fa
BTC: bc1qyushnctq89wh90yrmnw8h4tqh6mpf9l38qr0mq
XMR: 4AQMNXhM2FG1aSNetWFcBhLRBt15HHxV2ByQseoHMgBJXZcwj5jE5MDXjyYd8KE6aH9v3eQK2mG1AUyTFgvRTbWg4UEB2NP
LTC: MQv3dHtgagM9wYBE7mSXDTw5AGTMmuSsCa
@aerth
aerth / run.gdbscript
Created November 26, 2017 21:31 — forked from laanwj/run.gdbscript
Start bitcoind in a screen in a debugger
set disable-randomization off
set $_exitcode = -999
set height 0
handle SIGTERM nostop print pass
handle SIGPIPE nostop
define hook-stop
if $_exitcode != -999
quit
else
shell echo | mail -s "NOTICE: app has stopped on unhandled signal" root

snorql - the underwater NoSQL that bubbles

@aerth
aerth / gpg
Last active May 21, 2017 01:54
curl https://keybase.io/aerth/key.asc | gpg --import
echo "hello world" >> yourmessage.txt
cat yourmessage.txt | gpg -er aerth@riseup.net > yourmessage.txt.out
# see this
gpg: 3C66B4C6: There is no assurance this key belongs to the named user
pub 4096R/3C66B4C6 2016-05-02 aerth <aerth@riseup.net>
Primary key fingerprint: 8295 3CFA 6F4F 49D0 2B6A 082F EBC4 61F6 8638 5D5C
Subkey fingerprint: C08F EA77 F70C 5B37 2D8C 12EF F76A 0E59 3C66 B4C6
@aerth
aerth / cryptopal.go
Created May 17, 2017 19:11
cryptopal
package cryptopal
import (
"encoding/base64"
"encoding/hex"
"testing"
)
var input = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"
@aerth
aerth / k9-passwd.sh
Created May 9, 2017 20:18
extract password from k9 mail client android
adb into android, grab /data/data/com.fsck.k9/databases/preferences_storage
this is easier with sqlitebrowser
i had to remove some chars off the beginning of each string,
STRINGS=$(strings preferences_storage | grep "==")
for i in $STRINGS; do
echo $i | base64 -d
done
@aerth
aerth / 10-evdev.conf
Last active May 9, 2017 20:21
Disable Laptop Keyboard && Use USB Keyboard Instead ( good for broken laptop keys )
## /etc/X11/xorg.conf.d/10-evdev.conf
## Disable laptop's built-in keyboard (in X session)
## Does not disable on the kernel level
## Does not disable while ctrl+alt+f1 etc
## Useful for placing a USB keyboard on top of laptop's (broken) keyboard as to not accidentally input keys.
## <aerth@riseup.net>
##
## You may have to create the xorg.conf.d directory.
## Something like:
## mkdir-p /etc/X11/xorg.conf.d