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
@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:
node demo {
nagios::host::service { 'ping':
check_command => 'check_ping',
}
}
@mtourne
mtourne / nxg_request_time_var.c
Created December 3, 2012 20:31
Expose a $request_time in msec to Nginx core
/* inspired from ngx_http_log_module.c:ngx_http_log_request_time() */
static ngx_int_t
ngx_http_request_time(ngx_http_request_t *r,
ngx_http_variable_value_t *v,
uintptr_t data) {
ngx_time_t *tp;
ngx_msec_int_t ms;
tp = ngx_timeofday();
@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.
@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.
@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");
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active March 21, 2024 23:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@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 })
#
@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created November 18, 2011 15:18
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@larsch
larsch / PrecompiledHeader.cmake
Last active March 12, 2022 10:49
cmake module for setting up precompiled headers (MSVC & GCC)
# Function for setting up precompiled headers. Usage:
#
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
#
# add_precompiled_header(target pchheader.h
# [FORCEINCLUDE]
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])
#