Skip to content

Instantly share code, notes, and snippets.

View lrstanley's full-sized avatar
👋
Busy. All the time.

Liam Stanley lrstanley

👋
Busy. All the time.
View GitHub Profile
@lrstanley
lrstanley / selfupdate_example.go
Created May 14, 2023 15:18
Example of self-updating from a nexus repository
package main
import (
"context"
"crypto/tls"
"fmt"
"io"
"net/http"
"os"
"regexp"
Copyright (c) Liam Stanley <liam@liam.sh>. All rights reserved. Use of
this source code is governed by the MIT license that can be found in
the LICENSE file.
@lrstanley
lrstanley / yt_disable_watchlater_autoplay.js
Last active February 2, 2022 00:24
Voilent/Tamper/Grease Monkey scripts for YouTube
// ==UserScript==
// @name YouTube Disable Watch Later Autoplay
// @namespace lrstanley
// @match https://www.youtube.com/*
// @grant none
// @version 1.0.4
// @downloadURL https://gist.githubusercontent.com/lrstanley/789622b4c196c33d4e122bdc5d01da39/raw/yt_disable_watchlater_autoplay.js
// @updateURL https://gist.githubusercontent.com/lrstanley/789622b4c196c33d4e122bdc5d01da39/raw/yt_disable_watchlater_autoplay.js
// @author Liam Stanley
// @description This script disables the auto-play functionality for "Watch later" playlists. Watch later playlists ignore the user-configured auto-play option, so there is no way to disable it by default.
@lrstanley
lrstanley / sample-output.json
Created September 23, 2020 00:36
src-todo sample output
{
"results":{
"started_timestamp":"2020-09-22T20:35:44.0279098-04:00",
"completed_timestamp":"2020-09-22T20:35:44.4228067-04:00",
"clone_milliseconds":387,
"processing_milliseconds":6,
"log_output":"Enumerating objects: 33, done.\nCounting objects: 3% (1/33)\rCounting objects: 6% (2/33)\rCounting objects: 9% (3/33)\rCounting objects: 12% (4/33)\rCounting objects: 15% (5/33)\rCounting objects: 18% (6/33)\rCounting objects: 21% (7/33)\rCounting objects: 24% (8/33)\rCounting objects: 27% (9/33)\rCounting objects: 30% (10/33)\rCounting objects: 33% (11/33)\rCounting objects: 36% (12/33)\rCounting objects: 39% (13/33)\rCounting objects: 42% (14/33)\rCounting objects: 45% (15/33)\rCounting objects: 48% (16/33)\rCounting objects: 51% (17/33)\rCounting objects: 54% (18/33)\rCounting objects: 57% (19/33)\rCounting objects: 60% (20/33)\rCounting objects: 63% (21/33)\rCounting objects: 66% (22/33)\rCounting objects: 69% (23/33)\rCounting objects: 72%
@lrstanley
lrstanley / mysite.service
Created March 25, 2019 01:47
example simple systemd file (go sites?)
; can go in /etc/systemd/system/mysite.service
; make sure to:
; $ systemctl enable <app>
; $ systemctl start <app>
[Unit]
Description=mysite
Wants=network-online.target
After=network-online.target
[Service]
@lrstanley
lrstanley / ddns.sh
Created December 10, 2018 05:31
Simple Cloudflare DDNS (Dynamic DNS) updating script in bash
#!/bin/bash
# Copyright (c) 2018 Liam Stanley <me@liamstanley.io>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@lrstanley
lrstanley / twss.json
Created June 8, 2018 01:08
TWSS entries for Code (Python IRC bot)
{"lines": ["why the fck would you pull out right when im coming", "come on guys 69 isnt even that hard someone do 69 infront of the class now", "hes not going to be able to get in the backdoor theres a stool in the way", "just no matter what keep making me take it even if you have to shove it down my throat", "make sure your grip on the shaft is tight and your strokes long and hard", "would you like the black one or the white one she answered it doesnt matter ill suck on both", "you have to go in hard and come out wet and breathless youll feel good when youre done", "i was lying on my back in bed playing with it and it exploded in my face", "best 4 inches ever", "hurry up its getting hard its getting hard without thinking i respond im trying but its getting all over my hands", "i cant go 2 minutes without getting railed from behind", "god i love cox", "its so awkward i hate how he always tries to have a conversation with me while hes in my mouth", "if you play with it in front of me im going to want to touch
@lrstanley
lrstanley / github-backup.sh
Created June 6, 2018 23:53
GitHub backup script, which utilizes python-github-backup
#!/bin/bash
USER="${1:?usage: $0 <user> <archive>}"
ARCHIVE_LOC="${2:?usage: $0 <user> <archive>}"
which github-backup > /dev/null 2>&1 || pip install github-backup
if [ -z "$GH_BACKUP_TOKEN" ];then
echo 'missing $GH_BACKUP_TOKEN...'
exit 1

Keybase proof

I hereby claim:

  • I am lrstanley on github.
  • I am lstanley (https://keybase.io/lstanley) on keybase.
  • I have a public key ASDXjT2anLGva2hcUOnyRZQokE_fN-yT1n66GzU3pPy6jgo

To claim this, I am signing this object:

@lrstanley
lrstanley / exiclean-old.py
Created June 25, 2016 19:15
Old Exiclean version, in Python. Here for reference.
#!/usr/bin/python
"""
Exiclean -- Exim mail queue cleaner/spam removal script
-----------------------------------------------------------------------------
LICENSE: The MIT License (MIT)
Copyright (c) 2016 Liam Stanley <me@liamstanley.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal