Skip to content

Instantly share code, notes, and snippets.

View fahimbabarpatel's full-sized avatar

Fahim Babar Patel fahimbabarpatel

View GitHub Profile
require 'open-uri'
require 'aws-sdk'
Aws.config.update({
region: 'us-west-2',
credentials: Aws::Credentials.new('akid', 'secret'),
})
s3 = Aws::S3::Resource.new
@fahimbabarpatel
fahimbabarpatel / Mongodb restore and dump commands via json, bson and csv.md
Last active May 10, 2025 09:57
Mongodb restore and dump commands via json, bson and csv

NOTE -

  • Remove -h option if you are doing operation on same machine
  • Remove -u , -p option if your database don't have username and password

Binary

Import database

mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
@fahimbabarpatel
fahimbabarpatel / Node.js + Nginx setup + Amazon Linux.md
Last active September 30, 2015 14:14
Node.js + Nginx setup + Amazon Linux
sudo yum install -y nginx
sudo npm install -g forever
Open /etc/nginx/nginx.conf in sudo edit mode and replace http block
 http {
  include mime.types;
  default_type application/octet-stream;
  sendfile on;
@fahimbabarpatel
fahimbabarpatel / Node.js + Nginx + Passenger setup (Ubuntu).md
Last active August 14, 2016 09:55
Node.js + Nginx + Passenger setup (Ubuntu)

Follow Phusion Passenger URL for Ubuntu setup https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/ ( If in future above URL is not present then visit to Phusion Passenger site to select Ubuntu OS and futher instaltion steps.)

Install our PGP key and add HTTPS support for APT
  • sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
  • sudo apt-get install -y apt-transport-https ca-certificates
Add our APT repository
@joost
joost / ruby_google_analytics_server_to_server.md
Last active November 27, 2023 15:43
Google Analytics API (server-to-server) using Ruby
@timoxley
timoxley / gist:1721593
Created February 2, 2012 04:58
Recursively run all tests in test directory using mocha
// this will find all files ending with _test.js and run them with Mocha. Put this in your package.json
"scripts": {
"test": "find ./tests -name '*_test.js' | xargs mocha -R spec"
},