Skip to content

Instantly share code, notes, and snippets.

View leighleighleigh's full-sized avatar

Leigh Oliver leighleighleigh

  • Ambit Robotics
  • Melbourne, Australia
  • 03:46 (UTC +10:00)
View GitHub Profile
@leighleighleigh
leighleighleigh / favs.txt
Last active June 12, 2017 04:51
Some of my favourite comments from the Apollo 11 Source Code
# ****************************************************************************
# TRASHY LITTLE SUBROUTINES
# ****************************************************************************
# ASTRONAUT: PLEASE CRANK THE
# SILLY THING AROUND
# OFF TO SEE THE WIZARD ...
# PROCEED SEE IF HE'S LYING
@leighleighleigh
leighleighleigh / gpio_read_reg.ino
Created September 20, 2018 06:46
An example of using a GPIO input register to read pin inputs on NodeMCU (esp8266 based) board.
// Our super ultra fast input register
#define GPIO_IN READ_PERI_REG(0x60000318)
#define CHAN0 D1
#define CHAN1 D2
#define CHAN2 D3
#define CHAN3 D4
#define CHAN4 D5
void setup()
#!/usr/bin/python3
import dbus, dbus.mainloop.glib, sys
from gi.repository import GLib
import datetime
from math import floor
track_dur = 0
def on_property_changed(interface, changed, invalidated):
global track_dur
@leighleighleigh
leighleighleigh / auto_rotate.sh
Last active November 2, 2020 12:32 — forked from Links2004/auto_rotate.sh
Linux auto rotate screen and adjust touch matrix based on accelerometer data
#!/bin/bash
# Auto rotate screen based on device orientation
# based on https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
# install
# 1. apt-get install iio-sensor-proxy inotify-tools
# 2. add script to autostart
# Receives input from monitor-sensor (part of iio-sensor-proxy package)
# Screen orientation and launcher location is set based upon accelerometer position
@leighleighleigh
leighleighleigh / svgbob_live.sh
Created December 18, 2022 05:57
svgbob_live.sh - live preview of ASCII diagrams as SVG using svgbob
#!/usr/bin/env bash
### svgbob live preview ###
# DESCRIPTION
# Runs svgbob_cli whenever a file is changed (specified at launch)
# and open it with eog (eye of gnome)
# AUTHOR
# Leigh Oliver, 18/12/2022
# USAGE
@leighleighleigh
leighleighleigh / ghidra_bulk_import.sh
Last active February 9, 2025 08:15
Ghidra bulk file import with dynamic library search for portable executable files
#!/usr/bin/env bash
### Ghidra project bulk file import with DLL library resolution
### Warning, this file takes bloody ages to run! (40 minutes for 140 files)
### ... but it's still faster than using the GUI!
### Leigh Oliver 23rd September 2024
###
### EXAMPLE USAGE
# Import one file...
# ./import.sh ./MyProject.gpr ./coredll.dll
# Import a list of files...