Skip to content

Instantly share code, notes, and snippets.

Dan Carley dcarley

Block or report user

Report or block dcarley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@winks
winks / strawman.rb
Created May 30, 2012
strawman - a simple puppet template checker
View strawman.rb
#!/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 Oct 30, 2019
Using strace and lsof
View gist:1384523

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)
View rabbitmq-server-plugins.spec
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 Jul 13, 2011
Generate an SSH fingerprint from an SSH key
View ssh_fingerprint.rb
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
You can’t perform that action at this time.