Skip to content

Instantly share code, notes, and snippets.

View ngpestelos's full-sized avatar

Nestor G Pestelos Jr ngpestelos

View GitHub Profile

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

# 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}'\'')'
#####
#!/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
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
-module(port_scanner).
-export([scan/3]).
scan(Addr, Start, End) ->
Services = parse_services(),
scan(Addr, Start, End, Services).
%% Internal functions
scan(Host, Start, End, Services) ->
[Data || Data <-
var sys = require('sys'), http = require('http'), twitter = require('./twitter'), couch = require("./node-couch");
Array.prototype.each = function(fn) {
for (var i = 0; i < this.length; i++) {
var item = this[i];
fn.call(null, item);
}
return this;
};
var sys = require("sys"), http = require('http'), encode = require('./encoding');
function createAuthorization(username, password) {
return "Basic " + encode.base64(username + ":" + password);
}
Object.prototype.filter = function(fn) {
var result = {};
for (var name in this) {
if (this.hasOwnProperty(name)) {
@ngpestelos
ngpestelos / about.md
Created August 16, 2011 01:03 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@ngpestelos
ngpestelos / about.md
Created January 1, 2012 06:12 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer