Skip to content

Instantly share code, notes, and snippets.

@phumpal
phumpal / get_cloud_ips.rb
Last active August 29, 2015 14:08
Gather public cloud server IPs in a region and permits traffic to statsd/graphite
#!/usr/bin/env ruby
require 'fog'
connection = Fog::Compute.new({
:provider => 'rackspace',
:rackspace_username => ENV['RACKSPACE_API_USERNAME'],
:rackspace_api_key => ENV['RACKSPACE_API_KEY'],
:version => :v2,
:rackspace_region => :ord
# The videos can be found at http://programme.scottishrubyconference.com/schedule
# Usage: ruby download_scotruby_videos.rb /path/to/directory
page = "http://video2012.scotlandonrails.com"
path = ARGV.first || '.'
[
[ "Continuous Delivery - A Better Software Deployment Strategy", "D1_GH_01-Ruby1280_b.mp4" ],
[ "The Rails View: The Junk Drawer Grows Up", "D1_GH_02-Ruby1280_b.mp4" ],
[ "Perfectionists Anonymous", "D1_GH_03-Ruby1280_b.mp4" ],
[ "ElasticSearch, AMQP and Ruby; or how I learned to stop spelunking and love the logs", "D1_GH_04-Ruby1280_b.mp4" ],
@mahemoff
mahemoff / names.txt
Created April 5, 2012 22:24
Reserved username list
###
A meta-compilation of:
https://raw.github.com/gist/1453705/d253733a56632a8d2c29321a75c18b627fa4dda8/reserved_usernames.rb
http://blog.postbit.com/reserved-username-list.html
http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
(Took out some company-specific terms at the top of the first one (e.g. imulus, stacks), added one term so far - 'edits'.)
NOTE: Does not include profanities. You may or may not want to add a list of those.
(See https://www.google.com/search?q=profanity+list, but don't try to apply regexp's here because Scunthorpe - http://en.wikipedia.org/wiki/Scunthorpe_problem)
@denmarkin
denmarkin / resque.rake
Created September 20, 2011 11:02
My rake task for clearing Resque queues and stats
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
@nstielau
nstielau / default.rb
Created May 18, 2011 16:22
A simple Chef recipe to install Jenkins
#
# Cookbook Name:: jenkins
# Recipe:: default
#
# https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
# This is super-simple, compared to the other Chef cookbook I found
# for Jenkins (https://github.com/fnichol/chef-jenkins).
#
# This doesn't include Chef libraries for adding Jenkin's jobs via
@shinzui
shinzui / tmux.conf
Created March 12, 2011 01:08 — forked from bryanl/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
module Heroku
class StaticAssetsMiddleware
def initialize(app)
@app = app
end
def call(env)
# call returns an array containing [response code, header, Rack::Response]
reply = @app.call(env)
#!/bin/bash
PASTEL='{
"Ansi 0 Color" = {
"Blue Component" = 0.3097887;
"Green Component" = 0.3097887;
"Red Component" = 0.3097887;
};
"Ansi 1 Color" = {
"Blue Component" = 0.3764706;