Skip to content

Instantly share code, notes, and snippets.

View n1shantshrivastava's full-sized avatar

Nishant Shrivastava n1shantshrivastava

View GitHub Profile
<?php
class Curl {
/**
* cURL request method
*
* @var string
*/
protected $_method = 'GET';
<?php
function http_file_get_contents( $url ) {
$response = file_get_contents( $url );
return $response;
}
?>
#!/bin/bash -e
####
# shlog is a bash script that allow you to record a shell session by logging
# command history and giving diff of edited files
####
# User notes:
# - Install:
# Load the script using 'source shlog.bash' (add it to your .bashrc
# to load it automatically)

Mongo DB dump & restore

To dump database

 mongodump --host localhost --port 27017  --db dbname --out dump_dir_name

To dump specific collection

 mongodump --host localhost --port 27017  --db dbname --collection collectioname --out dump_dir_name

##To restore db mongorestore --host localhost --port 27017 dump_dir_name

load 'deploy'
# ================================================================
# ROLES
# ================================================================
role :app, "173.203.86.155:22", {:primary=>true}
role :db, "173.203.86.155:22", {:primary=>true}

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"