This file contains 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
import pymongo | |
connection = pymongo.MongoClient() | |
# get running operations | |
list(connection.admin["$cmd.sys.inprog"].find()) | |
# kill an operation by id | |
op_id = 123456 |
This file contains 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
from IPython.display import HTML | |
def _repr_html_(self, figsize=(17,10), **kwargs): | |
"""Displays in the notebook a folium.folium.Map object. | |
""" | |
self._build_map(**kwargs) | |
width, height = figsize | |
iframe = '<iframe src="data:text/html;base64,{html}" width="{width}" height="{height}"></iframe>'\ |
This file contains 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
ssh -N -f -L localhost:8800:localhost:8800 user@server |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Imagine you have a folder containing many files, and you want to apply a function to those files. | |
ls *.ipynb | sed 's/.ipynb//' | xargs -i echo {}.ipynb-{}.log | |
If you're in a folder containing `foo.ipynb`, `bar.ipynb`, 'baz.py`, you'll get: | |
foo.ipynb-foo.log | |
bar.ipynb-bar.log |
conda create -n py27 python=2.7 ipykernel
source activate py27
python -m ipykernel install --user --name py27 --display-name "Python 2.7"
conda create -n py27 python=2.7 ipykernel
source activate py27
python -m ipykernel install --user --name py27 --display-name "Python 2.7"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer