Skip to content

Instantly share code, notes, and snippets.

View robbiet480's full-sized avatar
😩
terminally online

Robbie Trencheny robbiet480

😩
terminally online
View GitHub Profile
// Delete webhooks created by Real Artists Ship
// Author: Robbie Trencheny
// License: MIT
// Run npm install github first
// Must set GITHUB_TOKEN environment variable
var GitHubApi = require("github");
var github = new GitHubApi();
@robbiet480
robbiet480 / AWSRegionType+Helpers.swift
Last active November 16, 2020 10:00
Extensions to AWSRegionType to turn a string into a region name and lookup simple information about a region
import AWSCore
extension AWSRegionType {
/**
Return an AWSRegionType for the given string
- Parameter regionString: The Region name (e.g. us-east-1) as a string
- Returns: A new AWSRegionType for the given string, Unknown if no region was found.
server {
listen 80;
server_name yournamehere.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name yournamehere.com;
@robbiet480
robbiet480 / README.md
Last active October 23, 2019 18:13
A consul-template plugin to get EC2 metadata

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples

@robbiet480
robbiet480 / delete_all.js
Created April 28, 2015 20:46
Hacky code to delete all records in a Route53 zone using the aws-sdk module
var _ = require('lodash')
, async = require('async')
, AWS = require('aws-sdk')
, route53 = new AWS.Route53({apiVersion: '2013-04-01'});
var allRecords = [];
var IsTruncated = true;
var NextRecordName = "";
var zoneId = "<YOUR ZONE ID>";
var listParams = {
HostedZoneId: zoneId
@robbiet480
robbiet480 / MapJamSPFRecord.txt
Last active August 29, 2015 14:13
MapJam SPF Record
"v=spf1 a include:_spf.google.com include:servers.mcsv.net include:_spf.zdsys.com include:spf.mail.intercom.io ~all"
Anonymous UUID: AD0ECB8F-EA80-46F8-B10F-95ABF19F0E3E
Fri Dec 26 21:22:47 2014
*** Panic Report ***
panic(cpu 3 caller 0xffffff800a41e80a): Kernel trap at 0xffffff7f8c6f92b4, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0x0000000000000000, CR3: 0x0000000047c68040, CR4: 0x00000000001626e0
RAX: 0x0000000000000000, RBX: 0x00000000fffa0bf4, RCX: 0xffffff811506b580, RDX: 0x0000000000000000
RSP: 0xffffff811506b580, RBP: 0xffffff811506b670, RSI: 0x0000000000000002, RDI: 0x0000000000000306
R8: 0xffffff811506b6a0, R9: 0xffffff811506b4b8, R10: 0x0000000000000000, R11: 0x000006532282626b

Keybase proof

I hereby claim:

  • I am robbiet480 on github.
  • I am robbiet (https://keybase.io/robbiet) on keybase.
  • I have a public key whose fingerprint is 1811 38D3 8B15 8624 904E 9774 E30E 17CB 4ADC EB8B

To claim this, I am signing this object:

@robbiet480
robbiet480 / geofency-foursquare.php
Created December 10, 2014 21:34
This is a simple PHP script that will let you automatically check into Foursquare venues based on your GeoFency bounds.
<?php
$accesstoken = "oAuth Access Token from Foursquare";
$loc = $_REQUEST['id'];
// Just add a switch case for every venue you want to check into
// Use something like requestb.in to find the location id
// Paste it into the case, and then paste the Foursquare/Swarm venue ID
switch($loc) {
case '2FB4E2F2-34E7-4B73-A553-9BCC1C1204CF':
// Home
$venueid = "4c4a689542b4d13a23ba297d";
core@ip-10-21-1-72 ~ $ fleetctl list-machines
2014/12/05 21:36:24 INFO client.go:278: Failed getting response from http://127.0.0.1:4001/: dial tcp 127.0.0.1:4001: connection refused
2014/12/05 21:36:24 ERROR client.go:200: Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 100ms
2014/12/05 21:36:24 INFO client.go:278: Failed getting response from http://127.0.0.1:4001/: dial tcp 127.0.0.1:4001: connection refused
2014/12/05 21:36:24 ERROR client.go:200: Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 200ms
2014/12/05 21:36:25 INFO client.go:278: Failed getting response from http://127.0.0.1:4001/: dial tcp 127.0.0.1:4001: connection refused
2014/12/05 21:36:25 ERROR client.go:200: Unable to get result for {Get /_coreos.com/fleet/machines}, retrying in 400ms
2014/12/05 21:36:25 INFO client.go:278: Failed getting response from http://127.0.0.1:4001/: dial tcp 127.0.0.1:4001: connection refused
2014/12/05 21:36:25 ERROR client.go:200: Unable to get result for {Get /_