Skip to content

Instantly share code, notes, and snippets.

View spuder's full-sized avatar

Spencer Owen spuder

View GitHub Profile
@spuder
spuder / Vagrantfile
Created January 3, 2014 18:45
Vagrant vm's without internet
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#config.vm.box = "PuppetlabsCent64"
#config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box"
config.vm.box = "Debian-7-2"
@spuder
spuder / gist:8274987
Created January 5, 2014 22:37
Vagrant - post create
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#config.vm.box = "PuppetlabsCent64"
#config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box"
config.vm.box = "Debian-7-2"
@spuder
spuder / logstash.md
Last active August 29, 2015 13:56
logstash trouble

Why is logstash not parsing my logs?

logstash 1.3 & elasticsearch 0.90 installed form deb packages

sudo service logstash start
sudo service elasticsearch start

ps aux |grep logstash

/usr/bin/java -Xmx256m -Djava.io.tmpdir=/var/lib/logstash/ -jar /opt/logstash/logstash.jar agent -f /etc/logstash/conf.d --log /var/log/logstash/logstash.log

@spuder
spuder / deb
Created March 4, 2014 23:16
fpm bug
If you export to .deb then you can not use -p otherwise you get an error
#Fail
fpm -p /tmp -s dir -m sowen@foo.com -C /tmp/installdir -t deb -n redis-6390 -v 2.8.6 bin/ etc/ var/
Process failed: ar failed (exit code 1). Full command was:["ar", "-qc", "/tmp", "debian-binary", "control.tar.gz", "/tmp/package-deb-build20140304-28142-nfr1q3/data.tar.gz"] {:level=>:error}
#Success
fpm -p /tmp -s dir -m sowen@foo.com -C /tmp/installdir -t rpm -n redis-6390 -v 2.8.6 bin/ etc/ var/
@spuder
spuder / redis_6390_ubuntu
Last active August 29, 2015 13:57
redis-6390 init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@spuder
spuder / 6390.conf
Created March 6, 2014 22:43
redis_6390 config
## Generated by install_server.sh ##
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
@spuder
spuder / pre-receive
Last active March 8, 2016 16:12
pre-recieve
#!/bin/bash
#I don't understand this behavior, there are 0 parameters passed in, yet I am still able to refer to $oldsha, $refname and $newsha
set -x
echo "oldsha is $oldsha"
echo "refname is $refname"
echo "newsha is $newsha"
echo "Recieved $# parameters"
@spuder
spuder / fibinachi.rb
Created March 31, 2014 05:04
ruby recursion
# Array returned by this question http://stackoverflow.com/questions/22752407/why-cant-i-append-to-the-end-of-an-array-recursively-in-ruby
2
3
2
4
2
3
5
2
3
@spuder
spuder / gist:10210424
Last active August 29, 2015 13:58
logstash not sending to elasticsearch
I have logstash 1.4 configured to take everything frim /tmp/access_log and stdin and send it to both elasticsearch and stdout
Documentation page
http://logstash.net/docs/1.4.0/tutorials/getting-started-with-logstash
input {
@spuder
spuder / logstash-torque-error
Last active August 29, 2015 13:58
logstash toruqe failure
Error: Expected one of #, => at line 14, column 26 (byte 328) after filter {
grok {
#04/04/2014 18:26:34;0040;PBS_Server.28407;Req;set_nodes;allocating nodes for job 25.interactive.novalocal with node expression 'node02'
match => { "message"
The config file