- Chatham House Rule, so no attribution of ideas to people or companies
- bootstrapping environments (without object stores)
- service discovery
- removing spofs
alias code-check="find -E . -type f -regex '^.*\.(engine|inc|install|engine|module|php|profile|test|theme|txt|info|rule|view)' | xargs -Ifile bash -c \"php -l file ; (true)\" | grep -v 'No syntax' | |
find . -type f | xargs -Ifile grep -H '>>>>>>' file| grep -v Binary | grep -v .git/rr-cache" |
"UserData": { | |
"Fn::Base64": { "Fn::Join":["", [ | |
"#!/bin/bash -ex\n", | |
"apt-get update\n", | |
"apt-get -y install python-setuptools\n", | |
"mkdir aws-cfn-bootstrap-latest\n", | |
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
"easy_install aws-cfn-bootstrap-latest\n", | |
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
"\n", |
# check if job exists | |
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken | |
# with folder plugin | |
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken | |
# without folder plugin | |
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken | |
# create folder |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
package main | |
import ( | |
auth "github.com/abbot/go-http-auth" | |
"github.com/gorilla/mux" | |
"log" | |
"net/http" | |
"time" | |
) |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
require 'rubygems' | |
require 'eventmachine' | |
class Sender < EventMachine::Connection | |
attr_reader :connection | |
def initialize | |
@connection = EM.connect('127.0.0.1', 9797) | |
end |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |