Skip to content

Instantly share code, notes, and snippets.

View jmazzi's full-sized avatar

Justin Mazzi jmazzi

View GitHub Profile
@jmazzi
jmazzi / pacman.conf
Created January 25, 2011 18:42
How to fix adobe-air apps on Arch Linux x86_64 (Fix Error: HTMLLoader failed to initializeTypeError: Error #1009)
# sync package db
pacman -Sy
# installed bin32 adobe-air, be sure to remove the old one if you already installed it
yaourt -S aur/bin32-adobe-air
# Install the missing libs the AURs should depend on.
pacman -S lib32-libxt lib32-libxtst
@jmazzi
jmazzi / zone2json.patch
Created August 10, 2012 18:32
PowerDns zone2json
diff -urN a/pdns/backends/bind/Makefile.am b/pdns/backends/bind/Makefile.am
--- a/pdns/backends/bind/Makefile.am 2012-08-04 20:50:29.515826404 +0300
+++ b/pdns/backends/bind/Makefile.am 2012-08-04 20:49:57.009928123 +0300
@@ -16,7 +16,7 @@
libbind2backend_la_CFLAGS=$(AM_CFLAGS)
libbind2backend_la_LDFLAGS=-module -avoid-version
-bin_PROGRAMS = zone2sql zone2ldap
+bin_PROGRAMS = zone2sql zone2ldap zone2json
@jmazzi
jmazzi / import-cache.php
Created March 31, 2016 18:27 — forked from danielbachhuber/import-cache.php
During `wp import`, cache remote files locally for subsequent imports
<?php
/**
* Run with `wp --require=import-cache.php import ...
*/
WP_CLI::add_hook( 'after_wp_load', function(){
// Only intercept HTTP requests when the importer is running
if ( ! defined( 'WP_IMPORTING') || ! WP_IMPORTING ) {
return;
@jmazzi
jmazzi / calender_events.txt
Created April 20, 2016 14:39
Google Inbox & Gmail rule to bundle and label calendar invites
(*.ics AND has:attachment AND ("(GMT" OR "Invitation:"))
@jmazzi
jmazzi / facebook-contact-info-summary.rb
Created March 30, 2018 20:09 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@jmazzi
jmazzi / filter_hash.rb
Created August 28, 2013 21:04
Filter arbitrary hashes in rails using your configured filter parameters.
def scrub(hash)
filter_with = Rails.application.config.filter_parameters
ActionDispatch::Http::ParameterFilter.new(filter_with).filter(hash)
end
@jmazzi
jmazzi / percona-server.rb
Created September 1, 2011 21:34
Percona 5.5 OS X
require 'formula'
class PerconaServer < Formula
url 'http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.15-21.0/source/Percona-Server-5.5.15-rel21.0.tar.gz'
homepage 'http://www.percona.com'
md5 'd04b6d1cc863f121f5d1eac8bc618331'
version '5.5.15-21.0'
keg_only "Has the potential to overwrite mysql formula"
@jmazzi
jmazzi / keybase.md
Last active December 16, 2016 16:53

Keybase proof

I hereby claim:

  • I am jmazzi on github.
  • I am jmazzi (https://keybase.io/jmazzi) on keybase.
  • I have a public key ASBTdS9x8pa73kHZZbZ5CSQQbGkzLNkLrG4hhYxTsTJr3Ao

To claim this, I am signing this object:

@jmazzi
jmazzi / chef.rb
Created July 27, 2012 03:26 — forked from gmcmillan/chef.rb
Simple Ruby class for manually querying the Chef REST API (using Net::HTTP instead of Chef's REST resources)
require 'base64'
require 'time'
require 'digest/sha1'
require 'openssl'
require 'net/https'
require 'json'
class Chef
attr_accessor :http, :path
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBEitfOcBCAC238JNzEZwSXVGZmIAlmfyyVqgOmoReKyp7sIQoHNhUT2Li4LP
wmAiZnoXQcBIVn0dG9OKXY8sAU9naavOrqhWorDtpY9W3Chg9O/yBiu4jSO1YZK5
YkXLlHs/gF3qbZPXR2JYq+2IjxY3r2TXkoVT3HWgy4vymr/KLoK9tQ0DbAn9dGil
UufXKsbE72x8/JECPo3jIBm+drEegeSf6tRgQPpQ0vMMZtwLRqJm1UHwqOnqg4xi
8Mypnz5ocDLYp7DJEBoNvAJ1033vwA3yK0GQnRIrfaupFR8tcw+hDQC7rpVtlqus
I1qcOc+NLfUQbkz+dcQ3avRqkNEyOfNNLjuxABEBAAG0H0p1c3RpbiBNYXp6aSA8
aGhAbWFpbGhlaXN0LmNvbT6JAYcEEAECAHEFAki1vrYwFIAAAAAAIAAHcHJlZmVy
cmVkLWVtYWlsLWVuY29kaW5nQHBncC5jb21wZ3BtaW1lBwsJCAcDAgoCGQEZGGxk