Skip to content

Instantly share code, notes, and snippets.

@alexsavio
Last active December 31, 2015 05:59
Show Gist options
  • Save alexsavio/7944439 to your computer and use it in GitHub Desktop.
Save alexsavio/7944439 to your computer and use it in GitHub Desktop.
IPython notebooks on how to use Virtualenv and Virtualenvwrapper
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"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": {}
}
]
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment