Skip to content

Instantly share code, notes, and snippets.

View johnrlive's full-sized avatar

John Rodriguez johnrlive

  • NY
View GitHub Profile
@johnrlive
johnrlive / deploy.rb
Created June 12, 2013 03:17 — forked from dariocravero/deploy.rb
deployment script using "mina -f config/deploy.rb"
require 'mina/git'
require 'mina/rbenv'
require 'mina-contrib/rbenv'
require 'mina-contrib/config'
require 'mina-contrib/bundler'
require 'mina-contrib/safety-check'
require 'mina-contrib/nginx'
require 'mina-contrib/puma'
set :term_mode, :pretty
require 'mina/git'
require 'mina/rbenv'
require 'mina-contrib/rbenv'
require 'mina-contrib/config'
require 'mina-contrib/bundler'
require 'mina-contrib/safety-check'
require 'mina-contrib/nginx'
require 'mina-contrib/puma'
set :term_mode, :pretty
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@johnrlive
johnrlive / upgrade-postgres-9.4-to-9.6.md
Last active October 15, 2018 19:27 — forked from dmitrykustov/upgrade-postgres-9.4-to-9.6.md
Upgrading PostgreSQL from 9.4 to 9.6 on Ubuntu Xenial 16.04

To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list or create /etc/apt/sources.list.d/pgdg.list and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main Then import the repository signing key, and update the package lists:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

Install a new version of PostgreSQL server.

sudo apt-get install postgresql-9.6
@johnrlive
johnrlive / postgres-cheatsheet.md
Last active November 20, 2018 18:39 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@johnrlive
johnrlive / gist:2863412db66222d0ad4055ccd864ca78
Last active February 2, 2019 05:04 — forked from samnang/gist:1759336
Install Bash version 4 on MacOS X
# Install Bash 5 using homebrew
# brew install bash
# Or build bash 4 from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.4.18.tar.gz
tar xzf bash-4.4.18.tar.gz
cd bash-4.4.18
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
function prompt_wikimatze_precmd {
git-info
}
function prompt_wikimatze_setup {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent subst)
# Load required functions.
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
device-metrics-us.amazon.com
samsungacr.com
samsungcloudsolution.com
samsungcloudsolution.net
pavv.co.kr
samsungotn.net
@johnrlive
johnrlive / up-and-running-with-edeliver-on-do.md
Created March 11, 2019 23:58 — forked from davoclavo/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new ubuntu droplet

Setup Server