Skip to content

Instantly share code, notes, and snippets.


Stephen Benjamin stbenjam

Block or report user

Report or block stbenjam

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
stbenjam /
Last active Jan 23, 2019
FreeIPA <-> Foreman Integration
# Hook for Foreman/FreeIPA Integration
# Stephen Benjamin <>
# 11.11.2013
. /etc/sysconfig/foreman-ipa
action=$1 # create or destroy
target=$2 # hostname
stbenjam / qdrouterd.conf
Created Jan 30, 2018
qdrouterd.conf for dispatch router 1.0
View qdrouterd.conf
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
View dhcpd.conf
option arch code 93 = unsigned integer 16; # RFC4578
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
log(info, "PXE Client Detected");
if exists user-class and option user-class = "iPXE" {
stbenjam /
Last active Aug 2, 2018
Running a squid docker container with a whitelist
  1. Create a squid.conf file, for example, here's one that whitelists the Satellite 6.3 hosts only.
acl ssl_ports port 443

acl whitelist dstdomain
acl whitelist dstdomain
acl whitelist dstdomain
stbenjam / 2fa.rb
Created Jul 26, 2018
Finds the users in your orgs who have commit but no 2FA enabled
View 2fa.rb
#!/usr/bin/env ruby
require 'octokit'
require 'set'
ORGS = %w[catello].freeze
puts 'You must specify a github token in the GITHUB_TOKEN environment variable.'
exit 1
stbenjam / 80-libvirt.rules
Created Jun 6, 2018
Libvirt polkit rules
View 80-libvirt.rules
polkit.addRule(function(action, subject) {
if ( == "org.libvirt.unix.manage" &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
for i in modules/*
pushd $PWD
cd $i
git remote add user $GIT_REMOTE_PREFIX/`basename $PWD`

Keybase proof

I hereby claim:

  • I am stbenjam on github.
  • I am stbenjam ( on keybase.
  • I have a public key ASAq3x84uNLtXFaKoQ_sXOqTggBl7GHVe8jwi1JfGt30wAo

To claim this, I am signing this object:

View gist:437c4359a8c9d3af2a6a5f1f1e5d8415
#!/usr/bin/env ruby
# get memory in kilobytes and store it
output = %x(free)
min_ram = 8388608
# grab the total column and store it
free_ram = output.split(" ")[7].to_i
# Delay before starting
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
You can’t perform that action at this time.