Skip to content

Instantly share code, notes, and snippets.

package hookit
import (
"fmt"
)
// RunUserHook runs the user hook inside of the specified container
func RunUserHook(container, payload string) (string, error) {
// run the user hook
res, err := Exec(container, "user", payload, "info")
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
<% @push_routes.each do |route| %>
push "route <%= route[0] %> <%= route[1] %>"
<% end %>
@lyondhill
lyondhill / gist:4022886
Created November 6, 2012 06:00
how to run chef-solo
sudo mkdir /etc/chef/
# put cookbooks, roles and data bags in the directories shown below, feel free to change them to whatever works best for you.
cat > /etc/chef/solo.rb <<END
file_cache_path "/var/chef-solo"
cookbook_path "/var/chef-solo/cookbooks"
role_path "/var/chef-solo/roles"
data_bag_path "/var/chef-solo/data_bags"
END
[{"time":1349365950,"cpu":1.023609827005495,"mem":31.36618923611111,"load":0.1413333333333333},{"time":1349366850,"cpu":0.9689464219657371,"mem":25.61171875,"load":0.1386666666666667},{"time":1349367750,"cpu":0.897480560852073,"mem":22.651220703125,"load":0.1258333333333334},{"time":1349368650,"cpu":0.802767799418392,"mem":27.949951171875,"load":0.1085},{"time":1349369550,"cpu":0.9669437516320832,"mem":35.3376953125,"load":0.1585},{"time":1349370450,"cpu":1.309487675597507,"mem":33.56533203125,"load":0.2385},{"time":1349371350,"cpu":1.032110552501066,"mem":25.47293294270833,"load":0.1935000000000001},{"time":1349372250,"cpu":0.9762078623403134,"mem":26.76110026041667,"load":0.1086666666666666},{"time":1349373150,"cpu":1.164319768596801,"mem":28.40651041666667,"load":0.2251666666666667},{"time":1349374050,"cpu":1.173753341225291,"mem":23.91183268229167,"load":0.1866666666666667},{"time":1349374950,"cpu":1.010857319683317,"mem":29.17400716145833,"load":0.1403333333333333},{"time":1349375850,"cpu":1.183895309357

Things Andrew

  • First I would like a quick way archatechtural talk with big squares and circles and arrows
  • turn diagram into a walk through of the calls as it starts in a invoice sync
  • ::Pagoda::Landlord::App (line 124) is there a reason to use the result of the block to change the sum?

billable_components.inject(0) do |sum, component| amount = component.calculate_rent_on_processes(start_at, stop_at) if block_given?

<?php
/**
* Part of the Fuel framework.
*
* @package Fuel
* @version 1.0
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2012 Fuel Development Team
* @link http://fuelphp.com
@lyondhill
lyondhill / riak_sample.rb
Created June 27, 2012 19:48
I need help figureing out how to do this
# I have data that looks like this
{
timestamp: 123466 # unix timestamp since epoc
component: 'id1' # some unique id
processes: 'id2' # another unique id
cpu: 30 # a cpu usage statistic for the component/process
mem: 79 # a memory usange stat
}
worker1:
exec: QUEUE=default php /var/www/worker.php
start:
ready: ready to accept jobs
timeout: 10
exec: QUEUE=default php /var/www/worker.php
stop:
signal: QUIT
timeout: 60
exec: php /var/www/worker.php --quit-graceful
scale up
+> Booting web1.1
+> Building secure tunnel to component
- [16-Mar-2012 16:39:58] NOTICE: fpm is running, pid 54
- [16-Mar-2012 16:39:58] NOTICE: ready to handle connections
+> Booting web1.2
+> Building secure tunnel to component
- [16-Mar-2012 16:40:22] NOTICE: fpm is running, pid 54
- [16-Mar-2012 16:40:22] NOTICE: ready to handle connections
@lyondhill
lyondhill / options.txt
Created March 2, 2012 18:21
Options of Hierarchical analogy
1 Military
Battalion
Platoon
Squad
FireTeam
2 Biology
Kingdom
Phylem
Genis