Skip to content

Instantly share code, notes, and snippets.

View afonsoaugusto's full-sized avatar
👾
SRE & DevOps

Afonso Rodrigues afonsoaugusto

👾
SRE & DevOps
View GitHub Profile
mongo "mongodb+srv://sandbox-felrd.mongodb.net/test" --username m001-student
pwd: m001-mongodb-basics
load("loadMovieDetailsDataset.js")
use video
db.getCollectionInfos()
db.getCollectionInfos( { name: "movieDetails" } )
var data = db.movieDetails.findOne();
echo "
storage:
dbPath: /var/mongodb/db/node1
net:
bindIp: 192.168.103.100,127.0.1.1,localhost
port: 27011
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_comparisonOperators.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_element_operators.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_logical_operators.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_all_operator.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_size_operator.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_elemMatch_operator.js
wget https://s3.amazonaws.com/edu-downloads.10gen.com/M001_2018_May/static/handouts/m001_regex_operator.js
mongo "mongodb+srv://sandbox-felrd.mongodb.net/test" --username m001-student
pwd: m001-mongodb-basics
#Final Exam
/*
Which of the following are valid command line instructions to start a mongod?
You may assume that all specified files already exist.
*/
mongod -f /etc/mongod.conf # ok
/*
Setting Up a Sharded Cluster
Lab - Configure a Sharded Cluster
*/
create keyfile
# openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile
rm -rf /var/mongodb/db/{node1,node2,node3}
Section 1: Philosophy & Features:
1. Which of the following does MongoDB use to provide High Availability and fault tolerance?
a. Write Concern # Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters. In sharded clusters, mongos instances will pass the write concern on to the shards.
* b. Replication # provê o HA
c. Sharding # é a distribuição do dado
d. Indexing # index
How to unzip gz file using Python
https://stackoverflow.com/questions/31028815/how-to-unzip-gz-file-using-python
import pandas as pd
import os
fn = '../data/file_to_load.json.gz'
print(os.path.isfile(fn))
df = pd.read_json(fn, lines=True, compression='gzip')
df.tail()

Notas Udacity Brasil - Melhores práticas para potencializar o portfólio no GitHub

Example code

cd /home/training/udacity_training
[training@localhost udacity_training]$ head -50 data/purchases.txt | ./code/mapper.py | sort | ./code/reducer.py 

[training@localhost udacity_training]$ pwd
/home/training/udacity_training