Skip to content

Instantly share code, notes, and snippets.

@oconnor663
oconnor663 / fbmessenger.fb
Last active December 22, 2015 09:58
testing
require 'formula'
class Fbmessenger < Formula
homepage 'https://github.com/oconnor663/fbmessenger'
url 'https://github.com/oconnor663/fbmessenger/archive/master.zip'
version '0.2.0'
# The build won't work without the brew version of python2
depends_on "python"
@oconnor663
oconnor663 / udpserver.py
Created September 7, 2013 03:08
UDP test server
import socket
import hashlib
import json
UDP_IP = "127.0.0.1"
UDP_PORT = 5005
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
@oconnor663
oconnor663 / udpclient.py
Created September 7, 2013 03:07
UDP test client
import sys
import socket
import json
import hashlib
UDP_IP = "127.0.0.1"
UDP_PORT = 5005
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
@oconnor663
oconnor663 / imagemagick-for-rmagick.patch
Created September 9, 2013 20:47
imagemagick PKGBUILD changes for compatibility with rmagick
diff --git a/PKGBUILD.old b/PKGBUILD
index 3fd9a4a..ab2a25d 100644
--- a/PKGBUILD.old
+++ b/PKGBUILD
@@ -27,7 +27,7 @@ prepare() {
build() {
cd ImageMagick-${pkgver%.*}-${pkgver##*.}
./configure --prefix=/usr --sysconfdir=/etc --with-modules --disable-static \
- --enable-hdri --with-wmf --with-openexr --with-xml --with-lcms2 --with-jp2 \
+ --with-wmf --with-openexr --with-xml --with-lcms2 --with-jp2 \
@oconnor663
oconnor663 / gist:7934599
Created December 12, 2013 20:11
fbmessenger crash
*** Error in `/usr/bin/python3': malloc(): smallbin double linked list corrupted: 0x00000000041de6a0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x72e5f)[0x7f3cf3c3ee5f]
/usr/lib/libc.so.6(+0x7862e)[0x7f3cf3c4462e]
/usr/lib/libc.so.6(+0x7a834)[0x7f3cf3c46834]
/usr/lib/libc.so.6(__libc_malloc+0x60)[0x7f3cf3c47c50]
/usr/lib/libcurl.so(+0xc16d)[0x7f3c444cf16d]
/usr/lib/libcurl.so(+0xc383)[0x7f3c444cf383]
/usr/lib/libcurl.so(+0xd53e)[0x7f3c444d053e]
/usr/lib/libcurl.so(+0x11d69)[0x7f3c444d4d69]
@oconnor663
oconnor663 / gist:8063575
Created December 21, 2013 00:01
How to restore Kingdom Rush game data from backup.ab
# This might, maybe, conceivably work as a script. But I suggest executing all
# the commands manually, because I doubt everything will Just Work,
# particularly the 'adb root' command. Setting the '-e' option makes the script
# exit on the first error, in case you do want to run it.
set -e
# First, make a copy of backup.ab, because if we accidentally delete it we're
# screwed.
OUR_TMPDIR=`mktemp -d`
cp backup.ab $OUR_TMPDIR
@oconnor663
oconnor663 / gist:8142166
Created December 27, 2013 03:17
Cracking a password with a known structure.
import random
import string
import itertools
def random_capitalize(start):
out = ''
for char in start:
out += char.upper() if random.randrange(2) else char.lower()
return out
@oconnor663
oconnor663 / gist:8483257
Created January 17, 2014 22:59
stacktrace for fbmessenger QtWebKit crash
Program received signal SIGSEGV, Segmentation fault.
0x00007fff70176293 in ?? ()
(gdb) bt
#0 0x00007fff70176293 in ?? ()
#1 0x00007fffb5325700 in ?? ()
#2 0x00007fff4a9666c0 in ?? ()
#3 0x00007fff6d6713c0 in ?? ()
#4 0x00007fff558c3c38 in ?? ()
#5 0x00007fff700dcb37 in ?? ()
#6 0x00007fff6c771a80 in ?? ()
@oconnor663
oconnor663 / peru_1.0.md
Last active January 25, 2016 04:15
Peru 1.0

Getting peru to 1.0

The peru project has been stable for almost a year now, and it's time we made it official. One Point Oh. Here are some of the highlights from along the way.

Dropping the build field

One of the first features we added to peru was the build field.

@oconnor663
oconnor663 / gist:ea89a98244268e714760
Created March 2, 2016 18:37
example keybase.spec
Name: keybase
Version: 1.0.14.20160302153043.c4729c2
Release: 1
Summary: Keybase command line client
License: BSD
AutoReqProv: no
%description
Keybase command line client