Skip to content

Instantly share code, notes, and snippets.

@op-ct
op-ct / collectd.conf
Created June 3, 2016 23:50
Some collectd.conf settings for PuppetDB
# Selected portions of /etc/collectd.conf to monitor OS some PuppetDB metrics.
# Take the useful bits and wisely merge them into your own!
# ------------------------------------------------------------------------------
# collectd logging plugins
# ------------------------------------------------------------------------------
# logs the behavior of collectd itself. It's somewhat noisy and the log bloats up on busy systems
# Occasionally useful for troubleshooting
### LoadPlugin logfile
@op-ct
op-ct / .tmux.conf
Created June 7, 2016 17:01
.tmux.conf
# new keyboard shortcuts
# ------------------------------------------------------------------------------
# reload .tmux.conf in the current session
bind-key r source-file ~/.tmux.conf \; display "~/.tmux.conf Reloaded!"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# bind-key | split-window -h
# bind-key - split-window -v
# switch between windows
#!/usr/bin/env ruby
verbose = ARGV[0] == '-v'
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
require 'em-ssh'
require 'amqp'
EM.run do
Signal.trap("INT") do
EM.stop
@op-ct
op-ct / RPM-GPG-KEY-CentOS-7
Last active August 7, 2018 17:18
/etc/mock/epel-7-x86_64.cfg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
mQINBFOn/0sBEADLDyZ+DQHkcTHDQSE0a0B2iYAEXwpPvs67cJ4tmhe/iMOyVMh9
Yw/vBIF8scm6T/vPN5fopsKiW9UsAhGKg0epC6y5ed+NAUHTEa6pSOdo7CyFDwtn
4HF61Esyb4gzPT6QiSr0zvdTtgYBRZjAEPFVu3Dio0oZ5UQZ7fzdZfeixMQ8VMTQ
4y4x5vik9B+cqmGiq9AW71ixlDYVWasgR093fXiD9NLT4DTtK+KLGYNjJ8eMRqfZ
Ws7g7C+9aEGHfsGZ/SxLOumx/GfiTloal0dnq8TC7XQ/JuNdB9qjoXzRF+faDUsj
WuvNSQEqUXW1dzJjBvroEvgTdfCJfRpIgOrc256qvDMp1SxchMFltPlo5mbSMKu1
x1p4UkAzx543meMlRXOgx2/hnBm6H6L0FsSyDS6P224yF+30eeODD4Ju4BCyQ0jO
@op-ct
op-ct / wat_r_u_doin_repoclosure.sh
Last active August 18, 2016 20:00
repoclosure `-n` stands for `--nonsense`
### These are the logstash packages in the repos:
# chris  shemp  tmp  d20160818-15958-7zs5e2  $  find . -name logstash\*rpm
./repos/base/logstash-contrib-1.4.2-1_efd53ef.noarch.rpm
./repos/base/logstash-1.4.2-1_2c0f5a1.noarch.rpm
### This fails because it can't resolve `logstash < 0:1.4.3`
# chris  shemp  tmp  d20160818-15958-7zs5e2  $  repoclosure -c repodata -t -r base -l lookaside -c yum.conf -n
Reading in repository metadata - please wait....
Checking Dependencies
@op-ct
op-ct / structured_facter_confine.rb
Created September 2, 2016 21:10
confining on structured facts
# structured_confine.rb
# run `FACTERLIB=$PWD facter | egrep 'foo|bar'` in the directory with this file.
Facter.add('bar') do
bar = { 'a' => 1, 'b' => 2 }
setcode { bar }
end
Facter.add('foo1') do
confine :bar do |v|
@op-ct
op-ct / gerrit_mass_cr.sh
Created October 1, 2016 02:16
Mass CR in Gerrit
# references:
# - https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#How_to_review_and_merge_code_via_command_line
# - https://gist.github.com/Rud5G/5604323
# get review numbers
ssh [email protected] -p 29418 gerrit query 'is:open project:^simp/.* message:SIMP-1450.*' | egrep '^ number' | cut -d\ -f4- > CHANGES_NUMBERS
# CR -1 patchset 1 in all reviews
for i in `cat CHANGES_NUMBERS`; do echo == $i; ssh [email protected] -p 29418 gerrit review --code-review -1 --message \"Hold off on merging until we properly bound the deps for the existing 4.3.X/5.2.X Forge modules\" $i,1; sleep 1; done
@op-ct
op-ct / Puppetfile.tracking
Created October 5, 2016 05:35
(SIMP-1595) Puppetfile.tracking for 5.1.X
# ------------------------------------------------------------------------------
# Generated by `smash_gerrit_reviews_into_puppetfile.rb`
# for Gerrit user 'op-ct'
# on 2016-10-05 01:24:11 -0400
# ------------------------------------------------------------------------------
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# If your Gerrit username is *NOT* 'op-ct':
# Then you should substitute every instance of 'op-ct' with
@op-ct
op-ct / Puppetfile.tracking
Created October 5, 2016 05:38
(SIMP-1595) Puppetfile.tracking for 4.2.X
# ------------------------------------------------------------------------------
# Generated by `smash_gerrit_reviews_into_puppetfile.rb`
# for Gerrit user 'op-ct'
# on 2016-10-05 01:38:04 -0400
# ------------------------------------------------------------------------------
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# If your Gerrit username is *NOT* 'op-ct':
# Then you should substitute every instance of 'op-ct' with