Skip to content

Instantly share code, notes, and snippets.

View lokulin's full-sized avatar
☠️
dithering...and not in the floyd-steinberg sense.

Lauchlin lokulin

☠️
dithering...and not in the floyd-steinberg sense.
View GitHub Profile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This program is free software; you
; can redistribute it and/or modify
; it under the terms of the GNU
; General Public License as published
; by the Free Software Foundation;
; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the
@lokulin
lokulin / ghetto_dropbox.sh
Last active September 16, 2015 13:24
Ghetto Dropbox
#!/usr/bin/env bash
exec 1> >(logger -s -t $(basename $0)) 2>&1
WATCH_DIR="/cache/"
S3_BUCKET="com.lauchlin.cache"
AWS_REGION="ap-southeast-2"
aws s3 sync --delete "${WATCH_DIR}" "s3://${S3_BUCKET}${WATCH_DIR}" \
--region ap-southeast-2
@lokulin
lokulin / get_vpn_status.sh
Created September 13, 2015 06:27
Get the vpn status from a QNAP appliance and return a JSON string
#!/usr/bin/env bash
BASE_URI="https://127.0.0.1/cgi-bin"
USER=""
ENCPWD=""
sid=$(curl --silent "${BASE_URI}/authLogin.cgi?user=${USER}&pwd=${ENCPWD}" | xmlstarlet sel -t -v "QDocRoot/authSid" -)
function get_status {
curl --silent "${BASE_URI}/application/appRequest.cgi?subfunc=vpn_client&sid=${sid}" |
@lokulin
lokulin / pem2plex.py
Created September 10, 2015 13:43
Convert the x509 certificate to certificate.p12 that Plex requires.
#!/usr/bin/python
import sys
import hashlib
from OpenSSL.crypto import *
def main():
if(len(sys.argv) != 4):
print sys.argv[0] + " /path/to/ssl.crt /path/to/ssl.key ProcessedMachineIdentifier"
sys.exit(0)

Keybase proof

I hereby claim:

  • I am lokulin on github.
  • I am lokulin (https://keybase.io/lokulin) on keybase.
  • I have a public key whose fingerprint is BCEE E6B0 B453 CA89 FE8C 3D71 CABB A000 EACA BFD9

To claim this, I am signing this object:

@lokulin
lokulin / sample.json
Created May 1, 2015 08:48
Simple JSON snipet
{ "status": "OK" }