Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
@gyaresu
gyaresu / clone-all.sh
Created September 21, 2015 03:59
Clone all repositories for a given username
curl -u [[MY_USERNAME]] -s https://api.github.com/users/[[TARGET_USERNAME]]/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@gyaresu
gyaresu / solution.py
Last active September 13, 2015 18:44
GSG SDR Lesson 6
from cmath import pi, e, log
tau = 2 * pi
def average(readings):
base = e ** (1j * tau / 360)
total = 0
for r in readings:
total += r[1] + base ** r[0]
result = total / len(readings)
return (log(result, base).real, abs(result))
@gyaresu
gyaresu / 390MHz.log
Last active September 11, 2015 14:02
rtl_433 attempting to decode a 390MHz 12 switch AM/OOK garage door
⇒ rtl_433 -a -f 390000000
p_limit: 418
bitbuffer:: Number of rows: 8
[00] {11} 6c c0 : 01101100 110
[01] {11} ab c0 : 10101011 110
[02] {11} 6c c0 : 01101100 110
[03] {11} ab c0 : 10101011 110
[04] {11} 6c c0 : 01101100 110
[05] {11} ab c0 : 10101011 110
@gyaresu
gyaresu / gootfet-bash.txt
Last active May 17, 2022 20:03
GoodFET failure
====== Inexplicably it just worked... I think. Those ff's are fairly ominous =====================
pentoo ~ # goodfet.bsl --dumpinfo > info.txt
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
pentoo ~ # cat info.txt
@gyaresu
gyaresu / HackRF-FM-Transmit.grc
Last active February 21, 2022 15:04
HackRF FM Transmit with GnuRadio
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.8'?>
<flow_graph>
<timestamp>Tue Aug 25 19:04:21 2015</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@gyaresu
gyaresu / find_system_python_dylibs.sh
Last active January 28, 2018 19:37 — forked from lokkju/find_system_python_dylibs.sh
This script prints the filenames of any libs in your /usr/local/lib that depend on the System Python. It is especially useful if you use a non-system Python, but have previously compiled extensions against the System Python - it will tell you which need to be recompiled.
#!/bin/bash
echo "This script prints the filenames of any dylibs in your /usr/local/ that depend on the System Python"
for f in `find /usr/local/lib`; do
otool -L "$f" 2> /dev/null| grep Python | grep System &> /dev/null
status=$?
if [ $status -eq 0 ]; then
echo "$status: $f"
fi
done
function mystery (input) { // input is passed in as 3
var secret = 4 // secret doesn't change in all of this. It stays as 4 and is used in the mystery2 function
input += 2 // 3 += 2 [input = input + 2] which is 5.
function mystery2 (multiplier) {
multiplier *= input /* multiplier = 6 * 5 : multiplier gets set when this returned function is
finally called as param(6) [after getting temporarily set as the variable `hidden`] */
return secret * multiplier // secret is still just 4 and multiplier is now 30 [6 * 5] from the line above.
}
return mystery2 // becomes variable `hidden` and then actually called as param(6)
}
@gyaresu
gyaresu / bots
Created July 25, 2015 20:25
bot servo test
var five = require('johnny-five')
var board = new five.Board()
board.on('ready', function () {
var servo = new five.Servo(9)
board.repl.inject({
servo: servo
})
gyaresu@shazbot:~/programming/projects/node-ardx|master⚡
⇒ node
> var five = require('johnny-five')
undefined
> var board = new five.Board()
undefined
> 1436405251015 Device(s) /dev/cu.usbmodem1411
/Users/gyaresu/programming/projects/node-ardx/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:584
this.transport.write(new Buffer([REPORT_VERSION]));
^
@gyaresu
gyaresu / gist:293494d52d15c43cc32e
Created July 9, 2015 00:55
Ardunio Uno firmata / johnny-five test `node code/CIRC01-code-led-a-strobe.js` fail
gyaresu@shazbot:~/programming/projects/node-ardx|master
⇒ node code/CIRC01-code-led-a-strobe.js
1436403241251 Device(s) /dev/cu.usbmodem1411
/Users/gyaresu/programming/projects/node-ardx/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:743
this.transport.write(new Buffer([START_SYSEX, CAPABILITY_QUERY, END_SYSEX]))
^
TypeError: undefined is not a function
at Board.queryCapabilities (/Users/gyaresu/programming/projects/node-ardx/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:743:18)
at null.<anonymous> (/Users/gyaresu/programming/projects/node-ardx/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:565:14)
at g (events.js:199:16)