Skip to content

Instantly share code, notes, and snippets.

View tolland's full-sized avatar

Tom Hodder tolland

View GitHub Profile
@tolland
tolland / gist:2031228
Created March 13, 2012 20:07
recombining the timezone to bare timestamps
input {
file {
type => "syslog"
path => [ "/var/log/messages", "/var/log/auth.log" ]
add_field => [ "offset", "-0800" ]
}
}
filter {
## put this in the path called genconfig;
#!/bin/bash
tmpfile=$(mktemp)
erb -T - $1 > $tmpfile
echo $tmpfile
# now you can make erb logstash templates like so;
input { file {
@tolland
tolland / logstash_daily.sh
Created March 25, 2012 10:50 — forked from colonD/logstash_daily.sh
Quick cron.daily script for stock Logstash/ES installation
#!/bin/sh
# Do elasticsearch optimize on logstash previous day index
# if $1 = all then optimize all indicies
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices"
# Grab yesterday's values
D=`date +%d -d yesterday`
M=`date +%m -d yesterday`
Y=`date +%Y -d yesterday`
@tolland
tolland / Makefile
Created June 4, 2012 06:34 — forked from atdt/Makefile
Build and upload Chrome extensions to GitHub using APIv3
EXTNAME := extension
KEYFILE := $(EXTNAME).pem
CRXFILE := $(EXTNAME).crx
EXTDIR := $(EXTNAME)
SHELL := /usr/bin/env bash
CHROME := open /Applications/Google\ Chrome.app -n --args
CWD := $(shell pwd)
SIZE := $(shell wc -c <$(CRXFILE) | tr -d ' ')
VERSION := $(shell python -c "import json,sys;print json.loads(sys.stdin.read()).get('version','')" < $(EXTDIR)/manifest.json)
ZIPFILE := $(EXTNAME)-$(VERSION).crx
@tolland
tolland / automysqlcheck.sh
Created July 27, 2012 06:14
automysqlcheck.sh
#!/bin/bash
#
# #automysqlcheck.sh
#
# This is a small bash script that checks all mysql databases for errors
# and mails a log file to a specified email address. All variables are
# hardcoded for ease of use with cron. Any databases you wish not to check
# should be added to the DBEXCLUDE list, with a space in between each name.
#
# original version by sbray@csc.uvic.ca, UVic Fine Arts 2004
@tolland
tolland / FastXtextResourceSetProvider.java
Created December 1, 2012 21:04 — forked from digulla/FastXtextResourceSetProvider.java
Faster implementation of XtextResourceSetProvider.
import org.apache.log4j.Logger;
import org.eclipse.core.resources.IProject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.eclipse.xtext.ui.resource.IResourceSetProvider;
import org.eclipse.xtext.ui.resource.XtextResourceSetProvider;
import org.eclipse.xtext.ui.util.JdtClasspathUriResolver;
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
# Vagrant commands
vagrant reload #!
vagrant status
vagrant suspend
vagrant resume
vagrant halt
vagrant up
vagrant package
vagrant destroy
vagrant box add <nombre> <url>
/* ---------------------------------------------------------
* | Arduino Experimentation Kit Example Code |
* | CIRC-02 .: 8 LED Fun :. (Multiple LEDs) |
* ---------------------------------------------------------
*
* A few Simple LED animations
*
* For more information on this circuit http://tinyurl.com/d2hrud
*
*/
@tolland
tolland / load_embla.m
Last active December 19, 2015 15:08
Octave script for loading *.ebm files produced by Embletta PDS/Remlogic-E devices.
## Copyright (C) 1996-1997 Flaga hf. Medical Devices (authored by Rognvaldur J. Saemundsson)
## Modified by Joris Coppens, 071014, TSD Netherlands institute for Neuroscience
## Copyright (C) 2013 Carnë Draug <carandraug@octave.org>
##
## 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.
##
## This program is distributed in the hope that it will be useful, but WITHOUT