Skip to content

Instantly share code, notes, and snippets.

@common-nighthawk
Last active November 28, 2016 18:42
Show Gist options
  • Save common-nighthawk/0a97684919517895664b5720b13f8ed8 to your computer and use it in GitHub Desktop.
Save common-nighthawk/0a97684919517895664b5720b13f8ed8 to your computer and use it in GitHub Desktop.
//get the machine ready
sudo apt-get update
sudo apt-get upgrade
//set up go
sudo apt-get install golang-go
mkdir ~/go
mkdir ~/go/src
export GOPATH=~/go/
//set up postgres
http://tecadmin.net/install-postgresql-server-on-ubuntu/#
give the postgres user a password in psql
create database as postgres user
create tables as ubuntu user
//set up the project
git clone [...]
go get
//changes to project
db, err = sql.Open("postgres", "postgres://postgres:PASSWORD@localhost/hello-its-me")
file := fileServerDir + r.URL.Path[7:]
fileServerDir = "/home/ubuntu/go/src/hello-its-me/assets"
move the models and templates up one dir
http.ListenAndServeTLS(":8081", "/home/ubuntu/.certs/cert.pem", "/home/ubuntu/.certs/key.pem", nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment