Skip to content

Instantly share code, notes, and snippets.

@JinhaiZ
JinhaiZ / download-using-wget.sh
Last active November 27, 2017 10:57
useful linux function
# download an entire directory from a web site
# -r Turn on recursive retrieving. The default maximum depth is 5.
# --no-parent Do not ever ascend to the parent directory when retrieving recursively.
wget -r --no-parent http://formations.telecom-bretagne.eu/syst/TPDIST/Additional-Reading/
# use wget with username and password
wget -r --no-parent --user user_name --password my_pwd http://formations.telecom-bretagne.eu/syst/TPDIST/Additional-Reading/
@JinhaiZ
JinhaiZ / connection.py
Last active September 28, 2017 09:33
Connect to local MongoDB using pymongo
import pymongo
connection = pymongo.MongoClient('localhost', 27017)
db = connection['db_name']
collection = db['collection_name']
# now we can do CRUD operations with this collection pointer
collection.find({})