wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb && dpkg -i puppetlabs-release-wheezy.deb && apt-get update && apt-get upgrade -y
apt-get install puppet-common=3.2.4-1puppetlabs1 puppet=3.2.4-1puppetlabs1 -y
[main]
#!/usr/bin/env ruby | |
# execute like: ruby clone_loop.rb | tee clone_loop.log | |
require 'fileutils' | |
REPO = 'git@github.com:gorsuch/nothing' | |
DEST_DIR = 'nothing' | |
loop do |
module SelfRestraint | |
class UnableToLock < StandardError; end | |
def lock(redis, base_key, n) | |
if key = lock_obtain | |
begin | |
yield | |
ensure | |
redis.del key | |
end |
run Proc.new {|env| [[200, 500].shuffle.first, {"Content-Type" => "text/html"}, ['boom!']]} |
wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb && dpkg -i puppetlabs-release-wheezy.deb && apt-get update && apt-get upgrade -y
apt-get install puppet-common=3.2.4-1puppetlabs1 puppet=3.2.4-1puppetlabs1 -y
[main]
...
FROM base | |
RUN apt-get update | |
RUN apt-get -y install build-essential git libssl-dev curl | |
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh | |
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh | |
RUN echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh | |
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh |
{:command "java -jar myapp-0.1.3.jar"
:slug "http://my-store/myapp-0.1.3.jar"
:env {:aws-secret-key "mysecretkey"}}
irb(main):008:0> PTY.spawn ('ls') { |r, w, pid| puts r.read }
Errno::EIO: Input/output error - /dev/pts/6
from (irb):8:in `read'
from (irb):8:in `block in irb_binding'
from (irb):8:in `spawn'
from (irb):8
from /usr/local/bin/irb:12:in `<main>'
(def q (atom '())) | |
(defn qpush! [queue value] | |
(swap! queue conj value)) | |
(defn qpop! [queue] | |
(let [q @queue | |
v (first q) | |
nq (pop q)] | |
(if (compare-and-set! queue q nq) v (recur queue)))) |
Taken from here, recording so I don't lose it:
(defn new-q [] (java.util.concurrent.LinkedBlockingDeque.))
(defn offer!
"adds x to the back of queue q"
[q x] (.offer q x) q)
(defn take!