I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
module God | |
module Conditions | |
class RestartFileTouched < PollCondition | |
attr_accessor :restart_file | |
def initialize | |
super | |
end | |
def process_start_time | |
Time.parse(`ps -o lstart -p #{self.watch.pid} --no-heading`) |
# Ruby 1.8 | |
m { } | |
arity: -1 | |
proc call arg check: no | |
wraps values: n/a | |
m { || } | |
arity: 0 | |
proc call arg check: yes, 0 |
# THANKS EVERYONE FOR YOUR BELOVED BENCHMARKS. | |
# THIS PATCH IS NOW IN RAILS: | |
# | |
# https://github.com/rails/rails/commit/885a599303585b796da7a0a1c3ccd0bc5c642134 | |
# Please add the following lines after Bundler.require | |
# and before "class Application < Rails::Application" | |
# in your config/application.rb | |
# | |
# Notice this is just an experiment, don't leave those |
(ns queries.postgres | |
(:gen-class) | |
(:require [cascalog.ops :as c]) | |
(:use [cascalog.api]) | |
(:import [com.twitter.maple.jdbc JDBCTap JDBCScheme TableDesc] | |
[cascading.tap.SinkMode])) | |
(defn db-tap [table] | |
(let [tap (com.twitter.maple.jdbc.JDBCTap. | |
"jdbc:postgresql://my-db-uri?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory" |
#!/usr/bin/env ruby -w | |
# brew-services(1) - Easily start and stop formulas via launchctl | |
# =============================================================== | |
# | |
# ## SYNOPSIS | |
# | |
# [<sudo>] `brew services` `list`<br> | |
# [<sudo>] `brew services` `restart` <formula><br> | |
# [<sudo>] `brew services` `start` <formula> [<plist>]<br> |
require 'rubygems' | |
require 'spoon' | |
Spoon.spawnp 'jruby', *ARGV |
Create a new keychain item, enter the Keychain Item Name as mutt
, the Account Name as your gmail email address and then enter your password, then add the keychain item.
If you're using Google 2-step auth, you'll need to generate an Application-specific password from your Google Account settings and enter that as the password.
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |