Skip to content

Instantly share code, notes, and snippets.

View spuder's full-sized avatar

Spencer Owen spuder

View GitHub Profile
@spuder
spuder / redis exec
Last active August 29, 2015 13:58
Puppet redis exec and install
# The case statment is running too late, it needs to run earlier
case $::osfamily {
redhat:{
$redis_6390_version = 'redis-6390-2.8.7-1.x86_64.rpm'
notify {"Installing redhat redis from /tmp/${redis_6390_vesion}":}
}
debian:{
$redis_6390_version = 'redis-6390_2.8.7_amd64.deb'
# How would one guarantee that 'fpm' is installed after 'ruby-devel' ?
$required_packages=['rubygems','ruby-devel', 'gcc', 'gcc-c++', 'rpm-build']
ensure_packages($required_packages)
package { 'fpm' :
ensure => latest,
provider => gem,
@spuder
spuder / .bash_profile
Last active April 12, 2018 13:19
.bash_profile
# MANAGED VIA GIT https://gist.github.com/spuder/11360474
# CHANGES MAY BE OVERWRITTEN
# Import the bash_ps1, adds dotted lines after every command
if [ -f "$HOME/.bash_ps1" ]; then
. "$HOME/.bash_ps1"
fi
export CLICOLOR=1
@spuder
spuder / setup-spencers-bash.sh
Last active April 23, 2017 17:40
A script that pulls my bash profile from gists stored on github
#!/bin/bash
#Usage: Execute the following command:
<<COMMENT1
curl -L https://gist.github.com/spuder/11360474/raw/ | bash -x
COMMENT1
@spuder
spuder / logstash
Last active August 29, 2015 14:00
Troubleshoot logstash grok logs
#This config does not work, it never enters the if [tag] == derp block
input {
stdin {}
}
filter {
grok {
#match => [ "message", ".*" ]
match => [ "message", "%{GREEDYDATA}" ]
add_tag => [ "derp" ]
@spuder
spuder / ssh.md
Last active August 13, 2017 02:39
logstash-grok-ssh ignore root user

I have ssh connections from multiple users. I want to log all connectsion except those from the user 'git'. How dow you create an exception to a filter ?

input {

  file {
     path => "/var/log/auth.log"
     type => "syslog"
  }
}
@spuder
spuder / node.pp
Last active August 29, 2015 14:01
logstash-server-puppet
node "logstash.foobar.com" {
class { 'ac_logstash_server':}
class { 'elasticsearch':
manage_repo => true,
repo_version => '1.0',
}
class { 'logstash':
@spuder
spuder / puppet-symlink-recurse.pp
Created May 15, 2014 18:20
puppet recursively create symbolic links
@spuder
spuder / logstash-start-as-root.md
Last active August 29, 2015 14:01
logstash wont' work unless starting as root

cat /etc/logstash/conf.d/logstash.conf

input {
file {
  path => ['/tmp/foo']
}
}
output {
file {
 path =&gt; ['/tmp/bar']
@spuder
spuder / dashing-crash.md
Last active August 29, 2015 14:02
dashing-crash