Skip to content

Instantly share code, notes, and snippets.

View leighleighleigh's full-sized avatar

Leigh Oliver leighleighleigh

  • Ambit Robotics
  • Melbourne, Australia
  • 08:23 (UTC +10:00)
View GitHub Profile
@fsodogandji
fsodogandji / socat-tips.sh
Last active May 5, 2025 10:55
socat tips & tricks
#To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command.
socat TCP-LISTEN:8080 stdout
#use remotly a command shell
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt'
#sslify a server
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80
@Liryna
Liryna / ARMDebianUbuntu.md
Last active April 21, 2025 18:35
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@shovon
shovon / dft.js
Created December 4, 2014 01:11
Discrete Fourier Transform in JavaScript
function createComplex(real, imag) {
return {
real: real,
imag: imag
};
}
function dft(samples, inverse) {
var len = samples.length;
var arr = Array(len);
@bbx10
bbx10 / ESPWebSock.ino
Last active June 5, 2024 20:16
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@gbaman
gbaman / HowToOTGFast.md
Last active April 30, 2025 02:59
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@penguinpowernz
penguinpowernz / README.md
Last active January 4, 2025 03:40
WPA CLI commands
command args description
status [verbose] get current WPA/EAPOL/EAP status
ifname get current interface name
ping pings wpa_supplicant
relog re-open log-file (allow rolling logs)
note <text> add a note to wpa_supplicant debug log
mib get MIB variables (dot1x, dot11)
help [command] show usage help
interface [ifname] show interfaces/select interface
@0xjac
0xjac / private_fork.md
Last active May 5, 2025 18:19
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@nonsintetic
nonsintetic / ArduinoZeroTimer.ino
Last active January 11, 2025 06:52
SAMD21 Arduino Timer Example
/*
* This sketch illustrates how to set a timer on an SAMD21 based board in Arduino (Feather M0, Arduino Zero should work)
* It should generate a 1Hz square wave as it is (thanks richdrich for the suggestion)
* Some more info about Timer Counter works can be found in this article:
* http://www.lucadavidian.com/2017/08/08/arduino-m0-pro-il-sistema-di-clock/
* and in the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_DataSheet_DS40001882F.pdf
*/
uint32_t sampleRate = 1000; //sample rate in milliseconds, determines how often TC5_Handler is called
@adamar
adamar / client.py
Created April 6, 2017 06:37
Simple Websocket Client & Server Example (Python)
import websocket
import thread
import time
import sys
port = sys.argv[1]
def on_message(ws, message):
@NoraCodes
NoraCodes / esp8266_scan.ino
Last active October 18, 2022 10:35
Network scanner on ESP8266
/**
* ESP8266 Scanner - Scans for networks on the 2.4GHz band and prints them out to the console.
* Program it onto your ESP8266, pull up miniterm, the Serial Monitor, etc, and view a list of
* wireless networks on your computer.
* Requres Arduino JSON (http://arduinojson.org/), downloadable from Library Manager or GitHub.
* Or, set OUTPUT_JSON and consume the serial output with your favorite JSON parser.
*
* Created by Leonora Tindall in 2017 for the ESP8266.
* This software is licensed under the GNU General Public License, Version 3.0.
*/