Skip to content

Instantly share code, notes, and snippets.

View luisfaceira's full-sized avatar

Luís Faceira luisfaceira

  • Winning Scientific Technology
  • Aveiro, Portugal
  • X @luisfaceira
View GitHub Profile
@luisfaceira
luisfaceira / Notes.MD
Created March 25, 2016 03:40
Notes while executing docker-birthday-3 tutorial

Notes on the docker-birthday-3 tutorial

1.1

  • What does uptime mean in the context of a docker container? I think that "docker run alpine uptime" is a very bad example of a command to be executed, because most people will expect it to be 0s, or otherwise will be confused that container is persisting throughout time or that will look into it as it if it were a regular VM

2.1

  • The tutorial says that I would have to run the "docker-machine env" each time I open a new terminal, but at least in windows and using the latest docker quickstart terminal, I only needed to do it once and it's being persisted or auto-detected.
@luisfaceira
luisfaceira / myapp.rb
Created June 4, 2012 10:48
Small app recipe definition
application "myapp" do
path /srv/myapp
owner node[:apache][:user]
group node[:apache][:user]
repository "..."
revision "master"
deploy_key "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----"
mod_php_apache2
end
@luisfaceira
luisfaceira / gist:1462298
Created December 11, 2011 19:35 — forked from caillou/gist:1446583
Translation for relativeDate of moment.js
/*jslint white: false */
var langs;
langs = {
"de" : {
today: "heute um %time",
tomorrow: 'morgen um %time',
next: '%weekday um %time',
yesterday: 'gestern um %time',
@luisfaceira
luisfaceira / gist:1219977
Created September 15, 2011 17:59
Perl script to remove lines with a certain pattern in a file or list of files - originally from http://stackoverflow.com/users/47529/chaos
#!/usr/bin/perl
use IO::Handle;
my $pat = shift(@ARGV) or
die("Usage: $0 pattern files\n");
die("Usage $0 pattern files\n")
unless @ARGV;
foreach my $file (@ARGV) {
@luisfaceira
luisfaceira / prepareEmptyDirs.sh
Created September 15, 2011 10:52
Oneliner to prepare empty directories for svn2git conversion
find -not -path "*/.svn/*" -type d -empty -exec sh -c "echo This directory was empty. This file let's it be git-compatible. > {}/README.emptydir" \;
@luisfaceira
luisfaceira / converter.sh
Created September 13, 2011 11:07
Oneliner to convert svn:ignore into .gitignore
svn propget -R svn:ignore | grep -v "^$" | awk '{print "mkdir " $1 " & echo \"" $3 "\" > " $1 "/.gitignore & svn add " $1 "/.gitignore"}' | /bin/sh