Skip to content

Instantly share code, notes, and snippets.

View grahamc's full-sized avatar
❄️

Graham Christensen grahamc

❄️
View GitHub Profile
@grahamc
grahamc / call.php
Created December 6, 2011 15:45
Robocall a whole bunch of people from PayPal about this Regretsy disaster.
<?php
// Note: CA state law says no robocalls before 9AM, so wait until 12PM EST.
$sid = 'Your SID';
$token = 'Your Token';
$telephoneNumber = 'Your Telephone Number, the one that Twilio gives you.';
$client = new Services_Twilio($sid, $token);
#!/bin/bash
knife search node "*:*" -a ec2.public_ipv4 | awk -f knife-output.awk
@grahamc
grahamc / emacs-init-as-a-package.nix
Created February 27, 2017 14:39
Package your user's emacs init.el etc. in to your nix emacs itself
{ pkgs ? import <nixpkgs> {} }:
let
emacsPackaging = pkgs.emacsPackagesNg;
my-mode = emacsPackaging.trivialBuild {
pname = "my-mode";
version = "1970-01-01";
src = pkgs.writeText "default.el" ''
(global-set-key (kbd "<end>") 'end-of-line)
(global-set-key (kbd "<home>") 'beginning-of-line)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Configures Energy Saver settings</string>
<key>PayloadDisplayName</key>
#!/bin/sh
set -eux
format() {
parted -s "$1" -- mklabel msdos
parted -s "$1" -- mkpart primary 1MiB 512MiB
parted -s "$1" -- set 1 boot on
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bind.dnsutils -p traceroute -p curl
# impure: needs ping
#source: https://s3.amazonaws.com/aws-cloudfront-testing/CustomerTesting.html
function _e {
echo "> $@"
eval "$@" 2>&1 | sed -e "s/^/ /"
printf "Exit: %s\n\n\n" "$?"
}
@grahamc
grahamc / catalina----- org.nixos.bootup.plist
Last active May 9, 2021 16:48
Dont delete this, I refer to it in some docs.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nixos.bootup</string>
<key>ProgramArguments</key>
<array>
<string>bash</string>
<string>/var/root/apply.sh</string>

Keybase proof

I hereby claim:

  • I am grahamc on github.
  • I am graham (https://keybase.io/graham) on keybase.
  • I have the public key with fingerprint BA94 FDF1 1DA4 0521 2864  C121 FE91 8C3A 98C1 030F

To claim this, I am signing this object:

@grahamc
grahamc / agency-codes.json
Last active August 7, 2019 11:35
Federal Reporting Agency Codes as a Service
{
"1200": "Department of Agriculture",
"1201": "Office of the Secretary of Agriculture",
"1203": "USDA, Office of the General Counsel",
"1204": "Office of the Inspector General",
"1205": "USDA, Office of the Chief Financial Officer",
"1208": "USDA, Office of Communications",
"1215": "USDA, Office of Operations",
"1260": "Commodity Credit Corporation",
"1261": "Rural Telephone Bank",
# Ordering Services
#
# Given a set of services, make them run one at a time in a specific
# order, on a timer.
let
lib = import <nixpkgs/lib>;
servicePrefix = "ordering-test-";
mkService = name: {
name = "${servicePrefix}${name}";