Skip to content

Instantly share code, notes, and snippets.

Avatar

Nestor G Pestelos Jr ngpestelos

View GitHub Profile
@ngpestelos
ngpestelos / org.postgresql.plist
Created Feb 21, 2014
PostgreSQL launchd plist
View org.postgresql.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.postgresql</string>
<key>ProgramArguments</key>
<array>
@ngpestelos
ngpestelos / postgresql-osx.md
Last active Aug 29, 2015
How to compile and run PostgreSQL on Mac OS X
View postgresql-osx.md
@ngpestelos
ngpestelos / initialize-postgresql-osx.md
Created Feb 21, 2014
How to initialize PostgreSQL on OS X
View initialize-postgresql-osx.md

Requirements

  • postgresql compiled and installed
  • postgres user created

Steps

su postgres
/opt/local/pgsql/bin/initdb -D /opt/local/pgsql/data
View README.md

Setting up Ruby, Rails, Nginx, Passenger, PostgreSQL 9 on Ubuntu 12.04 LTS for Windows Azure

Last updated: 12/31/2013

Fix the locale issue

  • Edit /etc/default/locale as sudo.
  • Append LC_ALL="en_US.UTF-8" at the end of the file, save and quit.
  • sudo locale-gen en_US en_US.UTF-8
  • sudo dpkg-reconfigure locales

Install the necessary packages to install rbenv and build Ruby

View speed-up-bundler.md

Update bundler to 1.6.0

gem update bundler

Edit .bundle/config

mirror.URL=https://tokyo-m.rubygems.org

BUNDLE_JOBS=3

@ngpestelos
ngpestelos / playbook.yml
Created Jul 20, 2014
Ansible playbook to setup Docker 1.1.1 in Vagrant
View playbook.yml
---
- hosts: all
remote_user: vagrant
tasks:
- name: install apt signing key
apt_key: url=https://get.docker.io/gpg state=present
- name: add repository
copy: src=docker.list dest=/etc/apt/sources.list.d/docker.list
View hello.service
[Unit]
Description=MyApp
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill busybox1
ExecStartPre=-/usr/bin/docker rm busybox1
ExecStartPre=/usr/bin/docker pull busybox
@ngpestelos
ngpestelos / gist:432497d3cacdb60c3033
Created Aug 28, 2014
deis controller test timeout
View gist:432497d3cacdb60c3033
goroutine 37 [running]:
runtime.panic(0x31afe0, 0xc2080da020)
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/runtime/panic.c:279 +0xf5
testing.func·008()
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/testing/testing.go:629 +0xe6
created by time.goFunc
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/time/sleep.go:121 +0x47
goroutine 16 [chan receive, 20 minutes]:
testing.RunTests(0x4fd988, 0x6572f0, 0x1, 0x1, 0x3aa301)
View docker_bashrc
# Use 'docker.io' if using the official packages on Ubuntu 14.04+
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
drm() { docker rm ; }
dri() { docker rmi ; }
alias dkd="docker run -d -P"
alias dki="docker run -t -i -P"
alias docker_rmi_all='docker rmi $(docker images|tail -n +2|awk '\''{print $1":"$2}'\'')'
#####
View deis-backup.sh
#!/bin/bash
# File: deis-backup.sh
# Author: Ian Blenke
# License: Apache License, Version 2.0
#
# Note: This script is meant to be run under CoreOS "toolbox", as it uses the /media mount and talks locally to etcd to obtain Deis ceph credentials.
# Error out whenever something returns a non-zero errno
set -eo pipefail