Wednesday, December 25, 2019

Pitfalls of using Jupyter Notebook

Jupyter Notebook is no doubt providing an convenient interactive development environment for coding in Python. The deployment of it in theory is independent of the machine. However, when deployed on servers, especially the servers are hosted in IDC, several pitfalls should get noticed.

Since server might employ more strict rules, so not all ports are available. Usually port 22 is always available. When do local tunnelling, remember the host and port must be explicitly specified. Otherwise, it will fail.
The following is an example:

"C:\Program Files\PuTTY\putty.exe" -ssh username@server_url  -L localhost:local_port:localhost:remote_port

After that, notebook can be launched remotely. It's cunning to remember some options to the command to facilitate usage, such as the working directory, the port number, etc. Following is an example:

jupyter notebook --notebook-dir=working_directory --no-browser --port=remote_port

Wednesday, March 27, 2019

Another way to using Github

I usually just clone repo from Github, however today my friend shows me another way, here I just log it for later reference.

The first step is to make a folder to host the repo, like:
mkdir $HOME/scalable_agent

Then enter the folder to initialize the repo and link to the remote repo on github:
git init
git remote add origin https://github.com/deepmind/scalable_agent.git
git pull -v origin master

The next step is to create a branch to host your modification:
git checkout -b py3encondingIssue
vim py_process.py

After that, commit the change and push to the remote repo:
git add py_process.py
git commit -m "fixing the encoding issue of the name for class property"
git push -u origin py3encondingIssue

Happy coding!