Skip to content

Instantly share code, notes, and snippets.

rsync -rave "ssh -i /path/to/EC2_KEY.pem" /path/to/local/files/* EC2_USER@EC2_INSTANCE:/path/to/remote/files
@ochronus
ochronus / commands.sh
Last active December 30, 2025 11:27
CPU and disk benchmarks
# install sysbench
$ apt-get install sysbench
# CPU benchmark, 1 thread
$ sysbench --test=cpu --cpu-max-prime=20000 run
# CPU benchmark, 64 threads
$ sysbench --test=cpu --cpu-max-prime=20000 --num-threads=64 run
# Disk benchmark, random read. See .fio files in this gist
@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@plantpurecode
plantpurecode / gist:1880242
Created February 22, 2012 00:45
Safe -objectAtIndex: method
@interface NSArray (JRAdditions)
- (id) safeObjectAtIndex:(NSUInteger)index;
@end
@implementation NSArray (JRAdditions)
- (id) safeObjectAtIndex:(NSUInteger)index {
@synchronized(self) {