Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Create an OS X Mavericks vagrant box (for VMWare)
# Assumes you have /Applications/Install OS X Mavericks.app, brew, and of course vagrant
# http://grahamgilbert.com/blog/2013/08/23/creating-an-os-x-base-box-for-vagrant-with-packer/
EDITOR="mate -w"
WORKDIR=/tmp/osxvagrant
mkdir -p $WORKDIR
cd $WORKDIR
@bsmt
bsmt / nsdataliteral.py
Created January 1, 2014 06:18
Dirty run script for xcode that allows NSData objects containing binary data (hex strings) to be declared using literal statements.
#!/usr/bin/env python
'''
The problem: Making NSData objects from byte strings is a pain.
To convert 0xb801000000c3 to NSData I have to make an escaped C string somehow,
which is either going to be annoying hardcoding or unnecessary categories.
Most basic foundation classes have literals (@1, @"string", etc.). Why not NSData?
This fixes that.
Simply do: NSData *data = @<b801000000c3>;
@bsmt
bsmt / blah.py
Last active December 20, 2015 01:49
Demonstrate how to scrape ciphertext from http://homebrew.herokuapp.com/
# python blah.py my plaintext here
# F3C3ECD09B3238CB8060C2AF55BFC31451FF8C8DA0B6A0FC876FFA54D6D72B9BE3CAD927F8
# http://homebrew.herokuapp.com/?plaintext=my+plaintext+here
import requests
from HTMLParser import HTMLParser
from urllib import quote
import sys
@bsmt
bsmt / Armory
Last active December 14, 2015 18:38
Package Armory into an app bundle for OS X.
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &