Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
@gyaresu
gyaresu / gist:d095cefae8a2869cc6ef11567e4a27fb
Last active October 30, 2022 14:37
rfcat config - GFSK, Manchester encoded
YardStick One:
In [19]: print(conf)
00000000 (62) RadioConfig: RadioConfig
00000000 (01) sync1: 0x000000ee (238)
00000001 (01) sync0: 0x000000ee (238)
00000002 (01) pktlen: 0x0000003d (61)
00000003 (01) pktctrl1: 0x00000001 (1)
00000004 (01) pktctrl0: 0x00000005 (5)
00000005 (01) addr: 0x000000db (219)
@gyaresu
gyaresu / gist:8ec65881ef162bf879ec
Created May 23, 2015 22:23
How to catch a stream error (using through2)
var tr = require('through2')
function write(buffer, encoding, next) {
try {
this.push(buffer.toUpperCase()) //buffer needs .toString()
} catch (e) {
this.emit('error', e)
}
next()
}
@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>
# things and stuff
@gyaresu
gyaresu / example.py
Created April 27, 2018 00:42
Downloading a file with Selenium and Python
"""
Automatically downloading Excel file from a form.
Initially because accessing __doPostBack function was too hard to script in Python.
Software installed using conda and homebrew.
- selenium from conda
- geckodriver from homebrew
"""
import os
checking for bzero... yes
checking for clearenv... no
checking for copyfile... yes
checking for fgetln... yes
checking for flock... yes
checking for fls... yes
checking for kqueue... yes
checking for lockf... yes
checking for memset... yes
checking for posix_spawn... yes
from rflib import *
import time
d = RfCat()
def init(d):
d.setFreq(433955000)
d.setMdmModulation(MOD_ASK_OOK)
def run():
@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
λ sudo port install py27-pyusb
Password:
---> Computing dependencies for py27-pyusb
---> Fetching archive for py27-pyusb
---> Attempting to fetch py27-pyusb-1.0.0_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/py27-pyusb
---> Attempting to fetch py27-pyusb-1.0.0_0.darwin_16.x86_64.tbz2 from http://sea.us.packages.macports.org/macports/packages/py27-pyusb
---> Attempting to fetch py27-pyusb-1.0.0_0.darwin_16.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/py27-pyusb
---> Fetching distfiles for py27-pyusb
---> Verifying checksums for py27-pyusb
Error: Checksum (rmd160) mismatch for pyusb-1.0.0.tar.gz