Skip to content

Instantly share code, notes, and snippets.

View lmorchard's full-sized avatar
😅
drinking from multiple firehoses

Les Orchard lmorchard

😅
drinking from multiple firehoses
View GitHub Profile
@lmorchard
lmorchard / cloudfront_processor.py
Created June 4, 2025 22:56
Quick python script to download CloudFront logs from an S3 bucket and submit them to Loki
#!/usr/bin/env python3
"""
CloudFront to Loki Log Processor
This script downloads new CloudFront logs from S3 and pushes them to Loki.
It tracks processed files to avoid duplicates and filters for 404 responses.
"""
import boto3
import gzip
@lmorchard
lmorchard / substack-to-opml.js
Last active April 29, 2025 08:19
Substack to OPML export
// To use this script:
//
// 1. Copy this whole gist
// 2. Log into your account on substack.com
// 3. On a substack.com page, open the JavaScript console in your browser's web dev tools
// 4. Paste this into the console and hit return.
// 5. You should see substack-publications.opml has been downloaded.
//
// If you'd like to grab this code and improve it or turn it into a better tool, go right ahead!
// Maybe drop me a toot at @[email protected] or @[email protected] if you liked it.
@lmorchard
lmorchard / Dockerfile
Created February 27, 2023 03:34
Dockerfile extending bbsio/synchronet to add DOSEMU
FROM bbsio/synchronet:latest
ARG DOSEMU_DEB_URL=http://ftp.us.debian.org/debian/pool/contrib/d/dosemu/dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
ARG DOSEMU_DEB=dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
RUN apt-get update \
&& apt-get install -y rsh-redone-client locales locales-all \
mtools dosfstools dos2unix ser2net socat
ENV USER=root LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
@lmorchard
lmorchard / hub-of-awesome.md
Created January 31, 2023 19:30
Hub of Awesome (2012 Feb)

Hub of Awesome (2012 Feb)

by Les Orchard [email protected]

Overview

People access the internet through a growing variety of devices, and many people use many devices. And, largely, those devices coordinate through the cloud.

@lmorchard
lmorchard / hub-of-awesome.md
Created January 13, 2020 20:47
Hub of Awesome (decafbad.com/2012/02/hub-of-awesome.md)

Hub of Awesome

by Les Orchard [email protected]

Overview

People access the internet through a growing variety of devices, and many people use many devices. And, largely, those devices coordinate through the cloud.

@lmorchard
lmorchard / window-follow.ahk
Last active January 29, 2019 19:35
Use AutoHotKey to move an OBS display capture source around to track the current window
#NoEnv
SetBatchLines, -1
; https://github.com/G33kDude/WebSocket.ahk
#Include ./WebSocket.ahk
sceneName := "Show desktop follow"
sourceName := "Desktop"
scale := 0.75
sourceWidth := 1455
sourceHeight := 1080
@lmorchard
lmorchard / obs-mouse-follow.ahk
Created January 25, 2019 22:35
Mouse tracking AutoHotKey script
; Key on mouse region change
!^+v::
ToolTip, start
SetTimer, CheckMouseRegion, 2000
return
!^+b::
ToolTip, stop
SetTimer, CheckMouseRegion, off
return
@lmorchard
lmorchard / package.json
Created March 7, 2018 19:44
Using npm-run-all --parallel in npm scripts
"scripts": {
"start": "npm-run-all --parallel server watch:extension watch:lint",
"server": "cross-env NODE_ENV=development webpack-dev-server --config webpack.web.js",
"watch": "npm-run-all --parallel watch:*",
"watch:web": "cross-env NODE_ENV=development webpack --watch --progress --colors --config webpack.web.js",
"watch:extension": "cross-env NODE_ENV=development webpack --watch --progress --colors --config webpack.extension.js",
"watch:lint": "onchange -p -v \"src/**/*.js\" -- npm run lint",
"lint": "eslint --color .",
},
@lmorchard
lmorchard / index.js
Created March 7, 2018 19:42
Hacky loader that waits until initial Redux store changes settle down
const unsubscribeLoader = store.subscribe(() => {
if (selectors.loaderDelayExpired(store.getState())) {
// State settled down long enough for timer to expire - stop listening.
unsubscribeLoader();
} else {
// Reset the timer again.
startLoaderDelay();
}
});
@lmorchard
lmorchard / index.js
Created March 7, 2018 19:41
Redux middleware sending messages to add-on on state changes
const postMessage = (type, data = {}) =>
window.postMessage(
{ ...data, type, channel: `${CHANNEL_NAME}-extension` },
"*"
);
const updateExtensionThemeMiddleware = ({ getState }) => next => action => {
const returnValue = next(action);
const meta = action.meta || {};
if (!meta.skipAddon && themeChangeActions.includes(action.type)) {