Skip to content

Instantly share code, notes, and snippets.

Avatar
💀
Noodling

Lauchlin lokulin

💀
Noodling
View GitHub Profile
View ghetto_dropbox.sh
#!/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 Sep 13, 2015
Get the vpn status from a QNAP appliance and return a JSON string
View get_vpn_status.sh
#!/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 Sep 10, 2015
Convert the x509 certificate to certificate.p12 that Plex requires.
View pem2plex.py
#!/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)
View keybase.md

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
Simple JSON snipet
View sample.json
{ "status": "OK" }
You can’t perform that action at this time.