Log into your server with ssh, something like
ssh -i "my_secret.pem" ubuntu@12.123.12.123If it's a new server, you'll need to install a few things.
Install conda with
| #!/usr/bin/env python | |
| import nbformat,fire | |
| from nbconvert.preprocessors import ExecutePreprocessor | |
| def run_notebook(path): | |
| nb = nbformat.read(open(path), as_version=nbformat.NO_CONVERT) | |
| ExecutePreprocessor(timeout=600).preprocess(nb, {}) | |
| print('done') |
| {"version":1,"resource":"file:///c%3A/Users/rsilva/code/anateldb/extracao/reading.py","entries":[{"id":"aEyo.py","timestamp":1675198943147},{"id":"gZqW.py","timestamp":1675342978085},{"id":"fsOp.py","timestamp":1675342988883}]} |
| {"lastUpload":"2021-06-18T02:34:22.337Z","extensionVersion":"v3.4.3"} |
| # install chromium, its driver, and selenium | |
| !apt update | |
| !apt install chromium-chromedriver | |
| !pip install selenium | |
| # set options to be headless, .. | |
| from selenium import webdriver | |
| options = webdriver.ChromeOptions() | |
| options.add_argument('--headless') | |
| options.add_argument('--no-sandbox') | |
| options.add_argument('--disable-dev-shm-usage') |
Log into your server with ssh, something like
ssh -i "my_secret.pem" ubuntu@12.123.12.123If it's a new server, you'll need to install a few things.
Install conda with
| """ | |
| Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on | |
| calculating the distances between origin and destination cities. | |
| Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5 | |
| Best run this with Spyder (see https://github.com/spyder-ide/spyder) | |
| Author: Markus Konrad <post@mkonrad.net> | |
| April 2016 |
| To support GPU. The xgboost library must be build from the github code. | |
| The instructions on https://xgboost.readthedocs.io/en/latest/build.html are straightforward. | |
| Except for a little detail: | |
| we must use: | |
| sudo -s | |
| python setup.pu install |
| ## | |
| # Create a figure space matrix consisting of 3 columns and 2 rows | |
| # | |
| # Here is a useful template to use for working with subplots. | |
| # | |
| ################################################################## | |
| fig, ax = plt.subplots(figsize=(10,5), ncols=3, nrows=2) | |
| left = 0.125 # the left side of the subplots of the figure | |
| right = 0.9 # the right side of the subplots of the figure |
| #sudo dpkg --install cuda-repo-<distro>-<version>.<architecture>.deb | |
| #sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/7fa2af80.pub | |
| $ sudo apt-get update | |
| $ sudo apt-get install cuda | |
| $ sudo apt-get install nvidia-cuda-toolkit | |
| Reboot the system to load the NVIDIA drivers. | |
| Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables: |