This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rsync -rave "ssh -i /path/to/EC2_KEY.pem" /path/to/local/files/* EC2_USER@EC2_INSTANCE:/path/to/remote/files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface NSArray (JRAdditions) | |
| - (id) safeObjectAtIndex:(NSUInteger)index; | |
| @end | |
| @implementation NSArray (JRAdditions) | |
| - (id) safeObjectAtIndex:(NSUInteger)index { | |
| @synchronized(self) { |