Skip to content

Instantly share code, notes, and snippets.

View rjocoleman's full-sized avatar

Robert Coleman rjocoleman

  • Christchurch, New Zealand
View GitHub Profile
@rjocoleman
rjocoleman / Vagrantfile
Created February 22, 2014 20:17
Reproduce RHEL/Fedora slow DNS under virtualbox
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.box = 'opscode_centos-6.5'
# config.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box'
# config.vm.box = 'packer_centos-6.5'
/* GLOBAL NOTICES - _global-notices.scss */
.global-site-notice {
background-color: $alert-color;
.notice-inner {
p {
margin: 0 auto;
text-align: center;
color: white;
font-size: emCalc(13px);
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
#!/usr/bin/env bash
# Aliased as $ git c
# $ git config --global alias.c qa-checkout
# checks to see if checkout -b is happening
# if it is and it fails because the branch already exists
# prompt to delete the existing branch
if [[ $1 == '-b' ]]
then
@rjocoleman
rjocoleman / Capfile
Created April 24, 2014 20:33
Capistrano Slug basic config. Assumes that the AMI being launched includes webserver and directory set up already. With this config after Capistrano deploys it will take an archive of the current application directory. Use `user_data.sh` when starting your EC2 instance and it'll download the latest slug and extract it - assuming the rest of the …
set :application, 'foo-application'
set :deploy_to, '/var/www/foo-application'
set :slug_s3_bucket, 'capistrano-slug-bucket'
after 'deploy:finished', 'slug'
$ dig @ns1.google.com _spf.google.com TXT
; <<>> DiG 9.8.3-P1 <<>> @ns1.google.com _spf.google.com TXT
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42878
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
$ dig @ns1.p08.dynect.net zendesk1._domainkey.zendesk.com TXT
; <<>> DiG 9.8.3-P1 <<>> @ns1.p08.dynect.net zendesk1._domainkey.zendesk.com TXT
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1904
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0
;; WARNING: recursion requested but not available
Started POST "//api/factory-brand/subscribers" for 127.0.0.1 at 2014-05-27 12:16:54 +1200
Processing by API::SubscribersController#create_or_update as JSON
Parameters: {"subscriber"=>{"email"=>"a@monitorgd.com", "subscribe"=>""}, "brand_id"=>"factory-brand"}
Can't verify CSRF token authenticity
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
Brand Load (0.3ms) SELECT "brands".* FROM "brands" WHERE "brands"."slug" = 'factory-brand' ORDER BY "brands"."id" ASC LIMIT 1
SubscriberList Load (0.5ms) SELECT "subscriber_lists".* FROM "subscriber_lists" WHERE "subscriber_lists"."brand_id" = $1 AND "subscriber_lists"."archived" = 'f' AND "subscriber_lists"."slug" = '' ORDER BY "subscriber_lists"."id" ASC LIMIT 1˝˝[["brand_id", 1]]
Completed 404 Not Found in 10ms
ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound):
@rjocoleman
rjocoleman / foo.rb
Last active August 29, 2015 14:01
create_or_update
Started POST "//api/factory-brand/subscribers" for 127.0.0.1 at 2014-05-27 12:23:09 +1200
Processing by API::SubscribersController#create_or_update as JSON
Parameters: {"subscriber"=>{"email"=>"a@monitorgd.com", "subscribe"=>1}, "brand_id"=>"factory-brand"}
Can't verify CSRF token authenticity
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
Brand Load (0.6ms) SELECT "brands".* FROM "brands" WHERE "brands"."slug" = 'factory-brand' ORDER BY "brands"."id" ASC LIMIT 1
SubscriberList Load (0.3ms) SELECT "subscriber_lists".* FROM "subscriber_lists" WHERE "subscriber_lists"."brand_id" = $1 AND "subscriber_lists"."archived" = 'f' AND "subscriber_lists"."id" = $2 LIMIT 1 [["brand_id", 1], ["id", 1]]
(0.3ms) BEGIN
Subscription Exists (10.5ms) SELECT 1 AS one FROM "subscriptions" WHERE ("subscriptions"."subscriber_list_id" = 1 AND "subscriptions"."subscriber_id" IS NULL) LIMIT 1
Subscriber Exists (0.5ms) SELECT 1 AS one FROM "subscribers" WHERE ("sub
@rjocoleman
rjocoleman / untitled
Created May 27, 2014 01:24
ActionController::RoutingError
Started GET "//api/factory-brand/subscribers/" for 127.0.0.1 at 2014-05-27 13:22:32 +1200
ActionController::RoutingError (No route matches [GET] "/api/factory-brand/subscribers"):
actionpack (4.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `tagged'