Skip to content

Instantly share code, notes, and snippets.

@aaronk6
aaronk6 / ddns_desec.rsc
Created October 3, 2023 12:23
RouterOS dynamic DNS update script for desec.io (IPv4 and IPv6)
# RouterOS dynamic DNS Update Script for deSEC
# ============================================
# make global to preserve IP and IPv4 address across script executions
:global ipddns
:global ipv6ddns
:local ddnshost "myhost.example.com"
:local token "MY_TOKEN"
:local waninterfacev4 "V4_INTERFACE_NAME" # Interface to retrieve WAN IPv4 address from (i.e. pppoe-out1)
@aaronk6
aaronk6 / generate-share-link
Last active August 16, 2023 12:24
Script for generating Filebrowser share links (call ./generate-share-link -h to see usage information)
@aaronk6
aaronk6 / copy-safari-tab-link.sh
Last active November 11, 2023 20:39
This script retrieves the URL and title of the active Safari tab, constructs an HTML link, and copies it to the clipboard. It also includes a plain-text representation in Markdown syntax.
@aaronk6
aaronk6 / ddns_henet.rsc
Last active July 18, 2024 23:12
RouterOS dynamic DNS update script for he.net (IPv4 and IPv6)
# RouterOS dynamic DNS Update Script for he.net
# =============================================
# make global to preserve IP and IPv6 address across script executions
:global ipddns
:global ipv6ddns
:local ddnshost "myhost.example.com"
:local ddnspass "MY_SECURE_PASSWORD"
:local waninterfacev4 "V4_INTERFACE_NAME" # Interface to retrieve WAN IPv4 address from (i.e. pppoe-out1)
@aaronk6
aaronk6 / check-vault-encryption
Created October 19, 2018 14:39
Git pre-receive hook to ensure Ansible Vault encryption
#!/usr/bin/env bash
set -o errexit
set -o nounset
TEMPDIR=$(mktemp -d)
prefix="[vault-check]"
zero_commit="0000000000000000000000000000000000000000"
bad_file=0
@aaronk6
aaronk6 / README.md
Last active November 9, 2023 05:17
launchUri

Cross-browser implementation of navigator.msLaunchUri

Microsoft’s navigator.msLaunchUri method only works in Internet Explorer on Windows 8. Therefore I came up with a (nearly) cross-browser implementation that uses the native msLaunchUri when it’s available and falls back to adventurous hacks when running in other browsers.

Description

launchUri (uri, successCallback, noHandlerCallback, unknownCallback)
@aaronk6
aaronk6 / playeras3.as
Created September 25, 2014 15:20
ActionScript 3 source from https://github.com/sproutcore/sproutcore/blob/master/frameworks/media/resources/playeras3.fla (rev c9bf4139f7b29ff3394df0c6651c432cd9dfa235)
import flash.external.ExternalInterface;
import fl.video.*;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
var scid= String(paramObj['scid']);
if(String(paramObj['src']).length>1) videoCanvas.source = String(paramObj['src']);
else videoCanvas.source = 'http://localhost:4020/static/video/en/current/video.m4v';
videoCanvas.addEventListener(VideoEvent.READY, ready);
@aaronk6
aaronk6 / jquery-ajax-blob-arraybuffer.js
Last active June 1, 2020 19:10 — forked from SaneMethod/jquery-ajax-blob-arraybuffer.js
This fork supports request headers and returns text data if the request fails.
/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer -
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.aaronk6.doorbell</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/doorbell.py</string>
<string>--host</string>
@aaronk6
aaronk6 / doorbell.py
Last active August 29, 2015 13:57
Send push notification when doorbell rings (using Tinkerforge Industrial Digital In 4 Bricklet)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Send push notification when doorbell rings
# using Tinkerforge Industrial Digital In 4 Bricklet
#
# License: CC BY-SA 3.0
# Based on http://www.tinkerforge.com/de/doc/Kits/HardwareHacking/DoorbellNotifier_Python.html
#
# The following changes were made: