Run Jupyter notebook on server
- run on instance:
jupyter notebook --no-browser --port=<host port>
- in other terminal tab
ssh -i <pem key> -L <client port>:localhost:<host port> user@<ip>
- in browser hit
localhost:<client port>
Run Jupyter notebook on server
jupyter notebook --no-browser --port=<host port>
ssh -i <pem key> -L <client port>:localhost:<host port> user@<ip>
localhost:<client port>
import urllib.request | |
import tarfile | |
def get_data(file_url, file_name='downloaded') | |
urllib.request.urlretrieve(file_url) | |
with tarfile.open(file_name, "r:gz") as f: | |
f.extractall() | |
from matplotlib import animation | |
predictions_history = [] | |
# append arrays of Y_test values to predictions hostory | |
fig, ax = plt.subplots() | |
ax.grid() | |
scatter = ax.scatter(X_train,Y_train, s=5, c='r') | |
parabola, = ax.plot(X_train, predictions_history[0]) | |
# initialization function: plot the background of each frame |
sudo apt-get update && sudo apt-get install zsh
:
sudo vim /etc/passwd`ubuntu
user, and replace bin/bash
by bin/zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
.zshrc
line: plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
. Remember to remove previous plugins=(git)
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl enable docker - sets Docker to run at startup.
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo docker-compose --version
sudo chmod +x /usr/local/bin/docker-compose
type Nullable<T> = T | null; | |
type Falsy<T> = T | false | undefined | null; | |
interface Dictionary<T> { | |
[P: string]: T; | |
} | |
type BooleanDict = Dictionary<Boolean> |
from typing import List, Any, Dict | |
from collections import Counter | |
""" | |
Write a function that receives two sequences: A and B of integers and returns one sequence C. | |
Sequence C should contain all elements from sequence A (maintaining the order) except those, | |
that are present in sequence B p times, where p is a prime number. | |
""" | |
# Install wget | |
yum install wget -y | |
# Install certbot-auto | |
wget https://dl.eff.org/certbot-auto | |
chmod a+x certbot-auto | |
# Obtain SSL certificate with Nginx plugin for the domain | |
sudo ./certbot-auto --nginx -d app.com --debug |
/** | |
* * Decorator for methods returning T[]; where T has property fieldName | |
* @param fieldName: string, property name to sort by; reference _.orderBy documentation | |
* @param direction: string; reference _.orderBy documentation | |
*/ | |
export function Sort<T>(fieldName: keyof T, direction: SortDirection = 'asc'): any { | |
return function(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor { | |
const original = descriptor.value; | |
descriptor.value = function(...args: any[]): any { | |
const result = original.apply(this, args); |