Skip to content

Instantly share code, notes, and snippets.

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

Richard Bullington-McGuire obscurerichard

🎩
🧐💾🚴‍♂️🌱
View GitHub Profile
@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 / gist:1112634
Created July 28, 2011 21:37
Vagrant 0.8.2 Windows 7 x86_64 JRuby 1.6.3 'vagrant up' stack trace
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
PROGID: VirtualBox.VirtualBox
PROGID: VirtualBox.Session
[default] Importing base box 'lucid32'...
VariantUtilities.java:54:in `createVariant': java.lang.RuntimeException: createVariant() not implemented for class org.jruby.RubyArray
from VariantUtilities.java:115:in `objectToVariant'
from VariantUtilities.java:134:in `objectsToVariants'
from Dispatch.java:149:in `vargs'
@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!
@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 / 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*'

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 / 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
@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 / 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 / protect-conda-base.sh
Last active December 14, 2024 01:43
Protect the anaconda base environment from accidental installs
# protect-conda-base.sh
#
# If you use Anaconda, it is really easy to accidentally install packages
# into the base environment. Head that off at the pass.
# However, allow installs in a pip virtual environment.
#
# Allow for an override if you run these commands with a CONDA_PROMPT_OVERRIDE variable set,
# as in:
#
# CONDA_PROMPT_OVERRIDE pip install powerline-shell