Skip to content

Instantly share code, notes, and snippets.

View cdimartino's full-sized avatar

Chris DiMartino cdimartino

View GitHub Profile
#!/bin/bash
# Usage: curl -L gist.... | host=<sync origin> date=<sync date>
apt-get install -y pv
excludes='--exclude "*/SubscriptionChanges/*"'
rs_opts="-ai $excludes $host:/mnt/cassandra_snapshots/full/$date/place_directory_production /var/lib/cassandra/data/"
rsync $rs_opts | pv -arleps `rsync --dry-run $rs_opts | wc -l` > /dev/null
@bfg
bfg / apache-2.2-mod_remoteip.c
Created June 23, 2011 09:32
Working backport (doesn't crash when using Allow/Deny ACLs) of Apache 2.3 module mod_remoteip to Apache 2.2.x
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# 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")