Skip to content

Instantly share code, notes, and snippets.

View lgs's full-sized avatar

Luca G. Soave lgs

View GitHub Profile
# Run with: rake environment elasticsearch:reindex
namespace :elasticsearch do
desc "re-index elasticsearch"
task :reindex => :environment do
klass = Place
ENV['CLASS'] = klass.name
ENV['INDEX'] = new_index = klass.tire.index.name << '_' << Time.now.strftime('%Y%m%d%H%M%S')
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@lgs
lgs / diff-diamond-busybox
Last active August 29, 2015 13:56
As required by discussing Stackbrew pool request #28 ( https://github.com/dotcloud/stackbrew/pull/28 )
root@basenode:/var/lib/docker# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
diamond latest d7f6a6fe4763 30 hours ago 1.215 MB
busybox latest 769b9341d937 37 hours ago 2.489 MB
root@basenode:/var/lib/docker#
root@basenode:/var/lib/docker# ls -lrt ./aufs/diff/d7f6a6fe47634cfe6ce2b93a13c5f7dc5df125267c6ac3f9e842ef2f45fa7ada
total 60
drwxr-xr-x 2 root root 4096 feb 4 00:03 sys
@lgs
lgs / README.md
Created February 1, 2014 11:44 — forked from proppy/README.md

docker.sh: a small interactive shell hack for docker

Usage: ./docker.sh [base-image-name]

Demo: http://ascii.io/a/5011

a virtual machine will not power on because one of its virtual disks is in use by another powered-on virtual machine.
Cannot open the disk '/vmfs/volumes/512d6435-5ea55908-04f1-0050560f0f44/Win01B/Win01B_1.vmdk'
or one of the snapshot disks it depends on. Failed to lock the file
~ # egrep "DISKLIB-LIB" /vmfs/volumes/512d6435-5ea55908-04f1-0050560f0f44/Win02B/vmware.log
2014-01-31T09:07:04.321Z| Worker#0| I120: DISKLIB-LIB : Opened "/vmfs/volumes/512d6435-5ea55908-04f1-0050560f0f44/Win02B/Win02b.vmdk" (flags 0xa, type vmfs).
2014-01-31T09:07:05.840Z| vmx| I120: DISKLIB-LIB : Failed to open '/vmfs/volumes/512d6435-5ea55908-04f1-0050560f0f44/Win01B/Win01B_1.vmdk' with flags 0xa Failed to lock the file (16392).

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

@lgs
lgs / Dockerfile
Last active December 30, 2015 10:29
Experimenting with Docker and NSQ
FROM ubuntu
RUN apt-get -y install wget tar ca-certificates
RUN wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN tar zxvf nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN mkdir -p /usr/local/bin
RUN cp /nsq-0.2.23.linux-amd64.go1.1.2/bin/nsqd /usr/local/bin
RUN mkdir -p /data
VOLUME ["/data"]
# Dockerfile for go 1.1.2 cross compile
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y mercurial git-core
@lgs
lgs / debian.sh
Created November 21, 2013 16:30 — forked from fgrehm/debian.sh
#!/bin/bash
##################################################################################
# 1 - Create the base container
SUITE=squeeze
RELEASE=$SUITE
sudo lxc-create -n ${RELEASE}-base -t debian
rootfs="/var/lib/lxc/${RELEASE}-base/rootfs"
@lgs
lgs / .gitignore
Created November 9, 2013 23:46 — forked from karmi/.gitignore
.vagrant
Gemfile.lock
Berksfile.lock
tmp/