Skip to content

Instantly share code, notes, and snippets.

@jerrac
jerrac / jquerytablefilter.html
Created November 7, 2012 00:35
Quick filtering of a table with jQuery
<html>
<head>
<title>jquery filter test</title>
</head>
<body>
<label>Filter: </label> <input id="inputfilter" type="text"></input>
<table id="filterme">
<thead>
<tr>
<th>
@jerrac
jerrac / roughtdraftpuppetuserwrapper.pp
Created May 8, 2013 21:42
Rough draft of userwrapper puppet module
sshpubkeys/username.json
{
"type": "id_rsa",
"key": "really long key",
"name": "blah@blah"
}
sshpubkeys/reagand.json
{
"type": "id_rsa",
"key": "really long key",
@jerrac
jerrac / gist:6382702
Created August 29, 2013 19:58
Apache vhost that proxies elasticsearch for Kibana. Make sure Kibana's config.js points to your vhost on port 443. Need proxy and proxy_http apache modules enabled.
<VirtualHost *:80>
ServerAdmin admin@example.org
ServerName elasticsearch.domain.tld
ServerAlias kibana.domain.tld
DocumentRoot /path/to/kibana/docroot
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/kibana/docroot>
@jerrac
jerrac / subdict.py
Created May 6, 2014 22:56
ansible plugin to loop through sub dictionaries the way subelements loops through sub lists.
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed in the hope that it will be useful,
@jerrac
jerrac / gitlab2elk.yml
Created March 23, 2015 22:19
Logstash and Logstash-Forwarder config for GitLab logs
# YAML config for these Ansible roles:
# https://github.com/LaneCommunityCollege/aspects_logstash
# https://github.com/LaneCommunityCollege/aspects_logstash_forwarder
#
# Since it's just straight config blocks, you should be able to just copy and paste what you need if you don't use
# those Ansible roles.
#
# End result is multiline logs combined into one, and dates are parsed correctly.
aspects_logstash_rules:
@jerrac
jerrac / template.json
Created February 18, 2016 00:46
Merged logstash 2.2.0 and topbeat elasticsearch template
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true, "omit_norms" : true},
"dynamic_templates" : [ {
"message_field" : {
$view = new view();
$view->name = 'multifield_sql_error_test';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'multifield sql error test';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@jerrac
jerrac / vagrantupout.txt
Created September 8, 2017 22:29
single icinga vagrant vm up output
[root@reagan-office-3 icinga2x]# vagrant up
Bringing machine 'icinga2' up with 'virtualbox' provider...
==> icinga2: Box 'bento/centos-7.3' could not be found. Attempting to find and install...
icinga2: Box Provider: virtualbox
icinga2: Box Version: >= 0
==> icinga2: Loading metadata for box 'bento/centos-7.3'
icinga2: URL: https://vagrantcloud.com/bento/centos-7.3
==> icinga2: Adding box 'bento/centos-7.3' (v201708.22.0) for provider: virtualbox
icinga2: Downloading: https://vagrantcloud.com/bento/boxes/centos-7.3/versions/201708.22.0/providers/virtualbox.box
==> icinga2: Successfully added box 'bento/centos-7.3' (v201708.22.0) for 'virtualbox'!
@jerrac
jerrac / Dockerfile
Last active May 9, 2018 22:22
Basic Duplicati in Docker files
FROM debian:stretch
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
libmono-system-net4.0-cil \
libmono-system-net-http4.0-cil \
libmono-system-net-http-webrequest4.0-cil \
libmono-system-servicemodel4.0a-cil \
libmono-system-servicemodel-discovery4.0-cil \
libmono-system-serviceprocess4.0-cil \
libmono-microsoft-csharp4.0-cil \
@jerrac
jerrac / Dockerfile
Created December 14, 2018 23:25
php pthreads not compiling on new 7.3.0-zts docker images, just change the image tag to test.
FROM php:7.2.13-zts
RUN apt-get update \
&& apt-get -y install git \
&& rm -rf /var/lib/apt/lists/*
RUN cd /opt \
&& git clone https://github.com/krakjoe/pthreads.git \
&& cd pthreads \
&& phpize && ./configure && make && make install \
&& docker-php-ext-enable pthreads