Skip to content

Instantly share code, notes, and snippets.

Leigh McCulloch leighmcculloch

Block or report user

Report or block leighmcculloch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am leighmcculloch on github.
  • I am leighmcculloch ( on keybase.
  • I have a public key ASDPQilNNnhp30sKWE6cXdrSsoarlm56Gy44ORVW82ntFgo

To claim this, I am signing this object:

leighmcculloch / minimal-arq-aws-policy.json
Created Dec 24, 2017
Minimal AWS IAM policy for ARQ.
View minimal-arq-aws-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "0",
"Effect": "Allow",
"Action": ["s3:ListAllMyBuckets", "s3:ListObjects"],
"Resource": "*"
leighmcculloch / mfa-delete-execute.rb
Created Nov 7, 2015
A simple tool that will help you delete files on buckets with MFA Delete feature enabled.
View mfa-delete-execute.rb
#!/usr/bin/env ruby
require 'aws-sdk'
print "AWS Account ID: "
aws_account_id = STDIN.gets.chomp
print "S3 bucket name: "
bucket_name = STDIN.gets.chomp
print "AWS Access Key ID: "
aws_id = STDIN.gets.chomp
print "AWS Access Secret Key: "
leighmcculloch / mfa-delete-enable.rb
Last active Nov 7, 2015 — forked from petethepig/mfa-delete.rb
A simple tool that will help you enable MFA Delete feature on your S3 bucket
View mfa-delete-enable.rb
#!/usr/bin/env ruby
require 'aws-sdk-v1'
print "S3 bucket name: "
bucket_name = STDIN.gets.chomp
print "AWS Access Key ID: "
aws_id = STDIN.gets.chomp
print "AWS Access Secret Key: "
aws_key = STDIN.gets.chomp
print "AWS Root MFA Serial: "
leighmcculloch / mdig.rb
Created Aug 20, 2014
Multi-Region DNS Lookup Utility
View mdig.rb
# Multi-Region DNS NameServer Propogation Check
# Uses the API to retrieve the NS records for a zone (domain name)
# at 19 (more or less) different locations globally. Use this to monitor the
# propogation of nameserver changes at your registrar.
# Note: There is no such thing as a guarantee when it comes to whether your
# new nameservers have propogated fully or not. Rule of thumb is three days
# but often it is much faster and this check can help you weigh the risks.
leighmcculloch / Android Screenshot.bat
Created Dec 5, 2013
This batch script will take a screenshot on an Android device using ADB, download the screenshot to the directory this script to the current directory and then remove the screenshot file from the device. Screenshots are saved with filename: screenshot-YYYYMMDD-HHMMSS.png. ADB must be connected to a device already.
View Android Screenshot.bat
@echo off
rem configurable parameters
rem the dir on the device where the screenshot will be stored temporarily
rem adb path, leave blank if adb is already on the user or system path
leighmcculloch / NSData+HexString.h
Last active Dec 29, 2015
A category for NSData that returns a hex string of the data within. Output is like: af459a2f
View NSData+HexString.h
// NSData+HexString.h
// Copyright (c) 2013, Leigh McCulloch. All rights reserved.
// BSD-2-Clause License:
#import <Foundation/Foundation.h>
@interface NSData (HexString)
leighmcculloch / Google Analytics.js Outbound Link Tracking.js
Last active Oct 18, 2018
This JavaScript will catch any outbound links and register them with Google Analytics before the browser loads the linked URL. This script works with Google's new analytics.js and not the older ga.js. This script ensures the attempt to register the page with Google Analytics is complete before continuing to load the next page. This capability is…
View Google Analytics.js Outbound Link Tracking.js
View autotype.scpt
# Author: Leigh McCulloch
# License: BSL-1.0 (
# This script takes arguments from the command line and autotypes
# them with tab separators into the last selected application.
# This can be used from one application to auto-type into another
# application.
# Command line usage:
# osascript autotype.spct [username] [password]
View NSString_stripHtml.h
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
You can’t perform that action at this time.