Skip to content

Instantly share code, notes, and snippets.

@winks
winks / strawman.rb
Created May 30, 2012 14:47
strawman - a simple puppet template checker
#!/usr/bin/env ruby
# strawman - a simple puppet template checker.
# use like:
# echo 'fqdn => test.example.org\n$webserver = ["host1", "host2"]' | strawman template.erb
# where fqdn is in facter format:
# key => value
# and $webserver is a global ruby var, like in your manifests
# seperated by newlines, delivered on STDIN
require 'erb'
@tonyc
tonyc / gist:1384523
Last active February 6, 2023 04:05
Using strace and lsof

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)

@bodgit
bodgit / rabbitmq-server-plugins.spec
Created August 14, 2011 18:39 — forked from dcarley/rabbitmq-server-plugins.spec
RPM SPEC for RabbitMQ plugins
Name : rabbitmq-server-plugins
Version : 2.6.1
Release : 1
Summary : Plugins for RabbitMQ server
Group : Development/Libraries
Source0 : http://www.rabbitmq.com/releases/plugins/v%{version}/amqp_client-%{version}.ez
Source1 : http://www.rabbitmq.com/releases/plugins/v%{version}/rabbitmq_stomp-%{version}.ez
Source2 : http://www.rabbitmq.com/releases/plugins/v%{version}/rabbitmq_management_agent-%{version}.ez
Source3 : http://www.rabbitmq.com/releases/plugins/v%{version}/rabbitmq_management-%{version}.jquery-fix.ez
@gorsuch
gorsuch / ssh_fingerprint.rb
Created July 13, 2011 19:21
Generate an SSH fingerprint from an SSH key
require 'base64'
require 'digest/md5'
key = "your public key here"
# first decode the key
key_decoded = Base64.decode64(key)
# create an md5
md5 = Digest::MD5.hexdigest(key_decoded)
# convert that hash into a readable fingerprint