Skip to content

Instantly share code, notes, and snippets.

View h0tw1r3's full-sized avatar
🏝️
Living the dream

Jeffrey Clark h0tw1r3

🏝️
Living the dream
View GitHub Profile
@dalenoe
dalenoe / unifi_ssl_import.sh
Last active October 14, 2018 16:20 — forked from stevejenkins/unifi_ssl_import.sh
Import and use SSL certificates (including Let's Encrypt) with the Ubiquiti UniFi Controller on Unix/Linux Systems
#!/usr/bin/env bash
# unifi_ssl_import.sh
# UniFi Controller SSL Certificate Import Script for Unix/Linux Systems
# by Steve Jenkins <http://www.stevejenkins.com/>
# Incorporates ideas from https://source.sosdg.org/brielle/lets-encrypt-scripts
# Version 2.2
# Last Updated June 26, 2016
@lukespragg
lukespragg / sign4j.c
Last active August 2, 2018 15:57
Sign4j for Linux
/*
sign4j.c: a simple utility to sign executables created by Launch4j
Copyright (c) 2012 Grzegorz Kowal
Modified for Linux by Luke Spragg (Wulfspider), Dalton Pelc (Olloth), Contex, and raphfrk
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@zorab47
zorab47 / offline_template.rb
Created November 22, 2011 16:18
Offline Template for Rails 2.3.x
# Public: Template to render views outside the context of a controller.
#
# Useful for rendering Rails 2.3.x views in rake tasks or background jobs when a
# controller is unavailable.
#
# Examples
#
# template = OfflineTemplate.new(:users)
# template.render("users/index", :layout => false, :locals => { :users => users })
#
@joshenders
joshenders / sabnzbdplus.default
Last active December 8, 2017 19:50
Installing sabnzbdplus on Debian Wheezy from source
# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.
@ebirn
ebirn / runkexec
Last active November 15, 2017 05:20
kexec latest kernel on Centos 6
#!/bin/sh
VERSION=$(ls -t1 /boot/vmlinuz-* | cut -f 1 -d '-' --complement | head -1)
BOOT=/boot
KEXEC=/sbin/kexec
KERNEL=$BOOT/vmlinuz-$VERSION
INITRD=$BOOT/initramfs-$VERSION.img
@rday
rday / gist:3504674
Created August 28, 2012 21:52
Abstract wrapper to allow connection pools
type InitFunction func() (interface{}, error)
type ConnectionPoolWrapper struct {
size int
conn chan interface{}
}
/**
Call the init function size times. If the init function fails during any call, then
the creation of the pool is considered a failure.
node demo {
nagios::host::service { 'ping':
check_command => 'check_ping',
}
}
@andrewkroh
andrewkroh / fstab.pp
Created August 9, 2014 16:55
Configuring /etc/fstab with Puppet Augeas
augeas{ '/etc/fstab - nosuid on /sys':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/sys']/opt[last()]",
"set *[file = '/sys']/opt[last()] nosuid",
],
onlyif => "match *[file = '/sys']/opt[. = 'nosuid'] size == 0",
}
augeas{ '/etc/fstab - acl on /sys':
@jasonhancock
jasonhancock / puppet apache log analyzer
Created August 23, 2012 18:09
Analyze puppet's apache logs.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $file = $ARGV[0] or die('Must pass an apache access logfile');
open IN, "<$file" or die("Can't open $file");
@lantian
lantian / install.php
Last active December 19, 2015 13:18
Phalcon createTable
<?php
foreach ($this->_getModels() as $model) {
$columns = array();
$primaries = array();
foreach ($model['columns'] as $columnName => $column) {
if (isset($column['is_primary']) && $column['is_primary']) {
$primaries = $columnName;
}