Skip to content

Instantly share code, notes, and snippets.

Gareth gyaresu

Block or report user

Report or block gyaresu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gyaresu
gyaresu / example.py
Created Apr 27, 2018
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 Nov 25, 2016 — 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 Apr 23, 2017
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
View gist:dee8095ab1c913ea39438d19a4185380
λ python
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Users/gyaresu/Library/Python/2.7/lib/python/site-packages/render-0.0.4-py2.7.egg', '/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.
You can’t perform that action at this time.