Skip to content

Instantly share code, notes, and snippets.

/deis
/deis/logs
/deis/logs/host
/deis/logs/port
/deis/cache
/deis/cache/port
/deis/cache/host
/deis/controller
/deis/controller/port
/deis/controller/protocol
$ curl -k 'https://devops-web.demo.localflynn.com/' -D -
curl: (35) Server aborted the SSL handshake
$ flynn route
ROUTE SERVICE ID
https:devops-web.demo.localflynn.com devops-web-web http/77e595da631b53309cb428b26d27f598
$ curl -vk 'https://devops-web.demo.localflynn.com/' -D -
* Adding handle: conn: 0x7fcf91804000
* Adding handle: send: 0
$ flynn route add -c /Users/ianneub/Downloads/server.crt -k /Users/ianneub/Downloads/server.key devops-web.demo.localflynn.com
http/77e595da631b53309cb428b26d27f598
$ flynn route
ROUTE SERVICE ID
http:devops-web.demo.localflynn.com devops-web-web http/77e595da631b53309cb428b26d27f598
$ curl 'https://devops-web.demo.localflynn.com/' -D -
curl: (35) Server aborted the SSL handshake
$ flynn apps
ID NAME
af906746504042d5999d8135acda9a2a devops-web
b41affd16aec4a7d8ad06bc24b6f682c gitreceive
f3b9f6f7bb2e4b4d8e360752dc292aff router
7cca6ea4e74348d38ef88175d0119dae blobstore
f12a78c8df9c4d08b0ac5dc44ce4c2c2 postgres
e5eee5d32f1345ebb6c4de6220fc433f controller
$ flynn log f3b9f6f7bb2e4b4d8e360752dc292aff
func updateSQS(t time.Time) {
log.Println("Sending heartbeat to SQS")
// create the SQS client
client, err := sqs.NewFrom(os.Getenv("AWS_ACCESS_KEY_ID"), os.Getenv("AWS_SECRET_ACCESS_KEY"), "us.east")
if err != nil {
log.Println("ERROR:", err)
}
// fake an existing sqs.Message by creating it and setting the ReceiptHandle
@ianneub
ianneub / ssl.sh
Last active August 29, 2015 13:58
Create an SSL CSR and key in one command.
#!/bin/bash
if [ -z $1 ]
then
echo "You must set a domain name."
exit 1
fi
# generate a private key and CSR
openssl req -nodes -newkey rsa:2048 \
@ianneub
ianneub / dbclock.rb
Last active December 24, 2015 16:08
First attempt at a database backed clockwork scheduler. This was made against Rails 4 with a Job model that can be created like so: rails g model Job period:string name:string code:text See: https://github.com/tomykaira/clockwork/issues/25
# version 1
require 'clockwork'
require './config/boot'
require './config/environment'
module DBBackedClockwork
extend Clockwork
# add a periodic job to update @@events
@ianneub
ianneub / ec2.log
Created June 26, 2013 15:51
Comparing DNS checks when running `hostname -r` in both VPC and non-VPC EC2 instances.
Non - VPC
sudo tcpdump -nieth0 -s0 port 53
hostname -f
15:47:51.310998 IP 10.117.95.179.44198 > 172.16.0.23.53: 44142+ AAAA? ip-10-117-95-179.ec2.internal. (47)
15:47:51.311358 IP 172.16.0.23.53 > 10.117.95.179.44198: 44142 0/1/0 (108)
15:47:51.311785 IP 10.117.95.179.37773 > 172.16.0.23.53: 50187+ AAAA? ip-10-117-95-179. (34)
15:47:51.312091 IP 172.16.0.23.53 > 10.117.95.179.37773: 50187 NXDomain 0/1/0 (109)
15:47:51.312303 IP 10.117.95.179.57413 > 172.16.0.23.53: 3240+ A? ip-10-117-95-179.ec2.internal. (47)
15:47:51.312517 IP 172.16.0.23.53 > 10.117.95.179.57413: 3240 1/0/0 A 10.117.95.179 (63)
@ianneub
ianneub / console.log
Last active December 18, 2015 10:29
Error when installing vagrant-berkshelf on Windows XP SP3.
C:\Documents and Settings\Ian>vagrant plugin install vagrant-berkshelf
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
C:/HashiCorp/Vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:556:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/HashiCorp/Vagrant/embedded/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-i386-mingw32.def
compiling generator.c
@ianneub
ianneub / example.rb
Created December 9, 2012 02:56
Shopify API tweak to easily paginate API calls
ShopifyAPI::Customer.find_all do |customer|
# do something with the customer
end
ShopifyAPI::Order.find_all(:status => :any) do |order|
# do something with the order
end
ShopifyAPI::Product.find_all(:limit => 250) do |order|
# do something with the product