Skip to content

Instantly share code, notes, and snippets.

View TJM's full-sized avatar

Tommy McNeely TJM

View GitHub Profile
@TJM
TJM / fix_hosts
Created May 1, 2015 22:50
Foreman fix_hosts
<%#
kind: snippet
name: fix_hosts
%>
echo "<%= @host %>" > /etc/hostname
hostname <%= @host %>
# CentOS 7 (Fedora 19+?) uses hostnamectl
[ -x /usr/bin/hostnamectl ] && /usr/bin/hostnamectl set-hostname <%= @host %>
@TJM
TJM / staging.php
Last active August 29, 2015 14:15
Lookup Akamai Staging Hosts to create a hosts file entry
#!/usr/bin/php
<?php
# Convert a hostname to an "Akamai Staging" DNS entry
$parameters = array(
'h' => 'help',
'd' => 'debug'
);
$DEBUG = true;
@TJM
TJM / graylog2.pp
Created January 8, 2015 17:31
graylog2 puppet profile
#
# === Class: lark::profile::graylog2
#
# Setup GrayLog2 Server
# GrayLog 2 also needs redis and elasticsearch
#
# === Parameters
#
# - secret - graylog2 secret (string >64 chars) - no default
# - root_password_sha2 - graylog2 root pass (string) - no default (sha256sum)
@TJM
TJM / sync_ipa_sshkeys.rb
Last active August 29, 2015 14:02
Sync IPA SSH Keys to Stash from @phemmer
#!/usr/bin/ruby
require 'net/http'
require 'net/https'
require 'rubygems'
require 'net/ldap'
require 'timeout'
require 'json'
require 'base64'
require 'resolv'