Skip to content

Instantly share code, notes, and snippets.

@kgutwin
kgutwin / yt-autoskipper.url
Created October 30, 2023 13:40
YouTube automatic "ad skip" bookmarklet
javascript:(function()%7B!function()%7Bvar%20t%2Cn%2Ce%2Cr%3D%5B%22videoAdUiSkipButton%22%2C%22ytp-ad-skip-button%20ytp-button%22%2C%22ytp-ad-overlay-close-button%22%5D%3Bfunction%20o(t)%7Breturn%20null!%3D%3Dt.offsetParent%7Dfunction%20i()%7Bvar%20t%3B(t%3Dr%2Ct.map(t%3D%3EArray.from(document.getElementsByClassName(t))%7C%7C%5B%5D).reduce(function(t%2Cn)%7Breturn%20t.concat(n)%7D%2C%5B%5D)).forEach(t%3D%3E%7Bo(t)%3Fu(t)%3Afunction(t)%7Bif(t!%3D%3Dn)%7Bvar%20r%3Dfunction()%7Bfor(var%20n%3Dt%3Bnull!%3D%3Dn%3B)%7Bif(%22none%22%3D%3D%3Dn.style.display)return%20n%3Bn%3Dn.parentElement%7Dreturn%20null%7D()%3Br%26%26(e%26%26n%26%26(e.disconnect()%2Cu(n))%2Ce%7C%7C(e%3Dnew%20MutationObserver(function()%7Bo(n)%26%26(u(n)%2Cn%3Dvoid%200%2Ce.disconnect())%7D))%2Cn%3Dt%2Ce.observe(r%2C%7Battributes%3A!0%7D))%7D%7D(t)%7D)%7Dfunction%20u(t)%7Bif(%22function%22%3D%3Dtypeof%20t.fireEvent)t.fireEvent(%22onclick%22)%3Belse%20if(%22function%22%3D%3Dtypeof%20t.dispatchEvent)%7Bvar%20n%3Ddocument.createEvent(%22Events%22)%3Bn.in
@kgutwin
kgutwin / README.md
Last active July 25, 2023 18:19 — forked from mislav/config.json
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry

Using the GitHub CLI as a helper for authenticating Docker to ghcr.io

To install this, what worked for me:

  1. Install the GitHub CLI using whatever method works best for you; I used brew install gh.
  2. Authorize your local system with GitHub with the appropriate scopes:
gh auth refresh --scopes=read:packages,write:packages
@kgutwin
kgutwin / ecs-get-creds.sh
Last active March 2, 2021 16:44
Nextflow scaling test using AWS CloudShell
#!/bin/bash
mkdir -p ~/.aws
curl -s -H "Authorization: $AWS_CONTAINER_AUTHORIZATION_TOKEN" \
$AWS_CONTAINER_CREDENTIALS_FULL_URI \
| jq -r '["[default]", "aws_access_key_id = " + .AccessKeyId, "aws_secret_access_key = " + .SecretAccessKey, "aws_session_token = " + .Token] | join("\n")' \
> ~/.aws/credentials
@kgutwin
kgutwin / fahstatus.py
Last active March 23, 2020 16:07
FAH quick status
#!/usr/bin/env python2
'''
Folding@Home Client Control (FAHControl)
Copyright (C) 2010-2016 Stanford University
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 3 of the License, or
(at your option) any later version.
@kgutwin
kgutwin / tlatency.py
Created May 8, 2019 15:18
Terminal latency meter
#!/usr/bin/env python
import math
import time
import curses
def median(lst):
n = len(lst)
if n < 1:
@kgutwin
kgutwin / netspeed
Last active June 29, 2021 22:07
Simple Linux network speed monitor
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import time
import getopt
def usage():
print """Usage: %s [-d delay]
""" % sys.argv[0]
@kgutwin
kgutwin / README.md
Last active December 10, 2015 20:50 — forked from mbostock/.block
Scalable horizontal bar chart

Scalable Horizontal Bar chart

@kgutwin
kgutwin / make-ca.sh
Created June 30, 2015 15:23
Vault PKI testing script
#!/bin/bash
# taken from https://docs.docker.com/articles/https/
# you will have to enter a passphrase when prompted.
openssl genrsa -aes256 -out ca-key.pem 2048
openssl req -subj "/CN=$HOSTNAME" -new -x509 -days 365 -key ca-key.pem \
-sha256 -out ca.pem
#openssl genrsa -out server-key.pem 2048
#openssl req -subj "/CN=$HOSTNAME" -new -key server-key.pem -out server.csr
@kgutwin
kgutwin / make-ca.sh
Created June 30, 2015 12:47
cert-cli test scripts
#!/bin/bash
# taken from https://docs.docker.com/articles/https/
# you will have to enter a passphrase when prompted.
openssl genrsa -aes256 -out ca-key.pem 2048
openssl req -subj "/CN=$HOSTNAME" -new -x509 -days 365 -key ca-key.pem \
-sha256 -out ca.pem
openssl genrsa -out server-key.pem 2048
openssl req -subj "/CN=$HOSTNAME" -new -key server-key.pem -out server.csr