Skip to content

Instantly share code, notes, and snippets.

View qs5779's full-sized avatar

Quien Sabe qs5779

View GitHub Profile
@qs5779
qs5779 / capture.pp
Created October 9, 2020 16:01
puppet capture manifest
define profile::capture (
$value,
) {
$tmp = lookup('profile::temp_directory', Stdlib::Absolutepath, first, '/tmp')
$dbg = lookup('profile::debug', Boolean, first, false)
$capture_fpn = "${tmp}/${name}.json"
if $dbg {
$capture_hash = { $name => $value }
file { $capture_fpn:
@qs5779
qs5779 / check-pihole-version.sh
Last active May 21, 2020 16:56
assuming you get notified from your cron.daily outputs, drop this in /etc/cron.daily to be notified when your pihole is out of date
#!/usr/bin/env ruby
# piholev = <<-EOS
# Pi-hole version is v5.0 (Latest: v5.0)
# AdminLTE version is v5.0 (Latest: v5.0)
# FTL version is v5.0 (Latest: v5.0)
# EOS
piholev = %x(pihole -v)
piholev.each_line do |line|
#!/usr/bin/perl -w
# -*- Mode: Perl; tab-width: 2; indent-tabs-mode: nil -*-
#
# I am running ufw on a couple of archlinux arm devices
# but could not figure out how to get ufw logs into the journal
# even though they were avail in dmesg. I created this work
# solution until I figure out the correct solution.
#
# Revision History:
# 20200306 que - initial version
@qs5779
qs5779 / gist:62f2a0009a8db66d7344c73c233e874b
Created August 30, 2019 14:14
crate a tsig Dnsruby::RR object from a tsig file
there are holes (especially in the file parsing regexs) but this work for me.
def read_tsig(keyfn)
tsig = nil
if File.exist?(keyfn)
if File.readable?(keyfn)
text=File.open(keyfn).read
text.gsub!(/\r\n?/, "\n")
name = algo = secret = nil
text.each_line do |line|
@qs5779
qs5779 / docker-ce on ubuntu 19.04
Last active May 22, 2019 11:14
Saga of docker-ce on ubuntu 19.04
<redacted> firewalld[1055]: WARNING: COMMAND_FAILED: UNKNOWN_ERROR: 'ip4tables' backend does not exist
<redacted> firewalld[1055]: message repeated 15 times: [ WARNING: COMMAND_FAILED: UNKNOWN_ERROR: 'ip4tables' backend does not exist]
<redacted> dockerd[2347]: time="2019-05-18T14:08:04.684174727-04:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
<redacted> dockerd[2347]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: COMMAND_FAILED: UNKNOWN_ERROR: 'ip4tables' backend does not exist
<redacted> systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
After updating to 19.04 and installing docker-ce from the docker repos, I could not get docker to start per the error above.
My solution was to set ipatables => false in the daemon.json file
$ cat /etc/docker/daemon.json
@qs5779
qs5779 / keybase.md
Last active March 8, 2018 19:45
Keybase proof

Keybase proof

I hereby claim:

  • I am qs5779 on github.
  • I am jim5779 (https://keybase.io/jim5779) on keybase.
  • I have a public key ASAHQApDwBfG2QV8KV5UJUL-X45VIuj1qq9xpos83q1e7go

To claim this, I am signing this object: