ssh -i ~/.ssh/keypair.pem ec2-user@123.456.789.101
vi ~/.ssh/config
Processes Snapshot (ps)
And to see every process on the system using BSD syntax: (aux)
ps aux | grep unicorn
kill -9
| db.createUser( | |
| { | |
| user: "username", | |
| pwd: "password", | |
| roles: | |
| [ | |
| { | |
| role: "dbOwner", | |
| db: "dbname" | |
| } |
| void (^logMessage) = ^{ | |
| NSLog(@"Hello from inside the block"); | |
| }; | |
| void (^sumNumbers)(NSUInteger, NSUInteger) = ^(NSUInteger num1, NSUInteger num2){ | |
| NSLog(@"The sum of the numbers is %lu", num1 + num2); | |
| }; | |
| for (NSString *word in funnyWords) { | |
| NSLog(@"%@ is a funny word", word); |
| tweets = timeline.tweets || [] | |
| options[:country] ||= 'us' | |
| options[:privacy] ||= true | |
| def sign_in | |
| current_session || sign_user_in | |
| en | |
| if list_name | |
| "/#{user_name}/#{list_name}" |
| function arrayToObject_recursive ( $data ) { | |
| // if the passed data is just a value, return it, and terminate the recursion. | |
| if ( !is_array( $data ) ) | |
| return $data; | |
| // otherwise, read the class name out of the data. | |
| if ( array_keys($data) !== range(0, count($data) - 1) ) { | |
| if ( !empty( $data['_model_class'] ) ) { | |
| $class = $data['_model_class']; |
| function arrayToObject_recursive ( $data, $key = NULL) { | |
| // if the passed data is just a value, return it, and terminate the recursion. | |
| if ( !is_array( $data ) ) | |
| return $data; | |
| // otherwise, read the class name out of the data. | |
| if ( array_keys($data) !== range(0, count($data) - 1) ) { | |
| if ( !empty( $data['_model_class'] ) ) { | |
| $class = $data['_model_class']; |
| // This function simply processes a Mongo query, and returns an array of objects of the specified type. The type is saved in the _model_class | |
| // parameter (which is saved along with the mongo data). This allows us to know which concrete subclass was saved, and how to load it again. | |
| protected static function get_withQuery ( $query, $collection_name, $sort = null, $limit = null, $skip = null ) { | |
| $mongo = new MongoConnection(); | |
| $collection = $mongo->get_db()->selectCollection( $collection_name ); | |
| $resultCursor = $collection->find( $query ); | |
| if ( !empty($sort) ) $resultCursor->sort( $sort ); | |
| if ( !empty($limit) ) $resultCursor->limit( $limit ); | |
| if ( !empty($skip) ) $resultCursor->skip( $skip ); |
| $ sudo gem install cocoapods | |
| $ pod setup | |
| $ pod install |
| def hello str, &block | |
| pre_str = str + " world!" | |
| block.call pre_str | |
| after_str = "say " + str | |
| puts after_str | |
| end | |
| hello "hello" do |str| | |
| puts "MC says #{str}" | |
| end |