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();
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

hadoop fs -ls
hadoop fs -rm -r myinput
hadoop fs -rm -r output_max_store
hadoop fs -put data/purchases.txt myinput
hs code/mapper.py code/reducer.py myinput output
hadoop fs -get output/part-00000 data/mylocalfile.txt
cat data/mylocalfile.txt
hadoop fs -rm -r forum_node
hadoop fs -rm -r forum_users
Dashboard Kibpx05
Twitter: #DevopsDayOSS
Docker - https://www.katacoda.com/courses/docker
Docker compose
ssh ip172-18-0-3-bfi3s2iv9dig00ccies0@direct.labs.play-with-docker.com