Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
@gyaresu
gyaresu / example.py
Created April 27, 2018 00:42
Downloading a file with Selenium and Python
View example.py
"""
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
View send.py
from rflib import *
import time
d = RfCat()
def init(d):
d.setFreq(433955000)
d.setMdmModulation(MOD_ASK_OOK)
def run():
View gist:de4ac3a0d98267dc2ec80152c5110131
λ 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
View gist:4969521b7255963d5bd3bc783ded7f05
$ 83 32 0A 00 E6 18 46 70 -> ?
$ 83 33 0A 80 01 70 40 12 -> ?
$ 83 33 0B 00 73 E6 25 0D -> ?
$ 83 33 0B 80 EF 25 E0 24 -> ?
$ 83 32 0C 00 60 A8 40 B8 -> ?
$ 83 33 0C 80 80 D2 AF 1A -> ?
$ 83 33 0D 00 22 EF 12 03 -> ?
$ 83 33 0D 80 10 67 78 58 -> ?
$ 83 32 0E 00 00 F5 83 E4 -> ?
$ 83 33 0E 80 03 48 EE F0 -> ?
@gyaresu
gyaresu / HowToOTG.md
Created November 25, 2016 19:49 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero
View HowToOTG.md

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

View extract_positions.sh
#!/bin/bash
cat $1 | grep IRA >> $1_positions.csv
sed -i -e 's/^.\+sat:/sat:/' -e 's/\( RAI\:.\+\)\|\(sat:\)\|\(beam:\)\|\(pos=(\)\|\()\)\|\(alt=\)\|\(+\)//g' -e 's%/%;%' -e 's/ /;/g' -e '/^00;00/d' -e '1 i\satellite;beam;latitude;longitude;altitude' $1_positions.csv
awk -F ';' '($5<=100){print}' $1_positions.csv >> $1_positions_spotbeams.csv
awk -F ';' '($5>100){print}' $1_positions.csv >> $1_positions_satellites.csv
@gyaresu
gyaresu / gist:d095cefae8a2869cc6ef11567e4a27fb
Last active October 30, 2022 14:37
rfcat config - GFSK, Manchester encoded
View gist:d095cefae8a2869cc6ef11567e4a27fb
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)
View gist:2b4443cd9a37b262a1e1acea23d07e40
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
View gist:0fb726fbb190123973866e041e6bce5e
alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit