Skip to content

Instantly share code, notes, and snippets.

View obscurerichard's full-sized avatar
🎩
🧐💾🚴‍♂️🌱

Richard Bullington-McGuire obscurerichard

🎩
🧐💾🚴‍♂️🌱
View GitHub Profile
@obscurerichard
obscurerichard / get-sri.sh
Last active November 23, 2024 18:53
Subresource integrity bash scriptlet
#!/usr/bin/env bash
# Adapted from https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
# example code within which appears to be CC0 public domain. Likewise for this work:
# CC0: This work has been marked as dedicated to the public domain.
url=${1:-https://code.jquery.com/jquery-3.6.0.slim.min.js}
algo=${2:-sha384}
hash=$(curl -s "$url" | openssl dgst -"$algo" -binary | openssl base64 -A)
if grep -q css <<<"$url" >/dev/null 2>&1; then
out='<link rel="stylesheet" href="%s" integrity="%s-%s" crossorigin="anonymous">\n'
else
@obscurerichard
obscurerichard / Vagrantfile
Created June 20, 2023 00:17
Vagrantfile for Kali linux using Virtualbox
# Kali Vagrantfile
# Copyright (C) 2023 Richard Bullington-McGuire (@obscurerichard)
# MIT-0 Licensed - https://github.com/aws/mit-0
Vagrant.configure("2") do |config|
config.vm.box = "kalilinux/rolling"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "4096"
end

Keybase proof

I hereby claim:

  • I am obscurerichard on github.
  • I am obscurerichard (https://keybase.io/obscurerichard) on keybase.
  • I have a public key ASB1c7Ck0_HTF78ALj2EDoVX6sEBDj9xs37Be3p4pdXqjgo

To claim this, I am signing this object:

@obscurerichard
obscurerichard / transform-xml.ps1
Last active January 28, 2020 15:27 — forked from sayedihashimi/transform-xml.ps1
Script which can be used to transform an XML file using XDT. All you need to do is download the script and call it. The script will download the files it needs to run.
#!/usr/bin/env powershell
<#
.SYNOPSIS
You can use this script to easly transform any XML file using XDT.
To use this script you can just save it locally and execute it. The script
will download its dependencies automatically.
Adapted from: https://gist.github.com/sayedihashimi/f1fdc4bfba74d398ec5b
Thanks Stack Overflow: https://stackoverflow.com/questions/8989737/web-config-transforms-outside-of-microsoft-msbuild
#>
@obscurerichard
obscurerichard / pull-request-poetry.md
Last active March 26, 2021 15:19
pull-request-poetry.md

Pull request poetry

by Richard Bullington-McGuire richard@obscure.org @obscurerichard on GitHub and Twitter

Use these as comments in pull requests in order to charm the project owner into taking action on the pull request.

Initial ticklers

lonely pull request
the completist in me pines
for its prompt closure
@obscurerichard
obscurerichard / redis-scan.sh
Last active March 13, 2023 09:17 — forked from itamarhaber/scan_del.sh
A bash script that scans Redis keys by pattern using SCAN
#!/usr/bin/env bash
# redis-scan.sh
#
# Adapted by @obscurerichard from itamarhaber/scan_del.sh:
# https://gist.github.com/itamarhaber/11126830
#
# Thanks @czerasz and @tenlee2012 for fixes
#
# Usage:
# ./redis-scan.sh localhost 6378 0 '*test*'
@obscurerichard
obscurerichard / dedupe-cacerts.sh
Last active August 29, 2015 14:06
CA Certificate Bundle De-Duplication script
#!/bin/bash
# dedupe-cacerts.sh
#
# De-duplicates a certificate authority bundle, such as cacerts.pem
# or ca-bundle.crt. This will emit CA certificates in the order they
# appeared, annotating them with full info on each certificate,
# omitting any duplicate certificates.
#
# Usage:
#
@obscurerichard
obscurerichard / Miso Soup with Mushrooms.md
Last active November 23, 2024 18:08
Miso soup recipe with muchrooms

Miso Soup with Mushrooms

Serves 6

  • 8 cups water
  • 8 tsp instant vegan vegetable broth
  • 1 tsp onion powder
  • 1 pound firm tofu, cubed
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

@obscurerichard
obscurerichard / gist:3250991
Created August 3, 2012 20:02
Onqyl Rapelcgrq Snerjryy gb Oynpxfgbar Grpuabybtl Tebhc
Vg unf orra n cyrnfher jbexvat jvgu rirelbar ng Oynpxfgbar.
V pna or ernpurq ng evpuneq.ohyyvatgba.zpthver@tznvy.pbz.
V nz rnfl gb svaq, whfg Tbbtyr zl anzr, be rznvy zr ng
evpuneq.ohyyvatgba.zpthver@tznvy.pbz.
Vs lbh yvir yrff guna 5 zvyrf sebz lbhe wbo fvgr, pbafvqre ovxvat!
Qebc zr n yvar vs lbh znantr gb qrpbqr guvf zrffntr!