start new:
tmux
start new with session name:
tmux new -s myname
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |
build | |
Builds a job, and optionally waits until its completion. | |
cancel-quiet-down | |
Cancel the effect of the "quiet-down" command. | |
clear-queue | |
Clears the build queue | |
connect-node | |
Reconnect to a node | |
copy-job | |
Copies a job. |
source :rubygems | |
gem 'json', '= 1.5.4' # knife/chef 11.0 and 11.20 is broken with json 1.5.5/1.7.7 | |
gem 'vagrant' | |
gem 'vagrant-hostmaster' |
require 'watir-webdriver' | |
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36") | |
driver = Selenium::WebDriver.for :phantomjs, :desired_capabilities => capabilities | |
browser = ::Watir::Browser.new driver | |
# Quick test to make sure it's set | |
browser.goto 'http://www.useragentstring.com/' | |
browser.textarea(:id => "uas_textfeld").value |
What this guide will cover: the code you will need in order to include Redis and Resque in your Rails app, and the process of creating a background job with Resque.
What this guide will not cover: installing Ruby, Rails, or Redis.
Note: As of this writing I am still using Ruby 1.9.3p374, Rails 3.2.13, Redis 2.6.11, and Resque 1.24.1. I use SQLite in development and Postgres in production.
Background jobs are frustrating if you've never dealt with them before. Over the past few weeks I've had to incorporate Redis and Resque into my projects in various ways and every bit of progress I made was very painful. There are many 'gotchas' when it comes to background workers, and documentation tends to be outdated or scattered at best.
There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.
To get Chef working properly on your local machine you need a few things.
Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.
#!/bin/bash | |
# Origianl version : http://www.keepthingssimple.net/2012/10/creating-requests-per-time-graph-from-nginx-or-apache-access-log/ | |
# This version is a port to Mac OSX | |
# dreampuf (http://huangx.in) | |
# useage : | |
# graphit.sh logfile.log | |
# open result-2013-06-04.png |
Press minus + shift + s
and return
to chop/fold long lines!