Skip to content

Instantly share code, notes, and snippets.

View juliandunn's full-sized avatar

Julian C. Dunn juliandunn

View GitHub Profile
@juliandunn
juliandunn / awsha.rb
Last active January 25, 2018 12:15
Demo script for AWSAdvent 2014 blog post
#!/usr/bin/ruby
require 'fog'
require 'json'
require 'open-uri'
module AWSAdvent
class Demo
attr_reader :instance, :compute, :server
---------------------------------------------------------------------------
LABEL: CORE_DUMP
IDENTIFIER: A924A5FC
Date/Time: Tue Dec 2 16:17:18 CST 2014
Sequence Number: 1229
Machine Id: 00F905A14C00
Node Id: l5a1vp050_pub
Class: S
Type: PERM
@juliandunn
juliandunn / aix-limits.txt
Created November 26, 2014 21:28
limits that are needed for building Chef on AIX
# cat /etc/security/limits
*
* Sizes are in multiples of 512 byte blocks, CPU time is in seconds
*
* fsize - soft file size in blocks
* core - soft core file size in blocks
* cpu - soft per process CPU time limit in seconds
* data - soft data segment size in blocks
* stack - soft stack segment size in blocks
@juliandunn
juliandunn / ppc64-linux-omnibus.sh
Last active August 29, 2015 14:10
How to get omnibus build environment on ppc64 linux
#!/bin/sh
sudo yum -y install git
sudo yum -y install gcc gcc-c++ patch
wget -O /tmp/ruby-install-v0.4.3.tar.gz https://codeload.github.com/postmodern/ruby-install/tar.gz/v0.4.3
cd /tmp && tar zxvf ruby-install-v0.4.3.tar.gz
sudo yum remove libyaml # cloud-init on IBM PDP conflicts, but we don't care if that's removed now
cd ruby-install-0.4.3
sudo make install
sudo /usr/local/bin/ruby-install ruby 2.1.2 # TODO: put flags from https://github.com/opscode-cookbooks/omnibus/blob/master/libraries/ruby_install.rb#L53-L59 in here
@juliandunn
juliandunn / postgresql-on-aws-tips.md
Last active September 27, 2022 10:55
Notes on PostgreSQL performance optimization on RDS

Deep Dive: PostgreSQL on AWS

When loading data

  • disable backups (backup_retention=0)
  • disable multi-AZ and autovacuum
  • pg_dump -Fc (compressed) and pg_restore -j (parallel)
  • Increase maintenance_work_mem
@juliandunn
juliandunn / pryhandler.rb
Created November 14, 2014 22:09
Handler for running Pry in the report handler phase of Chef
require 'chef/log'
require 'pry'
module ChefSoftware
class CookbookVersionsHandler < Chef::Handler
def report
Chef::Log.info('Pausing in handler to run pry; type "exit" to leave pry')
binding.pry
end
-module(christmas_handler).
-behaviour(cowboy_http_handler).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-record(state, {}).
init(_, Req, _Opts) ->
@juliandunn
juliandunn / aix-unicode.md
Last active March 22, 2022 15:35
Adding EN_US to AIX LPAR

Chef Client 12 uses the UTF-8 locale. By default, BOS doesn't include it so Chef will throw warnings. Here's how you install it.

You need at least the AIX media (first disc), or copy all the files in /installp/ppc/*EN_US* somewhere on your LPAR. Let's say it's /tmp/rte

It's recommended that you use smit to install this charset so any WPARs you have also get the charset applied.

From a root shell type:

` $ smit lang

Starting Chef Client, version 12.2.0.dev.0
resolving cookbooks for run list: ["chef-client::config", "chef-client::service", "chef-client::delete_validation"]
Synchronizing Cookbooks:
- cron
- chef-client
- logrotate
- windows
- chef_handler
Compiling Cookbooks...
Converging 12 resources
@juliandunn
juliandunn / master-contributing.md
Created October 5, 2014 19:33
Contributing to all the things Chef

Thanks for wanting to contribute to Chef! There are many ways to get involved in various areas of the project, tools, and documentation. This document will help you get started; the links below point to how-to-contribute information for each project.

An Overview of the Main Projects under the Chef Umbrella

The Chef Client

The Chef Development Kit