Skip to content

Instantly share code, notes, and snippets.

View adamwalz's full-sized avatar

Adam Walz adamwalz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am adamwalz on github.
  • I am adamwalz (https://keybase.io/adamwalz) on keybase.
  • I have a public key whose fingerprint is 2EF6 0078 D0DC EC77 72BA E979 7D63 5FB2 24BA 2765

To claim this, I am signing this object:

@adamwalz
adamwalz / history.sh
Created November 5, 2015 19:46
Gets history weather data for use by OpenSprinkler
#!/bin/bash
date=$1
wunderground_key="INSERT KEY HERE"
summary="$(http http://api.wunderground.com/api/${wunderground_key}/history_${date}/q/UT/Sandy.json | jsawk 'return this.history.dailysummary[0]')"
minhumidity=$(echo $summary | jsawk 'return this.minhumidity')
maxhumidity=$(echo $summary | jsawk 'return this.maxhumidity')
temp=$(echo $summary | jsawk 'return this.meantempi')
@adamwalz
adamwalz / rename.md
Last active November 10, 2015 20:32
Batch Rename Torrented Movies and TV Shows

Batch rename torrented movies and TV shows

Rename is a *nix tool to rename files according to modification rules specified on the command line.

The examples below show how to rename common naming schemes from toreented moveies and tv shows in the way that Plex can parse to gather metadata. The examples all currently use the -n flag to do a dry run and only print out what the files would be renamed to. Remove the flag to actually overwrite the filename.

Rename TV Shows

Example

'Modern.Family.S05E01.720p.5.1Ch.Web-DL.ReEnc-DeeJayAhmed.mkv' --> 'Modern Family - s05e01.mkv'

@adamwalz
adamwalz / vpn_shared_secret_decoder.py
Created November 20, 2014 22:50
VPN Shared Secret decoder for networkConnect files
#!/usr/bin/python
# Decoder for the ExportedSharedSecret values stored in .networkConnect files
# Tested with .networkConnect files created in Mac OS X 10.10
#
# Author: Martin Rakhmanov, http://jimmers.info
#
# Example invocation and output:
#
# python vpn_shared_secret_decoder.py TLthF+e88vwmAYhK
@adamwalz
adamwalz / jekyll_gist_example.rb
Created August 12, 2014 18:39
This is used as an example in my Jekyll blog
# This is a github gist
a = 10
b = 3 * a + 2
printf("%d %d\n", a, b);
#!/usr/bin/osascript
------------------------------------------------------------------------------
-- FILE: pocket_to_evernote_clipper.scpt
-- DESCRIPTION: Imports all clips from Pocket into Evernote through the
-- Evernote Web Clipper for Safari
-- AUTHOR: Adam Walz <[email protected]>
-- VERSION: 1.1.0
--
-- This script takes a file containing a list of urls, one per line, and
-- imports the urls into Evernote by similuating use of the Evernote Web
@adamwalz
adamwalz / adamwalz.net.nginxconf
Last active July 16, 2019 05:31
Jekyll optimized nginx server configuration used on adamwalz.net
server {
server_name www.adamwalz.net;
return 301 $scheme://adamwalz.net$request_uri;
}
server {
server_name adamwalz.net *.adamwalz.net;
root /home/adamwalz/Sites/adamwalz.net;
access_log /var/log/nginx/adamwalz.net/access.log;
@adamwalz
adamwalz / redate_evernote_receipts.scpt
Last active October 8, 2018 00:53
Batch changes the creation of notes in Evernote based on their notebook and a tag specifying the month to change to. The new creation date will be the last day of that month. For Example, notes with the tag "march" in the notebook "Receipts 2003" will all have the creation date "March 31, 2013"
#!/usr/bin/osascript
------------------------------------------------------------------------------
-- FILE: redate_evernote_receipts.scpt
-- DESCRIPTION: Changes the created: attributes of notes in a Receipts Notebook
-- AUTHOR: Adam Walz <[email protected]>
-- VERSION: 1.0.0
--
-- This script changes the created: attribute of notes in a single notebook
-- to 11:59:59 on the last day of the month.
-- To do this, notes are required to be in a notebook titled "Receipts 2014"
@adamwalz
adamwalz / rules2filters.py
Created April 28, 2013 19:28
Python script to export Apples Mail.app rules into gmail filters
from plistlib import readPlist
from cgi import escape
from lxml.etree import SubElement as sub
import lxml.etree
# Load in apple mail rules file
rules_file = '~/Library/Mail/V2/MailData/SyncedRules.plist'
rules = readPlist(rules_file)
# Create gmail filters xml header