Skip to content

Instantly share code, notes, and snippets.

View andrewjbennett's full-sized avatar

Andrew Bennett andrewjbennett

View GitHub Profile
@andrewjbennett
andrewjbennett / MuseOSCProcessingDemo
Created October 1, 2014 04:49
A sample application written in Processing, which receives Muse data over OSC and displays a graph of the DSP'd brainwaves.
/*
* Muse FFT brainwave visualiser
* Written in Processing 2.2.1
* by Sarah Bennett (sarahb@cse.unsw.edu.au)
* 2014-10-01
*
* How to run:
* 1) Run muse-io, with the dsp output set, specifying a UDP port
* eg: ./muse-io --device 00:06:66:69:4F:8B --50hz --dsp --osc "osc.udp://localhost:5000"
* where --device is your Muse's mac address

Keybase proof

I hereby claim:

  • I am andrewjbennett on github.
  • I am andrewbennett (https://keybase.io/andrewbennett) on keybase.
  • I have a public key whose fingerprint is ED68 A13A F020 2442 641D 0B55 9301 1F5B 05A9 B3FA

To claim this, I am signing this object:

<p>
<a href="./Analysis/1">Week 1 | </a>
<a href="./Analysis/2">Week 2 | </a>
<a href="./Analysis/3">Week 3 | </a>
<a href="./Analysis/4">Week 4 | </a>
<a href="./Analysis/5">Week 5 | </a>
<a href="./Analysis/6">Week 6 | </a>
<a href="./Analysis/7">Week 7 | </a>
<a href="./Analysis/8">Week 8 | </a>
<a href="./Analysis/9">Week 9 | </a>
@andrewjbennett
andrewjbennett / zeosleep.py
Created October 1, 2012 06:37
zeo - draw graph of sleep/wake
import csv
import time
from matplotlib.pyplot import *
times0 = []
times1 = []
times2 = []
with open('zeodata.csv', 'rb') as csvfile:
zreader = csv.reader(csvfile, delimiter=',')
@andrewjbennett
andrewjbennett / illintentions.py
Created May 1, 2016 23:17
Code I wrote for Ill Intentions, full writeup coming soon
"""
The resources from the apk:
<resources>
<string name="android.permission._msg">Msg permission for this app</string>
<string name="app_name">SendAnIntentApplication</string>
<string name="dev_name">Leetdev</string>
<string name="flag">Qvq lbh guvax vg jbhyq or gung rnfl?</string>
<string name="git_user">l33tdev42</string>
<string name="str1">`wTtqnVfxfLtxKB}YWFqqnXaOIck`</string>
<string name="str2">IIjsWa}iy</string>
@andrewjbennett
andrewjbennett / vm-cc2650128-tixds110-connection.ccxml
Created July 30, 2016 07:32
Works for me in the provided VM
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="configuration_0">
<instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe">
<instance XML_version="1.2" href="drivers/tixds510icepick_c.xml" id="drivers" xml="tixds510icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cortexM.xml" id="drivers" xml="tixds510cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="4" id="SWD Mode Settings">
<choice Name="cJTAG (1149.7) 2-pin advanced mod
@andrewjbennett
andrewjbennett / starwars-contiki.c
Last active August 9, 2016 06:12
Star Wars for the TI SensorTag cc2650 on Contiki OS
/**
* \file
* Messing around with music
* \author
* Andrew Bennett <andrew.bennett@unsw.edu.au>
*/
#include "contiki.h"
#include "buzzer.h"
#include "dev/leds.h"
#define SONG_BPM 145
/*
// Track 3:
uint16_t notes[] = {
82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 123, 131, 147, 73, 73, 73, 110, 87, 65, 131, 131, 65, 98, 98, 123, 247, 247, 165, 208, 110, 165, 110, 165, 110, 165, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 220, 330, 220, 330, 220, 330, 220, 330, 208, 330, 208, 330, 208, 330, 208, 330, 82, 165, 82, 165, 82, 165, 82, 165, 110, 220, 110, 220, 110, 220, 110, 220, 104, 208, 104, 208, 82, 165, 82, 165, 110, 220,
@andrewjbennett
andrewjbennett / snip.sh
Created November 5, 2016 02:28
Takes a screenshot of a selected area, saves to file *and* copies to clipboard.
#!/bin/bash
# A script to take a screenshot, save to a file *and* copy to clipboard.
# Because gnome-screenshot can't do both.
# Assumes you have `gnome-screenshot` and `xclip` installed
# Andrew Bennett <andrew.bennett@unsw.edu.au> 2016-11-05
USERNAME=$(whoami)
@andrewjbennett
andrewjbennett / output.txt
Created November 9, 2016 11:04
pointer stuff: differences between char* and char[] when used as a stack variable
Looking at variable: str1[]
&str1[]: -> 0xfff42d72 (address)
str1[]: -> 0xfff42d72 (value)
*str1[]: -> 0x41 (dereference)
Looking at variable: str2[]
&str2[]: -> 0xfff42d77 (address)
str2[]: -> 0xfff42d77 (value)
*str2[]: -> 0x41 (dereference)
Looking at variable: strp1