Skip to content

Instantly share code, notes, and snippets.

View johnrlive's full-sized avatar

John Rodriguez johnrlive

  • NY
View GitHub Profile
@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
#!/bin/bash
mkdir -p inventories/{production,staging}/{group_vars,host_vars}
touch inventories/{production,staging}/hosts
mkdir -p group_vars host_vars library module_utils filter_plugins
mkdir -p roles/common/{tasks,handlers,templates,files,vars,defaults,meta,library,module_utils,lookup_plugins}
touch site.yml roles/common/{tasks,handlers,templates,files,vars,defaults,meta}/main.yml
#!/bin/bash
##check what is the latest PHP version supplied by UBUNTU
##sudo apt-cache show php
# Add Repository which gives us the latest php version 7.2
sudo add-apt-repository ppa:ondrej/php
##Lets now check what is the latest PHP version available now after the repository is added
##sudo apt-cache show php
#!/bin/bash
echo 'Install vim'
sudo apt-get install vim
echo 'Install vim-plug'
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo 'mkdir ~/.vim/plugged'
@johnrlive
johnrlive / .aliases
Last active April 6, 2022 02:30
Basic .vimrc config for DevOps
#V1 test
###### Aliases ######
## TMUX ALIASES ##
alias t="tmux"
alias tl="tmux ls"
alias tk="tmux kill-session -t"
alias tn="tmux new -s"
alias tat="tmux attach-session -t"
## PYTHON ALIASES
alias pip="pip3"
@johnrlive
johnrlive / one-click-hugo-cms-theme-config.sh
Last active March 12, 2018 18:27
one-click-hugo-cms-theme-config.sh
#!/bin/bash
git clone https://github.com/netlify-templates/one-click-hugo-cms
cd one-click-hugo-cms
npm install
echo "use the config.yml"
sleep 1
# delete config.toml
rm site/config.toml
# create config.yml
@johnrlive
johnrlive / foo-bar.html
Created November 16, 2017 17:33
Snuggsi Components
<template onclick=onfoo>
<h1>foo-bar custom element</h1>
<slot name=content>Some Default Content</slot>
<ul>
<template name=bat>
<li>Item {#} - Value {self}
</template>
@johnrlive
johnrlive / config.fish
Last active October 30, 2017 18:51
config.fish
set -U fish_user_paths /usr/local/bin $fish_user_paths
### rbenv ###
#set PATH $HOME/.rbenv/bin $PATH
set PATH $HOME/.rbenv/shims $PATH
rbenv rehash >/dev/null ^&1
#set -gx RBENV_ROOT /usr/local/bin/rbenv
### OpenSSL fix for Rbnev Install ###
set -g fish_user_paths "/usr/local/opt/openssl/bin" $fish_user_paths

Install Python

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

Symlinks...

#!/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