Skip to content

Instantly share code, notes, and snippets.

View johnrlive's full-sized avatar

John Rodriguez johnrlive

  • NY
View GitHub Profile
@samnang
samnang / gist:1759336
Created February 7, 2012 11:52
Install Bash version 4 on MacOS X
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@lenada
lenada / gist:4012862
Created November 4, 2012 18:21
Installing OwnCloud on FreeNAS 8.3

FreeNAS "plugin" OwnCloud

see http://doc.freenas.org/index.php/Plugins get pluginjail running

create a folder / zfs filesystem on a device with sufficient storage space. mount_nullfs created directory to /plugin-jail-path/usr/ports

portsnap fetch portsnap extract

@pehrlich
pehrlich / boolean.rb
Created February 15, 2013 21:25
Rails Boolean to string yes no
class TrueClass
def to_s(style = :boolean)
case style
when :word then 'yes'
when :Word then 'Yes'
when :number then '1'
else 'true'
end
end
end
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
rbenv install 1.9.3-p392
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/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
@dariocravero
dariocravero / deploy.rb
Created June 12, 2013 03:04
Put these files in *config/*.
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
@irazasyed
irazasyed / How-To Install Memcache on CentOS WHM-cPanel.md
Last active November 15, 2023 14:28
How-To: Install Memcache on CentOS (WHM/cPanel)

How-To: Install Memcache on CentOS (WHM/cPanel)

Without wasting much time, Let us get started!

Follow these simple instructions:

  • Step 1: Login into your WHM panel and using easyapache enable Memcache

  • Step 2: SSH into your server and fire this command yum install memcached.x86_64 php-pecl-memcache.x86_64

@Kartones
Kartones / postgres-cheatsheet.md
Last active March 31, 2026 04:12
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)
@tkremmel
tkremmel / gist:237b183a30f0f399de67
Last active August 29, 2015 14:06
simpleloop - Dockerfile to build web host container images
############################################################
# Dockerfile to build web host container images
# Based on Ubuntu, Django, uwsgi, and Nginx
############################################################
# Set the base image to Ubuntu
FROM ubuntu:14.04
# File Author / Maintainer
MAINTAINER TK - simpleloop