Skip to content

Instantly share code, notes, and snippets.

$sudo apt-get update
$sudo apt-get install python3-pip python3-dev nginx
$sudo pip3 install virtualenv
$git clone https://github.com/path/to/repo.git
$cd my_repo
$virtualenv my_repo_env
$source my_repo_env/bin/activate
$pip install -r requirements.txt
$nano ~/my_repo/config.py #copy any config settings here
http://stackoverflow.com/questions/16237490/i-screwed-up-the-system-version-of-python-pip-on-ubuntu-12-10
Before getting happy with apt-get removes and installs. It's worthwhle to reset your bash cache.
hash -r
http://www.lunametrics.com/blog/2015/08/13/user-id-measuring-real-users/
@get-data-
get-data- / codeDeploy.sh
Last active January 4, 2017 18:58
Shell Script to install AWS Code Deploy on Ubuntu
#!/bin/bash
# AWS Code Deploy on Ubuntu
# Tested on Ubuntu 16.04 LTS
# Install dependancies to get Code Deploy
sudo apt-get update -y
sudo apt-get install python-pip -y
sudo apt-get install ruby -y
sudo apt-get install wget -y
@get-data-
get-data- / gitRemote.txt
Last active January 8, 2017 16:15
Setting a remote
$ git remote add origin https://github.com/user/repo.git
# Set a new remote
$ git remote -v
# Verify new remote
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
@get-data-
get-data- / git_rebase.txt
Last active January 8, 2017 16:15
Repurpose old project by rebasing git
$ rm -rf .git
$ git init
$ git add .
$ git commit -m "some message here"
$ git push origin +master
https://github.com/prakhar1989/docker-curriculum
http://exploreflask.com/en/latest/deployment.html
http://www.patricksoftwareblog.com/how-to-configure-nginx-for-a-flask-web-application/
@get-data-
get-data- / Create new flask project
Created May 13, 2017 18:48
Flask Docker File scaffold for new project
mkdir -p ~/Projects/App/app
cd ~/Projects/App/app
touch requirements.txt .gitignore Dockerfile docker-compose.yml .dockerignore
mkdir app config instance
touch config/__init__.py config/settings.py instance/__init__.py instance/settings.py_production_example
cd app
touch app.py __init__.py
mkdir templates static
touch templates/layout.html static/main.css
@get-data-
get-data- / static IP in Ubuntu16.02
Created May 13, 2017 23:08
don't forget nameservers or you'll be stuck to pinging IPs thinking it is broke when it isn't
sudo nano /etc/network/interfaces
auto PRIMARY_NETWORK_INTERFACE_NAME_HERE
iface PRIMARY_NETWORK_INTERFACE_NAME_HERE inet static
address 192.168.1.99
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.4.4 8.8.8.8
@get-data-
get-data- / ubuntu_setup.sh
Last active May 19, 2017 19:53
Setup Ubuntu 16.04 in a Virtualbox
#!/bin/bash
# Set up a new Ubuntu 16.04 environment in a Virtualbox
# This adds bidirectional copy-paste, awscli and some other tools
# Install dependancies to get Code Deploy
sudo apt-get update -y
sudo apt-get install virtualbox-guest-dkms -y
sudo apt-get install python3-pip -y
sudo apt-get install python3-dev -y