start new:
tmux
start new with session name:
tmux new -s myname
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils make | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
cd /opt | |
git clone https://github.com/joyent/node.git | |
cd node | |
git checkout v0.6 | |
./configure |
"""Reset admin password in Chef Server WebUI by removing admin user from DB""" | |
# based on http://lists.opscode.com/sympa/arc/chef/2011-08/msg00151.html | |
import urllib2 | |
import json | |
COUCHSERV = 'localhost:5984' | |
COUCHDB = 'http://' + COUCHSERV + '/chef/' |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
The problem is that some lines in the file are missing timestamps when they aren't continuations of any previous line. It's dumb, really.
The mysql query log is seriously bullshit format, but nothing logstash can't unscrew.
The main goal here is to show how we can fix the 'missing timestamp' problem.
% ruby bin/logstash agent -e '
Operation: Decouple whisper from graphite.
Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.
Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?
The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.
class NodeUpdateFromFile < ::Chef::Knife | |
deps do | |
require "chef/node" | |
require "chef/json_compat" | |
require "chef/knife/core/object_loader" | |
end | |
banner "knife node update from file FILE (options)" | |
def loader |
#!/usr/bin/env ruby | |
pid = Kernel.fork do | |
`#{ARGV.join(" ")}` | |
exit | |
end | |
trap(:CHLD) do | |
print "\n" | |
exit |
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
require 'guard/guard' | |
require 'mixlib/shellout' | |
module ::Guard | |
class Kitchen < ::Guard::Guard | |
def start | |
::Guard::UI.info("Guard::Kitchen is starting") |