Skip to content

Instantly share code, notes, and snippets.

Avatar

Herminio Vazquez canimus

View GitHub Profile
@ghoranyi
ghoranyi / AWS Swarm cluster.md
Last active Mar 29, 2021
Create a Docker 1.12 Swarm cluster on AWS
View AWS Swarm cluster.md

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

@willsoto
willsoto / format_bytes.rb
Created Jul 2, 2013
format bytes to kilo, mega, giga, tera
View format_bytes.rb
def format_bytes(bytes)
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', ]
if bytes === 0
return 'n/a'
end
i = (Math.log(bytes) / Math.log(1024)).round
return "#{(bytes / Math.ldexp(1024, i)).round(2)} #{sizes[i]}"
View gist:5656177
upstream unicorn {
server unix:/tmp/unicorn.portal.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name secure.example.com;
root /home/user/www/secure.example.com/current/public;
location ^~ /assets/ {
@lukerandall
lukerandall / nokogiri libxml homebrew lion
Created Apr 19, 2012 — forked from matthewford/nokogiri libxml homebrew lion
How to fix: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
View nokogiri libxml homebrew lion
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2