Skip to content

Instantly share code, notes, and snippets.

🏝
Living the dream

Jeffrey Clark h0tw1r3

🏝
Living the dream
Block or report user

Report or block h0tw1r3

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
View lxc-proxmox-noatime
#!/usr/bin/env python2
#
# lxc.hook.pre-start
#
# remounts proxmox container mounts with noatime for performance
#
# copy this file to /usr/share/lxc/hooks/lxc-proxmox-noatime
# create /usr/share/lxc/config/common.conf.d/99-mount-noatime.conf
# with contents: lxc.hook.pre-mount /usr/share/lxc/hooks/lxc-proxmox-noatime
@h0tw1r3
h0tw1r3 / nic.rb
Created Nov 6, 2018
nic fact for puppet gathers speed, duplex, state, slaves, device module, carrier, etc
View nic.rb
# Fact: nic { speed, state, duplex, ... }
#
# Copyright: Jeffrey Clark
# License: GPLv3
require 'pathname'
nic = Hash.new
ifaces = Facter.value(:interfaces)
View all-libvirt-hooks
#!/bin/bash
# Copy or link this script to /etc/libvirt/hooks/{network,qemu,daemon,lxc}
TYPE=$(basename $0)
HOOKS_PATH="/etc/libvirt/hooks.d/${TYPE}/${1}"
[ ! -e "${HOOKS_PATH}" ] && exit 0
if [ -x "${HOOKS_PATH}/${2}/${3}" ] ; then
@h0tw1r3
h0tw1r3 / syslog-ng.conf
Created Oct 22, 2017
Syslog-ng 3.6.4 configuration
View syslog-ng.conf
@version:3.6
@include "scl.conf"
options {
flush-timeout(2000);
chain-hostnames(no);
use-dns(yes);
use-fqdn(no);
create-dirs(yes);
keep-hostname(yes);
@h0tw1r3
h0tw1r3 / init.pp
Last active Aug 3, 2017
Puppet CA subjectAltName support (RFC 3280 4.2.1.7, 1. paragraph)
View init.pp
file { "puppet-ca-subjectaltname-patch":
path => "${::rubysitedir}/puppet/vendor/load_ca_hack.rb",
mode => '0644',
source => "puppet:///files/puppet/load_ca_hack.rb",
notify => Service[puppetmaster],
}
@h0tw1r3
h0tw1r3 / superscrub.pl
Last active Mar 6, 2017
Recurse directory tree, scrubbing lines based that match pattern list. Bzip compressed files supported.
View superscrub.pl
#!/usr/bin/env perl
# Recurse tree for files, scrubbing lines based on pattern list
# Copyright: 2017 Jeffrey Clark <h0tw1r3@gmail.com>
# License: GNU GPL v3+
use strict;
use warnings;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
@h0tw1r3
h0tw1r3 / fstab.pp
Created Feb 26, 2017
Hacky way to apply mount options to fstab entries
View fstab.pp
class profile::fstab {
define fstab::mount($options) {
$mount = $title
exec { "fstab_remount_${mount}":
command => "/bin/env mount -o remount ${title}",
refreshonly => true
}
@h0tw1r3
h0tw1r3 / rclocal.service
Last active Jan 18, 2017
systemd rc.local compatibility
View rclocal.service
[Unit]
Description=/etc/rc.local Compatibility
DefaultDependencies=false
ConditionFileIsExecutable=/etc/rc.local
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/etc/rc.local
TimeoutSec=0
View raw2jpg.sh
#!/bin/env bash
#
# Parallel recursive RAW to JPEG + meta converter
#
# Output into relative JPEG directory
#
# Requires: dcraw, cjpeg, exiv2
# any argument means verbose...
if [ ${#} -ne 0 ]; then
@h0tw1r3
h0tw1r3 / netaddr
Created Oct 13, 2016
Filter IPv4 addresses by network
View netaddr
#!/bin/bash
# NetAddr version 0.2 - Filter IPv4 addresses by network
# Copyright 2016 Jeffrey Clark <github.com/h0tw1r3>
# Copyright 2009 Ole Christian Tvedt <olechrt@stud.ntnu.no>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
You can’t perform that action at this time.