Skip to content

Instantly share code, notes, and snippets.

@grigio
grigio / Documentation.md
Created January 24, 2016 21:49 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@grigio
grigio / locks.rs
Last active August 29, 2015 14:12 — forked from drbawb/locks.rs
// Ported to Rust 0.13.0-nightly but it doesn't seem to work as expected
use std::time::duration::Duration;
use std::sync::{Arc,RWLock};
use std::thread::Thread;
fn main() {
println!("running channels: ");
channels();
println!("running locks: ");

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@grigio
grigio / gist:4086113
Created November 16, 2012 10:04 — forked from drewfradette/gist:2617991
CodeCat - syntax highlighting for cat
#!/bin/bash
# Filename catc
# Description print files to stdout with syntax highlighting (using python-pygments)
# Author Drew Fradette <http://www.github.com/drewfradette>
# Version 0.6
# Last Updated 2012-09-26
# Usage catc file.sh
# bash_version 4.2.10(1)-release
#######################################################
@grigio
grigio / gist:4040789
Created November 8, 2012 19:01 — forked from mperham/gist:1379464
Flexibility without Dependency Injection
class TaxCode
GENERATORS = {
:us => lambda { |id| "US-#{id}" },
:br => lambda { |id| "#{id + 9}-BRA" }
}
def self.generate(code, id)
gen = GENERATORS[code] || (raise ArgumentError "No generator for country #{code}")
gen.call(id)
end
@grigio
grigio / gist:3768100
Created September 22, 2012 22:38 — forked from Meettya/gist:3082964
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt