Skip to content

Instantly share code, notes, and snippets.

@mdaniel
mdaniel / Vagrantfile
Last active December 22, 2017 07:10
Build [asuswrt-merlin](https://github.com/RMerl/asuswrt-merlin#readme) using Vagrant. This is just works-for-me, and not an officially supported mechanism
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# the resulting image won't be 64 bit,
# so adding that into the mix just makes life painful
config.vm.box = "ubuntu/trusty32"
config.vm.boot_timeout = 3600
config.vm.provider "virtualbox" do |vb|
@mdaniel
mdaniel / glide.yaml
Created December 6, 2017 17:50
Issue daemon-reload and install systemd unit files from golang
package: systemd-installer
import:
- package: github.com/coreos/go-systemd
version: v15
- package: github.com/godbus/dbus
version: v4.0.0
@mdaniel
mdaniel / hidemyass_proxylist.py
Created May 10, 2015 20:17
Extracts the proxy list from proxylist.hidemyass.com
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
__docformat__ = 'reStructureText'
import logging
import re
import sys
import html5lib
from xml.etree.ElementTree import tostring
@mdaniel
mdaniel / Vagrantfile.sh
Last active March 26, 2017 23:57
Vagrantfile.sh script to provision an EMR compatible (hadoop 1.0.3, JavaSE 1.6) Vagrant instance
#! /bin/sh
set -e
set -x
## this script is run as `sudo /tmp/vagrant-shell` by ~vagrant
#echo '[USER]'
#id -a
#echo '[ENV]'
#env
@mdaniel
mdaniel / har2maff.py
Created June 27, 2014 00:19
Convert HAR to MAFF
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from bs4 import BeautifulSoup
import hashlib
import logging
import json
import os
import sys
import re
@mdaniel
mdaniel / pkgutil_rm.sh
Last active May 12, 2016 17:58
Uninstall OS X packages using pkgutil manifests
#! /bin/bash
# can't -e because of all the potentially missing files/dirs
# and rm(dir) executions
set -u
args=`getopt dfn $*`
if [ $? != 0 ]; then
echo "Usage: $0 [-n] [-f|-d[d]] pkg-id" >&2
exit 1
@mdaniel
mdaniel / Vagrantfile
Created February 19, 2014 00:01
Ansible script to provision GetSentry on a precise (Ubuntu 12.04) machine (or optionally the Vagrantfile); the script will provision to the point where you can run ``sentry init`` and its friends
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'precise'
config.vm.hostname = 'sentry1'
config.vm.network :private_network, ip: '192.168.56.105'
@mdaniel
mdaniel / docker2rc.py
Created January 29, 2016 22:26
Mostly convert the output of "docker inspect" into a Kubernetes ReplicationController
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import re
import sys
import yaml
@mdaniel
mdaniel / gradle-2.x.patch
Created January 13, 2016 02:24
Gradle patches that permit the use of a jarsigned plugin (as well as fixing two NPEs)
This patch was tested against every 2.x release tag in https://github.com/gradle/gradle.git and applies cleanly to all of them,
except for the following error message:
> warning: inexact rename detection was skipped due to too many files.
> warning: you may want to set your merge.renamelimit variable to at least 4384 and retry the command.
diff --git a/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java b/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
index abbb13b..6e9f26d 100644
--- a/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
+++ b/subprojects/core/src/main/groovy/org/gradle/api/internal/AsmBackedClassGenerator.java
@mdaniel
mdaniel / __main__.py
Created January 6, 2016 08:15
Driver for https://github.com/Roguelazer/onepasswordpy.git; ```mkdir onepassword/cli; touch onepassword/cli/__init__.py``` then put this `__main__.py` into `onepassword/cli` and invoke it with `python -m onepassword.cli -k path/to/my/keystore --list`
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import sys
from getopt import getopt
from getpass import getpass
# this is a factory method that one can find in "keychain.patch" below
from ..keychain import load_keychain