Skip to content

Instantly share code, notes, and snippets.

View stbenjam's full-sized avatar
🙃

Stephen Benjamin stbenjam

🙃
View GitHub Profile
@stbenjam
stbenjam / 80-libvirt.rules
Created June 6, 2018 16:20
Libvirt polkit rules
polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
@stbenjam
stbenjam / qdrouterd.conf
Created January 30, 2018 20:40
qdrouterd.conf for dispatch router 1.0
##
## 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
##
## http://www.apache.org/licenses/LICENSE-2.0
#!/bin/bash
[email protected]:$USERNAME
for i in modules/*
do
pushd $PWD
cd $i
git remote add user $GIT_REMOTE_PREFIX/`basename $PWD`
popd
@stbenjam
stbenjam / keybase.md
Created August 25, 2016 18:59
keybase.md

Keybase proof

I hereby claim:

  • I am stbenjam on github.
  • I am stbenjam (https://keybase.io/stbenjam) on keybase.
  • I have a public key ASAq3x84uNLtXFaKoQ_sXOqTggBl7GHVe8jwi1JfGt30wAo

To claim this, I am signing this object:

#!/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
#!/bin/bash
# Delay before starting
DELAY=10
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
}
If you lost some info from dhcpd.conf and want to retrieve the old copy,
puppet would have stored the overwritten configuration files in the
Filebucket. You'd see something like this in the installer logs:
/Stage[main]/Dhcp/File[/etc/dhcp/dhcpd.conf]: Filebucketed
/etc/dhcp/dhcpd.conf to puppet with sum
622d9820b8e764ab124367c68f5fa3a1
And it's restorable with:
@stbenjam
stbenjam / gist:2aa8f31bc869231d5f18
Created October 23, 2015 12:58
debian 8 api on http
/etc/salt/master:
external_auth:
pam:
saltuser:
- '@runner'
rest_cherrypy:
port: 9191
#!/usr/bin/env ruby
# This is the external nodes script to allow Salt to retrieve info about a host
# from Foreman. It also uploads a node's grains to Foreman, if the setting is
# enabled.
require 'yaml'
$settings_file = '/etc/salt/foreman.yaml'
SETTINGS = YAML.load_file($settings_file)
log {
module: DEFAULT
enable: debug+
timestamp: true
output: /var/log/qdrouterd.log
}