Skip to content

Instantly share code, notes, and snippets.

@Malvineous
Malvineous / google-authenticator.sh
Created October 1, 2017 09:11
Shell script to generate Google Authenticator codes
#!/bin/sh
# This is the path to the Google Authenticator app file. It's typically located
# in /data under Android. Copy it to your PC in a safe location and specify the
# path to it here.
DB="/path/to/com.google.android.apps.authenticator/databases/databases"
sqlite3 "$DB" 'SELECT email,secret FROM accounts;' | while read A
do
NAME=`echo "$A" | cut -d '|' -f 1`
@Malvineous
Malvineous / route53-ddns.sh
Created January 28, 2017 06:42
One-liner for Dynamic DNS with Amazon Route53
# One liner for dynamic DNS with Amazon Route53
# Public domain 2017 Adam Nielsen <malvineous@shikadi.net>
#
# Run it from cron to keep your IP up to date.
# Requires Amazon CLI installed.
#
# TARGET_ZONEID: AWS Zone ID where the domain entry will go.
# TARGET_FQDN: DNS entry to create/update in the zone.
TARGET_ZONEID="Z12345"; TARGET_FQDN="home.example.com."; echo '{ "Comment": "DDNS update", "Changes":[ { "Action": "UPSERT", "ResourceRecordSet": { "ResourceRecords": [ { "Value": "'`dig +short myip.opendns.com @resolver1.opendns.com`'" } ], "Name": "'"$TARGET_FQDN"'", "Type": "A", "TTL": 60} } ] }' | aws route53 change-resource-record-sets --hosted-zone-id "$TARGET_ZONEID" --change-batch file:///dev/stdin
@Malvineous
Malvineous / adplay-unix-configure-test-fix.patch
Created July 18, 2016 12:09
adplay-unix proposed configure patch
diff --git a/configure.ac b/configure.ac
index 9d8db36..8a9cd10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,9 +28,9 @@ AC_CHECK_HEADERS([getopt.h], ,
AC_SUBST(GETOPT_SOURCES, [getopt.c getopt1.c getopt.h]))
# Save compiler flags and set up for compiling test programs
-oldldflags="$LDFLAGS"
+oldlibs="$LIBS"