A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
#!/usr/bin/env bash | |
set -e | |
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - | |
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list | |
sudo apt-get update -y > /dev/null 2>&1 | |
sudo apt-get install -y libcurl3 mongodb-org-shell |
# tested on AWS p2.xlarge August 29, 2018 | |
# install CUDA | |
sudo apt-get update && sudo apt-get install wget -y --no-install-recommends | |
CUDA_URL="https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64" | |
wget -c ${CUDA_URL} -O cuda.deb | |
sudo dpkg --install cuda.deb | |
sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get install -y cuda |
#!/bin/bash | |
# install CUDA Toolkit v9.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb" | |
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get -y install cuda-9-0 |
var Nightmare = require('nightmare'), | |
vo = require('vo'); | |
function *start() { | |
var nightmare = new Nightmare({ | |
show: true, | |
'download-preferences': { | |
destination: require('path').resolve(__dirname, 'downloads') | |
} | |
}); |
docker-machine \ | |
--tls-ca-cert $LOCAL_CONFIG_PATH/ca.pem \ | |
--tls-ca-key $LOCAL_CONFIG_PATH/ca-key.pem \ | |
--tls-client-cert $LOCAL_CONFIG_PATH/cert.pem \ | |
--tls-client-key $LOCAL_CONFIG_PATH/key.pem \ | |
create --driver generic --generic-ssh-user root --generic-ip-address xxx.xxx.xxx.xxx test-deployment |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
v.cpus = 1 |
# install brikis98/docker-osx-dev | |
curl -o /usr/local/bin/docker-osx-dev https://raw.githubusercontent.com/brikis98/docker-osx-dev/master/src/docker-osx-dev | |
chmod +x /usr/local/bin/docker-osx-dev | |
docker-osx-dev install | |
# go to working folder where contains docker-compose.xml | |
docker-osx-dev | |
# install virtualenv | |
sudo pip install virtualenv |
FROM node:4 | |
# Add code & set working dir | |
ADD . /app | |
WORKDIR /app | |
# Install npm package | |
RUN npm install |
o := orm.NewOrm() | |
//Database alias | |
name := "default" | |
// Drop table and re-create. | |
force := true | |
// Print log. | |
verbose := true | |
err := orm.RunSyncdb(name, force, verbose) //this is to create/drops the tables | |
if err != nil { | |
beego.Info(err) |