Brainleak

Blog as external memory

Using ZeroMQ

Install through Chef zeromq cookbook

This cookbook has been added to Role zeromq

ZeroMQ Version

Use this C-code to get the version of ZeroMq.

#include <stdio.h>
  #include "zmq.h"

  int main (int argc, char const *argv[]) {
    int major, minor, patch;
    zmq_version(&major, &minor, &patch);
    printf("Installed ZeroMQ version: %d.%d.%d\n", major, minor, patch);

    return 0;
  }

Compile and run:

gcc -lzmq zeromq-verion.c -o zeromq-version
  ./zeromq-version
  Installed ZeroMQ version: 3.2.4

Using Librarian Chef

Chef Repo should have Cheffile.
Seems to work like bundler and stuff.

Add needed cookbooks to file

cookbook ‘zeromq’,:git => ‘https://github.com/plu/zeromq-cookbook

Run librarian-chef install to install new cookbooks

Roles

  • base

    • add deployer user with ssh key
    • apt-get update
  • zeromq

    • install zeromq
  • ruby-zeromq

    • install ruby (Rubinius 2.2.6)
    • install Ruby zmq library

Rails 4.1 Autotest Config

Use Guard, I like it better then autotest-rails. Can alsy use Guard for other things.

Using Ruby stack : rbx-2.2.6@rails-zeromq

Edit Gemfile, make sure it is in development group and not test group

group :development do
  gem guard-minitest
end

guard init

Edit Guardfile, config for rails 4

guard :minitest do
  # Rails 4
  watch(%r{^app/(.+)\.rb$})                               { |m| "test/#{m[1]}_test.rb" }
  watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
  watch(%r{^app/controllers/(.+)_controller\.rb$})        { |m| "test/integration/#{m[1]}_test.rb" }
  watch(%r{^app/views/(.+)_mailer/.+})                   { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
  watch(%r{^lib/(.+)\.rb$})                               { |m| "test/lib/#{m[1]}_test.rb" }
  watch(%r{^test/.+_test\.rb$})
  watch(%r{^test/test_helper\.rb$}) { 'test' }
end

Books to Read

  • The Banker’s Clothes
  • The Housekeeper and the Professor
  • The Circle
  • Oil on the Brain: Adventures from the Pump to the Pipeline