Skip to content

Instantly share code, notes, and snippets.

@peplin
peplin / recipe.rb
Created July 10, 2010 01:30
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end
@jordansissel
jordansissel / DateTime#sec_fraction .md
Created February 9, 2011 06:41
Stuff that didn't need to change between ruby 1.8 and 1.9

This DateTime#sec_fraction change is not documented as far as I can tell, at time of writing (2011/02/08).

The change is that sec_fraction in 1.8.x returns "fraction of a day" where in 1.9.x it returns "fraction of a second"

snack(~) % rvm ruby -e 'require "date"; p [RUBY_VERSION, RUBY_PLATFORM] => DateTime.now.sec_fraction.to_f' | sort           
{["1.8.6", "x86_64-linux"]=>3.69974537037037e-06}
{["1.8.7", "java"]=>5.72916666666667e-06}

{["1.8.7", "x86_64-linux"]=>2.9518287037037e-06}

module MCollective
module Agent
# An agent that uses Opscode to manage resources
# Original credit goes to R.I. Pienaar
class ChefExistingResource < RPC::Agent
metadata :name => "SimpleRPC Existing Chef Resource Agent",
:description => "Generic resource management",
:author => "Nicolas Szalay <nico@rottenbytes.info>",
:license => "BSD",
:version => "1.0",
@karmi
karmi / .gitignore
Created May 15, 2011 11:15
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@ripienaar
ripienaar / gist:1256476
Created October 1, 2011 18:43
Send munin results to a stomp server as json events
#!/usr/bin/ruby
require 'rubygems'
require 'stomp'
require 'json'
require 'optparse'
require 'facter'
require 'munin-ruby'
require 'yaml'
require 'timeout'
@sinisterchipmunk
sinisterchipmunk / LICENSE
Last active September 8, 2023 17:57
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@lusis
lusis / opsschool.md
Created October 25, 2012 12:48
What happened here?

Random idea

I'm a big fan of the Ops School idea. I've struggled for years about how to "train up" someone coming into this field. So much of our skill set is forged in the fire of outages and troubleshooting.

One of the things that is both good and bad about system administration and operations is that we tend to see patterns. It's good in that we immediately see things that stand out. The downside is we tend to superimpose that pattern recognition in inappropriate ways.

We had an interesting issue happen yesterday at the dayjob. I won't go into exactly what it was here but I had an idea based on some graphs I was looking at. It's part social experiment but it's also part problem solving skills.

Given the following image with no context, what do you think happened? What are some of the key indicator points that jump out and what pattern do they call to mind?

_(Since it may not be clear simply from an image resolution perspective, there are 4 me

" ---------------
" Start Plug
" ---------------
call plug#begin('~/.vim/plugged')
" git
Plug 'tpope/vim-fugitive'
" utils
Plug 'rking/ag.vim' " ag fro grepping in vim
@aglarond
aglarond / omnibus.freebsd.build.md
Last active July 18, 2016 10:08
Compiling Omnibus-Chef on FreeBSD 9.1

Create a build user

# adduser

(I like to call mine 'builder')

All '$' prompts below will be as this user.

@karmi
karmi / .gitignore
Last active August 24, 2020 09:25
Elasticat makes Elasticsearch JSON responses pretty • http://git.io/elasticat
.DS_Store
tmp/