Skip to content

Instantly share code, notes, and snippets.

View anoldguy's full-sized avatar

Nathan Anderson anoldguy

View GitHub Profile
@anoldguy
anoldguy / etcd2.log
Last active August 23, 2016 15:28
etcd auto join!
-- Logs begin at Tue 2016-08-23 14:13:04 UTC, end at Tue 2016-08-23 15:05:50 UTC. --
Aug 23 14:13:42 ip-10-111-13-245.ec2.internal systemd[1]: Stopped etcd2.
Aug 23 14:14:09 ip-10-111-13-245.ec2.internal systemd[1]: Starting etcd2...
Aug 23 14:14:12 ip-10-111-13-245.ec2.internal etcd2[1259]: recognized and used environment variable ETCD_ADVERTISE_CLIENT_URLS=http://10.111.13.245:2379
Aug 23 14:14:12 ip-10-111-13-245.ec2.internal etcd2[1259]: recognized and used environment variable ETCD_DATA_DIR=/var/lib/etcd2
Aug 23 14:14:12 ip-10-111-13-245.ec2.internal etcd2[1259]: recognized and used environment variable ETCD_ELECTION_TIMEOUT=1200
Aug 23 14:14:12 ip-10-111-13-245.ec2.internal etcd2[1259]: recognized and used environment variable ETCD_INITIAL_ADVERTISE_PEER_URLS=http://10.111.13.245:2380
Aug 23 14:14:12 ip-10-111-13-245.ec2.internal etcd2[1259]: recognized and used environment variable ETCD_INITIAL_CLUSTER=i-066bec7aa6a963d89=http://10.111.13.245:2380,i-0a83d3f217a063659=http://10.111.13.246:2380,i-0870117
class Notification
require 'aws-sdk'
require 'httparty'
attr_accessor :message_info, :verifier, :message_body
def initialize(message_body, logger)
@message_info = JSON.parse(message_body)
@message_body = message_body
@verifier = ::Aws::SNS::MessageVerifier.new
@logger = logger
variable "aws_region" {
description = "EC2 Region for the VPC"
default = "us-east-1"
}
variable "amis" {
description = "AMIs by region"
default = {
eu-west-1 = "ami-f1810f86" # ubuntu 14.04 LTS
}
@anoldguy
anoldguy / Whole Wheat Bread Recipe.txt
Created February 22, 2016 19:32 — forked from jamis/Whole Wheat Bread Recipe.txt
Jamis' recipe for homemade whole wheat bread
Jamis' Whole Wheat Bread
Ingredients
(Pardon the mixed metric/imperial units. I'm a product of my time.)
27 oz warm water
1 tbl shortening
2 tbl yeast (active dry or instant)
package main
import (
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/raspi"
"github.com/hybridgroup/gobot/api"
"log"
)
@anoldguy
anoldguy / fail.go
Last active December 22, 2015 20:18
package main
import (
"bufio"
"fmt"
"net"
)
func requestHandler(conn net.Conn) {
defer conn.Close()
@anoldguy
anoldguy / lookup.go
Last active December 21, 2015 20:17
package main
import (
"bufio"
"errors"
"fmt"
"log"
"net"
"strings"
)
@anoldguy
anoldguy / _fail.md
Last active December 21, 2015 15:08

Given the ruby code in the script, I would expect user.groups to be scoped by both of the deleted_at conditions. This was the behavior up thru Rails f55c60f. This was changed in bc6ac8 to fix a regression. This issue persists thru master.

Rails f55c60f

SELECT "groups".* 
FROM "groups" 
INNER JOIN "assignments" 
ON "groups"."id" = "assignments"."assignable_id" 
WHERE "assignments"."deleted_at" IS NULL -- This is the missing clause
AND "assignments"."user_id" = 1 
(function() {
var CalendarDate, RelativeTime, browserIsCompatible, domLoaded, iso8601, months, pad, parse, process, relativeDate, relativeTimeAgo, relativeTimeOrDate, relativeWeekday, run, strftime, update, weekdays;
browserIsCompatible = function() {
return document.querySelectorAll && document.addEventListener;
};
if (!browserIsCompatible()) {
return;
}

INGREDIENTS

  • 1/2 cup small-dice bacon (about 3 ounces)
  • 1/2 cup finely diced red onion (about 1/2 small onion)
  • 2 medium garlic cloves, finely chopped
  • 1 cup ketchup
  • 1/2 cup cider vinegar
  • 1/2 cup packed dark brown sugar
  • 1/4 cup Worcestershire sauce
  • 3 tablespoons bourbon
  • 2 tablespoons dark or robust molasses (not blackstrap)