Skip to content

Instantly share code, notes, and snippets.

View johnclaus's full-sized avatar

John Claus johnclaus

  • The Front Range
View GitHub Profile
@johnclaus
johnclaus / github-pages-custom-domain-gandi-dns-records.md
Created February 6, 2024 17:04 — forked from matt-bailey/github-pages-custom-domain-gandi-dns-records.md
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
@johnclaus
johnclaus / aws_glacier_delete_vault.md
Created April 13, 2021 18:07 — forked from veuncent/aws_glacier_delete_vault.md
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@johnclaus
johnclaus / NetflixBookmarks.html
Created February 1, 2016 10:02 — forked from thauber/NetflixBookmarks.html
Chrome: Download this file. Then in chrome select Hamburger Menu > Bookmarks > Bookmark Manager. Click on the Chevron next to "Organize" then select "Import Bookmarks from HTML File...". Select the the downloaded version of this gist. It will create a folder called "Imported". Rename it to "Netflix" and move it where ever you would like.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A ADD_DATE="1452301889" HREF="http://netflix.com/browse/genre/1365">Action & Adventure</A>
<DT><A ADD_DATE="1452301889" HREF="http://netflix.com/browse/genre/43040">Action Comedies</A>
#!/bin/sh
VERSION="7u67"
BUILD="betable1"
set -e -x
# Keep track of the original working directory.
OLDESTPWD="$PWD"
@johnclaus
johnclaus / graphite-deb.sh
Created December 10, 2015 21:07 — forked from rcrowley/graphite-deb.sh
Graphite Debian packaging
VERSION="0.9.9"
BUILD="betable1"
set -e -x
# Keep track of the original working directory.
OLDESTPWD="$PWD"
# Work in a temporary directory.
cd "$(mktemp -d)"
@johnclaus
johnclaus / sorts.md
Last active August 29, 2015 14:21 — forked from twotwotwo/sorts.md

github.com/twotwotwo/sorts is a Go package with parallel radix- and quicksorts. It can run up to 5x faster than stdlib sort on the right sort of large sort task, so it could be useful for analysis and indexing/database-y work in which you have to sort millions of items. (To be clear, I don't recommend most folks drop stdlib sort, which is great, and which sorts depends on.)

While the process of writing it's fresh on my mind, here are some technical details, some things that didn't make the cut, and some thoughts about the process:

Concretely, what this looks like inside:

  • Both number and string versions are in-place MSD radix sorts that look at a byte at a time and, once the range being sorted gets down to 128 items, call (essentially) the stdlib's quicksort.

  • The [parallelization code

@johnclaus
johnclaus / deferrals.go
Last active August 29, 2015 14:18
Deferred closure execution within a loop
package main
import (
"fmt"
"time"
)
func increment(val *int) {
defer func() {
fmt.Println(time.Now(), ": Pre-increment: ", *val)

Keybase proof

I hereby claim:

  • I am johnclaus on github.
  • I am john (https://keybase.io/john) on keybase.
  • I have a public key whose fingerprint is 68B4 D5C0 A472 7DEA 09AA D712 3140 0C9B 3A4F 753B

To claim this, I am signing this object:

Writing Bug-Free Chef Recipes

Chef has unique abstraction and processing models. Until you understand them, it is easy to write buggy recipes.

The most important thing to understand is the following: a Chef recipe is not a collection of scripts.

Chef Processing Model