Skip to content

Instantly share code, notes, and snippets.

View kplimack's full-sized avatar
💭
went skiing

Jake Plimack kplimack

💭
went skiing
View GitHub Profile
@hh
hh / recipe_my_app.rb
Created June 20, 2012 13:10
Error using application cookbook to deploy hello.war
# chef-client
[Wed, 20 Jun 2012 13:06:33 +0000] INFO: *** Chef 10.12.0 ***
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List is [role[my_app]]
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List expands to [chef-client::config, chef-client::service, myplace::my_app]
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Starting Chef Run for 20929809
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Running start handlers
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Start handlers complete.
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Loading cookbooks [apache2, application, application_java, myplace, build-essential, chef-client, chef_handler, gunicorn, iptables, java, mysql, openssl, passenger_apache2, php, python, runit, tomcat, unicorn, windows, xml, yum]
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Missing gem 'mysql'
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Application light-weight resource already initialized -- overriding!
@victorreyesh
victorreyesh / Aircrack Commands
Created September 12, 2013 03:36
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@goldsmith
goldsmith / numpy_os_x_10_9.sh
Last active January 6, 2024 07:25
How to install Numpy and Scipy on Mac OS X Mavericks (10.9) using Pip.
# set up flags for Numpy C extentions compiling
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export CC=gcc-4.2
export CXX="g++ -arch i386 -arch x86_64"
pip install numpy
# success!
@fnichol
fnichol / README.md
Last active August 6, 2022 20:29
Testing on Mac Platforms with Test Kitchen

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider
@hh
hh / knife.rb
Created September 10, 2014 20:33
# A data bag secret lets us use secret ingredients
encrypted_data_bag_secret_file = "#{current_dir}/encrypted_data_bag_secret"
if not ::File.exists? encrypted_data_bag_secret_file
open(encrypted_data_bag_secret_file,'w') do |secretkeyfile|
secretkeyfile.write(OpenSSL::PKey::RSA.new(512).to_pem.lines.to_a[1..-2].join.chomp)
end
end
encrypted_data_bag_secret = encrypted_data_bag_secret_file
@lamont-granquist
lamont-granquist / resources.md
Last active August 17, 2023 22:29
Three Ways to Write Correct Chef Resources

This has been moved into the official Chef docs:

https://docs.chef.io/custom_resources_notes.html

12.5 style custom resources

This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:

  1. For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an action_class do ... end block.

Prerequisites

You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to https://github.com so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example depot.example.com. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in. The /#/sign-in is required.

Operating System

Notifications from Resources "Bubble Up"

Release in Chef 12.9.41 via PR #4741 core chef now has a feature which has been available in Poise for awhile, which is that notifications from within resources will now notify resources in outer run contexts. This means you can write a recipe with a service resource and send a notification to it from a resource that you write.

Notifications will bubble up from arbitrarily nested resources, so users that write resources that wrap resources which wrap your resource will still find the service resource in your default recipe.

At the same time the resources collection #find() and #lookup methods and the more commonly-used DSL method resources("service[ntpd]") has been changed to also match

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.