Last active
December 31, 2015 05:59
-
-
Save alexsavio/7944439 to your computer and use it in GitHub Desktop.
IPython notebooks on how to use Virtualenv and Virtualenvwrapper
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Setting up a MongoDB collection" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
" Execute mongo shell:\n", | |
" \n", | |
" mongo" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
" Adding admin user (as executed in buccaneer):\n", | |
"\n", | |
" db = db.getSiblingDB('admin')\n", | |
" \n", | |
" db.addUser( { user: \"alexandre\",\n", | |
" pwd: \"****************************\",\n", | |
" roles: [ \"userAdminAnyDatabase\" ] } )" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
" Adding collection admin user (as executed in buccaneer):\n", | |
"\n", | |
" use admin\n", | |
" db.auth(\"alexandre\", \"**************************\");\n", | |
" \n", | |
" use sands\n", | |
" db.addUser( { user: \"sands\",\n", | |
" pwd: \"**************************\",\n", | |
" roles: [ \"userAdmin\" ] } )\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
" Generating SSL key (as executed in buccaneer):\n", | |
"\n", | |
" openssl rand -base64 741 >> ~/Dropbox/Documents/work/sands/sands-edb/keyfile" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"#### Edit /etc/mongodb.conf\n", | |
" \n", | |
" Uncomment:\n", | |
"\n", | |
" auth=true" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"#### Restart mongodb service:\n", | |
"\n", | |
" sudo service mongodb restart" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"#REFERENCES\n", | |
"\n", | |
"http://docs.mongodb.org/manual/tutorial/enable-authentication/\n", | |
"\n", | |
"http://docs.mongodb.org/manual/tutorial/add-user-administrator/\n", | |
"\n", | |
"http://docs.mongodb.org/manual/tutorial/generate-key-file/" | |
] | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment