Skip to content

Instantly share code, notes, and snippets.

View rohitjoshixyz's full-sized avatar

Rohit Joshi rohitjoshixyz

View GitHub Profile
[1015, 1051, 1578, 1958, 2223, 2401, 2434, 2535, 2687, 3004, 3084, 3174, 6948, 7012, 7061, 7285, 8058, 8336, 8563, 8839, 9081, 9106, 9111, 9529, 28961, 35481, 37685, 37877, 37946, 38043, 38280, 38293, 38347, 38422, 38432, 38565, 39098, 39327, 39339, 39349, 39350, 39474, 39532, 39560, 39605, 39682, 39796, 39908, 39926, 40048, 40101, 40137, 40307, 40614, 41075, 41561, 41696, 42603, 43295, 43323, 43933, 44022, 44035, 44230, 44243, 45227, 45607, 45649, 45733, 46219, 46402, 46720, 47580, 48245, 49025, 49149, 49269, 50322, 51848, 52196, 52210, 52285, 52596, 52623, 52667, 52907, 52939, 53131, 53489, 53749, 54354, 55774, 55877, 56063, 56906, 58071, 58301, 58705, 59422, 59762, 61138, 61816, 62093, 62293, 62454, 62975, 63586, 63691, 63905, 64308, 64415, 64753, 64969, 67121, 67290, 67334, 69045, 69367, 71557, 71793, 72852, 72867, 74118, 76227, 77502, 78069, 78074, 78165, 78398, 79046, 79239, 79410, 79547, 79753, 80086, 80125, 80412, 80645, 80739, 81507, 82477, 83006, 83027, 83251, 83638, 83695, 83705, 84794, 85407, 8561

To take production dump

mongodump --db simply_smart_production --out dump/simplysmart_23_11_2020

To copy dump from prod server to local machine, run following on local machine terminal

scp -r ubuntu@13.126.244.139:/home/ubuntu/dumps/simplysmart_23_11_2020 /home/rohit/Desktop/dump

To restore the dump on your local machine for development

mongorestore -d 'simplysmart_api_development' '/home/rohit/Desktop/dump/simply_smart_production'

@rohitjoshixyz
rohitjoshixyz / MongoDB_upgrade.md
Last active June 4, 2020 15:00
Upgrading mongodb for simply smart from version 3.2 to 4.2.7

Upgrading mongodb for simply smart from version 3.2 to 4.2.7:

Step 0: Take dump of current database

mongodump --db simplysmart_api_development --out /home/rohit/Desktop/dump

Step 1: After installing a mongodb version(initally 3.2)

cd Desktop/softwares

mongod --dbpath='/home/rohit/Desktop/softwares/simplysmart_api_development'

@rohitjoshixyz
rohitjoshixyz / better_half.rb
Created March 28, 2020 20:18
Code snippet for my blog: Be the better half
require 'opportunity_ships.rb'
def achieve_goal(aim, ship)
raise "Failure is not a crime, having a low aim is..." if aim.low?
unless aim.achieved? do
new_ship = choose_right_ship(ship)
if better_half?(new_ship)
change_ship(ship,new_ship)
else
struggle_and_hustle