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 / 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-osx.md
Last active March 10, 2016 11:18
install latest pidgin with OTR support, from source on OSX

Pidgin+OTR OSX

Auto download,verify,compile script for Linux may work for OSX as well:
https://gist.github.com/cyphunk/d6af7a0a56b0b3d26e60

update: updated to pidgin 2.10.11. update: updated to pidgin 2.10.9. update: updated to pidgin 2.10.8. Downloaded from source since current brew does not support and there are way too many brew related dependencies to deal with to merge a new formula.

@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 / v_gt_r.py
Last active May 13, 2021 10:57
is_violence_gt_resistance.py 2015 [edit 2019: does this RAND data show that one party has strategic gain by hurting themselves?]
#!/usr/bin/env python
"""
http://www.rand.org/international/cmepp/costs-of-conflict/calculator.html
(archive: https://cypherpoet.com/rand.org_costs-of-conflict/)
Numbers based on defaults provided in rand.org scenarios. They intended
to show what Israel or PA have to gain from peace, but did not notice how
their data makes violence appear even closer.
Addition 2019: for a more verbose description and interpretation of this
data see the comment at end of file.