Logo

Who is talking?

Archive

Chef'ing custom nginx configs with the nginx cookbook

almost 3 years ago | Steve Jansen: /* steve jansen */

The nginx cookbook has been super helpful Chef’ing some web apps recently. One thing I struggled to understand was how to use my own custom conf, like /etc/nginx/nginx.conf, that is optimized for how I use nginx. One solution I tried, which is probably a Chef anti-pattern, is to only include the nginx cookbook on the initial converge: The Wrong Way 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # the nginx community cookbook will relentlessly revert conf files, # so avoid running it unless nginx isn't installed, # or we explicitly reset/delete the node attribute include_recipe 'nginx' unless node['nginx']['installed'] node.set['nginx']['installed'] = true # our custom nginx.conf template '/etc/nginx/nginx.conf' do source 'nginx.conf.erb' owner 'root' group 'root' mode '0644' notifies :reload, "service[nginx]", :delayed end I knew this was wrong when I wrote it. Chef is all about idempotency. But, I couldn’t figure out a way to keep the nginx cookbook from reverting my custom conf during subsequent converges, only to have my template restore my custom conf a few seconds later. The Better Way The OpsCode blog Doing Wrapper Cookbooks Right shows the right way, and really opened my eyes on the power of Chef’s two phase model (compile, then converge). 1 2 3 4 5 6 include_recipe 'nginx' # use our custom nginx.conf, rather than the one that ships in the nginx cookbook # this avoids the nginx and my-app cookbooks from fighting for control of # the same target file resources('template[nginx.conf]').cookbook 'my-app'

Testing thread safety with concurrent-ruby

about 3 years ago | Rocky Jaiswal: Still Learning

concurrent-ruby is one of my favorite Ruby gems. It provides numerous utilities that makes writing safe, concurrent and well-performing code easier. Lately, we faced an issue while we were developing a feature using http://api.ru ...

Mac Ruby and LLVM

about 3 years ago | Thomas Newton: newtonlabs.io

Intro For a project I need the ability to create my own programming language. Mostly this work is inherited from another colleague.. That said I wanted to take the time to log learnings in this space System Setup I follow a pretty standard stack in the hacker community.. I run with: OSX homebrew Ruby managed with RVM Trying to stick close to this toolbelt.. Following these steps: LLVM Install brew install llvm34 --enable-shared # note llvm did not work correctly with ruby-llvm Setup a project with a Gemfile source "http://rubygems.org" gem "ruby-llvm" gem "treetop" .ruby-version ruby-2.1.2

Mac and NTFS

about 3 years ago | Akshaya Kumar Sharma: Akshaya's World

For those facing issues with enabling pasting of items from Mac (Mavericks to be specific here) to an NTFS drive…just follow the steps mentioned at OSXFUSE Wiki about enabling NTFS-3G and hence write access on the drive. It works just perfectly.Filed under: Computers and Internet, Technology Tagged: Apple, Mac, Microsoft, NTFS

Update on handedness (menu location)

about 3 years ago | Kristof Mattei: Kristof's blog

A while back I wrote how to change the handedness (which seems to be the correct term, instead of the dreadful ‘Menu on the wrong side with a touch screen’). I got a machine in my hands which exhibited the previously mentioned problem. However Tablet PC Settings weren’t installed, so we couldn’t open the tab. After … Continue reading "Update on handedness (menu location)" The post Update on handedness (menu location) appeared first on Kristof's blog.

Update on handedness (menu location)

about 3 years ago | Kristof Mattei: Kristof's blog

A while back I wrote how to change the handedness (which seems to be the correct term, instead of the dreadful ‘Menu on the wrong side with a touch screen’). I got a machine in my hands which exhibited the previously mentioned problem. However Tablet PC Settings weren’t installed, so we couldn’t open the tab. After … Continue reading "Update on handedness (menu location)" The post Update on handedness (menu location) appeared first on Kristof's blog.