Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
@jboone
jboone / morse_synth.py
Last active June 7, 2022 16:32
Morse code baseband file synthesizer for HackRF.
#!/usr/bin/env python
# Copyright (C) 2015 Jared Boone, ShareBrained Technology
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
@gbaman
gbaman / HowToOTG.md
Last active July 21, 2025 20:42
Simple guide for setting up OTG modes on the Raspberry Pi Zero

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

@achillean
achillean / gifcreator.py
Last active December 15, 2021 21:17
Create GIFs from a Shodan json.gz file using the API
#!/usr/bin/env python
# Dependencies:
# - arrow
# - shodan
# - ImageMagick
#
# Installation:
# sudo easy_install arrow shodan
# sudo apt-get install imagemagick
#
@vrunoa
vrunoa / logcat.log
Last active January 24, 2016 20:37
Compass Card fareboot log
Compass card (NXP MIFARE DESFire EV1)
application > 1 0 0
file no > 0
read data > 90 bd 0 0 7 0 0 0 0 0 0 0 0
result > 91 ae
Clipper card(MIFARE DESFire)
application > 90 11 f2
file no > 1
read data > 90 bd 0 0 7 1 0 0 0 0 0 0 0
FIR: Input Samplerate: 2000000, Output Samplerate: 500000, Signals: 100, Signal len: 29573
set_data: 0.01
set_center_freq: 0.01
dst.reset: 0.00
xlating_filter: 14.09
get_data: 1.58
misc: 0.02
signal_start: 0.93
fft: 1.46
shift_fft: 1.78
@mpj
mpj / monad-stream-example.js
Last active September 14, 2022 06:42
This is the code from Monads - episode #21 of FunFunFunction (https://www.youtube.com/playlist?list=PL0zVEGEvSaeFSwPn06GKArptSxiP1Gff8)
const fetch = require('node-fetch')
const Bacon = require('baconjs')
function getInPortuguese(word) {
// Google Translate API is a paid (but dirt cheap) service. This is my key
// and will be disabled by the time the video is out. To generate your own,
// go here: https://cloud.google.com/translate/v2/getting_started
const apiKey =
'AIzaSyB4DyRHIsNhogQXmH16YKbZfR-lTXrQpq0'
const url =
from PIL import Image
import struct
import sys
imgsize = 128
img = Image.new('L', (imgsize, imgsize))
with open("lily.cfile", "rb") as f:
while True:
@SyncChannel
SyncChannel / LoRaFW_IOX_BeaconMode.ino
Last active September 19, 2024 14:43
LoRa FeatherWing IOX Beacon Mode Example Program
/* LoRa FeatherWing IOX Beacon Mode Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Beacon Mode Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with Feather M0, 32U4, and HUZZAH ESP8266
* However, you only have one analog input on HUZZAH (1V input max!)
*
* This program configures the Feather as a transmit-only beacon. It transmits a payload of data
@SyncChannel
SyncChannel / LoRaFW_IOX_TransceiverMode.ino
Created March 17, 2016 01:15
LoRa FeatherWing IOX Tranceiver Mode Example Program
/* LoRa FeatherWing IOX Tranceiver Mode Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Tranceiver Mode Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with Feather M0, 32U4 and HUZZAH ESP8266
*
* This program configures the Feather as a LoRa receiver. It is intended as a companion
* to the LoRA FeatherWing Beacon Example Program, and can receive the beacon messages.
@SyncChannel
SyncChannel / LoRaFW_IOX_AdafruitIO_Gateway.ino
Created March 17, 2016 01:16
LoRa FeatherWing IOX Adafruit IO Gateway Example Program
/* LoRa FeatherWing IOX Adafruit IO Gateway Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Adafruit IO Gateway Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with HUZZAH ESP8266
*
* This program configures the Feather as a LoRa receiver and Adafruit IO Wi-Fi Gateway.
* It is intended as a companion to the LoRA FeatherWing IOX Beacon Example Program.