Skip to content

Instantly share code, notes, and snippets.

@j05h
j05h / gist:3803998
Created September 29, 2012 13:22 — forked from retr0h/gist:3803315
Array.new.tap do |a|
# Break the directory into pieces for recursive creation.
# ["/opt", "MegaRAID", "MegaCli"]
parts = node['megaraidcli']['dir'].scan(/^\/(?:[a-zA-Z]+)|(?:[a-zA-Z]+)/)
parts.each do |parts|
a << parts
directory a.join(::File::SEPARATOR) do
owner "root"
group "root"
@j05h
j05h / gist:3803996
Created September 29, 2012 13:21 — forked from retr0h/gist:3803315
Array.new.tap do |a|
# Break the directory into pieces for recursive creation.
# ["/opt", "MegaRAID", "MegaCli"]
parts = node['megaraidcli']['dir'].scan(/^\/(?:[a-zA-Z]+)|(?:[a-zA-Z]+)/)
parts.each do |parts|
a << parts
directory a.join(::File::SEPARATOR) do
owner "root"
group "root"
>> import random
>>> respostas_do_guru = ["sim", "nao", "talvez"]
>>> random.choice(respostas_do_guru)
'nao'
@j05h
j05h / unicorn
Created March 10, 2012 21:23
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@j05h
j05h / unicorn
Created March 10, 2012 21:23
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##