Skip to content

Instantly share code, notes, and snippets.

-- show tables
SELECT * FROM pg_catalog.pg_tables;
-- describe table
select column_name, data_type, character_maximum_length from INFORMATION_SCHEMA.COLUMNS where table_name = 'tablename';
jupyter nbconvert --to script config_template.ipynb
sudo cp jupyter.service /usr/lib/systemd/system/
sudo systemctl enable jupyter.service
sudo systemctl daemon-reload
sudo systemctl restart jupyter.service
journalctl -u jupyter > /tmp/test.txt && cat /tmp/test.txt
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
# Step 1 and Step 2 details are here..
# ------------------------------------
ExecStart=/usr/local/bin/jupyter notebook --ip=0.0.0.0 --no-browser
User=ubuntu
sudo jupyter notebook --allow-root --ip=0.0.0.0 --port=80 --no-browser
*~
.settings
.project
.factorypath
.cache
.classpath
.tmpBin
*.pyc
.cache-main
.pydevproject
@timotta
timotta / erase.sh
Created February 14, 2019 19:18
Erase HD
dd if=/dev/urandom of=/dev/sdX bs=1M
JOBID=`cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 10 | head -n 1`
gcloud ml-engine jobs submit training $JOBID \
--module-name=$MODULE \
--region=us-central1 \
--package-path=$PACKAGE \
--job-dir=$BUCKET \
--project=$PROJECT \
--scale-tier=basic_gpu
cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 10 | head -n 1
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.gaussian_process import GaussianProcessClassifie
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis