Skip to content

Instantly share code, notes, and snippets.

View cyphunk's full-sized avatar

Nathan Fain cyphunk

  • stage theatre + reverse engineering
View GitHub Profile
@cyphunk
cyphunk / heartbleed_osx_scan.py
Created April 9, 2014 15:10
Scan applications on OSX looking for any that include/link-to libssh
#!/usr/bin/env python
# Scan all OSX Applications and print when one links to
# libssl. Requires otool, codesign
import subprocess
import sys
import os.path
import re

Django Flat

I don't have the nuanced appreciation for constructs that force a workflow upon me. A little more love, a little less abstraction is what i say. Here is how i keep the django app-creep crap out, and keep it all a little more flat. Just add this to each of your model classes:

class Meta:
    app_label = 'website'

What people tell you to do with django is to create a 'site' and then create 'apps' for different elements of that site. So before you even start writing code you have this crap:

mysite/
@cyphunk
cyphunk / gcalcli.patch
Created May 12, 2015 10:21
provides start and end support for delete command
diff --git a/gcalcli b/gcalcli
index c063c97..960cd23 100755
--- a/gcalcli
+++ b/gcalcli
@@ -1760,13 +1760,13 @@ class gcalcli:
hLink = self._ShortenURL(newEvent['htmlLink'])
PrintMsg(CLR_GRN(), 'New event added: %s\n' % hLink)
- def DeleteEvents(self, searchText='', expert=False):
+ def DeleteEvents(self, searchText='', expert=False, start=None, end=None):
@cyphunk
cyphunk / simtrace_osx_install_howto.txt
Created November 16, 2011 15:12
Simtrace installation on OSX
sudo port install libusb
git clone git://git.osmocom.org/libosmocore.git
cd libosmocore/
autoreconf -i
./configure
# If you get the error message:
# utils.c:183: error: only weak aliases are supported in this configuration
# Change src/utils.c:183 to:
# __attribute__((weak, alias("osmo_hexdump_nospc")))
# Might not be a solution at all but the make will complete.
@cyphunk
cyphunk / Osmocom OSX 20120210.txt
Created February 10, 2012 12:01
Osmocom OSX 20120210
followed normal procedure from
http://bb.osmocom.org/trac/wiki/GettingStarted_osx
git clone git://git.osmocom.org/osmocom-bb.git
Current repository has a problem with some targets that do not have enough LRAM for
certain applications. During build the application that complained was rssi so for now
I skipped this by modifying src/target/firmware/Makefile:
#APPLICATIONS?=hello_world compal_dsp_dump layer1 loader chainload rssi
@cyphunk
cyphunk / wifikeep.scpt
Created February 13, 2012 19:38
Apple Wireless Refresh AppleScript
(* Wifikeep - Cycle a Apple Wireless connection. *)
-- Determine style of alert:
set useInvertScreen to true
set useBeepAlert to false
set useVoiceAlert to false
set useGrowlAlert to false -- only if you have growl installed
-- the following works for OSX 10.6.*:
set cyclewifi to "/usr/sbin/networksetup -setairportpower en1 off && /usr/sbin/networksetup -setairportpower en1 on"
@cyphunk
cyphunk / sh4crosscompile
Created May 27, 2012 23:55
superh sh4 crosscompile
Setting up a SH4 SuperH cross compilation environment with a couple pecularities. Mainly I want to cross compile for a much older system/target.
Workstation: Ubuntu 11.10
Target: sh4 gcc-3.3.6 glibc-2.2.5 kernel-2.4.20
ISSUE 1: *** These critical programs are missing or too old: gcc
To fix edit patches/glibc-2.2.5/glibc-2.2.5-allow-gcc-4.0-configure.patch to support he host gcc version.
ISSUE 2: "In function ‘open’, inlined from ‘collect_execute’ at"
More details:
@cyphunk
cyphunk / openwrttorcompile.md
Created June 10, 2012 12:16
OpenWRT Tor Backfire 10.03.1-rc4 r24045 compile procedures

I needed to update the tor revision that is available for an older installation of OpenWRT. The following are the procedures I used to build Tor for OpenWRT Backfire 10.03.1-rc4 r24045 using a OSX workstation.

OpenWRT build environment

The default FS configuration in OSX does not support case-sensitivity. Therefore we will download the SVN and all files onto a local sparse disk image we create with

hdiutil create -size 700m -type SPARSEBUNDLE -fs "Case-sensitive HFS+" -attach -nospotlight -volname openwrt_tor openwrt_tor
@cyphunk
cyphunk / pidginotr-linux-update.sh
Last active October 15, 2015 12:07
download and build latest pidgin, pidgin-otr.
#!/usr/bin/env bash
#otr: curl https://otr.cypherpunks.ca/gpgkey.asc | gpg --import
#pidgin: gpg --keyserver pgp.mit.edu --recv-key 0xA40AB77B
INSTALLPREFIX=/usr/local
SH_SOURCE=${BASH_SOURCE:-$_}
if readlink "$SH_SOURCE" >/dev/null 2>&1; then
cd "$(dirname $(readlink $SH_SOURCE))"
else
cd "$(dirname $SH_SOURCE)"
@cyphunk
cyphunk / pcb_align.md
Last active December 8, 2015 16:41
Methods for aligning images of PCB layers from a device

Aligning PCB Layers

Reverse engineering a device can be assisted by tracing lines that are exposed on the PCB. For complex tracing I have used depcb and for more simple tracing I use gimp. First the images of the PCB layers should be aligned with each other.