Skip to content

Instantly share code, notes, and snippets.

@elsonrodriguez
elsonrodriguez / README.md
Last active November 29, 2016 06:55
Quick and Dirty Single Node Kubernetes

Quick and Dirty Single Node Kubernetes Setup.

Preq-reqs:

  • You need a node
  • Your node's OS should be Linux
  • It should be a good Linux distro (Ubuntu 15.10)
  • Not a bad one
  • It should have Docker running
  • It should be disposable
  • It shouldn't have been previously traumatized
# Based on a gist by benwtr (https://gist.github.com/benwtr/5691225)
# Works with Slack -> Hubot -> Icinga
#s
# Description:
# This script receives alerts in the format:
# /usr/bin/curl -X POST \
# "${HUBOT_URL}/${SLACKCHANNEL}@conference.${TEAM}.xmpp.slack.com" \
# -d "type=host" \
# -d "notificationtype=${NOTIFICATIONTYPE}" \
# -d "host=${HOSTDISPLAYNAME}" \
@rdb
rdb / js_linux.py
Last active May 17, 2024 03:24
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://discourse.panda3d.org/t/game-controllers-on-linux-without-pygame/14128
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')
@lusis
lusis / mysql-ruby.rb
Created August 29, 2013 20:59
Ghetto mysql gem omnibus'd with omnibus-chef. Probably won't meet ALL use cases but it works in conjunction with chef_gem "mysql" (which is automatically installed). Works with all the chef mysql resources.
name "mysql-ruby"
version "2.9.1"
dependency "ruby"
dependency "rubygems"
dependency "percona-dev"
build do
gem "install mysql -n #{install_dir}/bin --no-rdoc --no-ri -v #{version}"
end
@mudge
mudge / logstash.conf
Last active April 17, 2019 07:58
A grok pattern for Rails 3.2 logs for use with logstash. Assumes that you have a multiline filter to combine Rails logs into one line and only one worker is logging to a file (c.f. https://gist.github.com/mudge/5063930).
multiline {
tags => ["rails"]
pattern => "^Started"
negate => true
what => "previous"
}
@admackin
admackin / .bashrc
Last active February 10, 2022 22:06
Sane SSH_AUTH_SOCK handling for Screen and Tmux, so that new SSH agents created by subsequent logons are still usable.
_ssh_auth_save() {
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock.$HOSTNAME"
}
alias screen='_ssh_auth_save ; export HOSTNAME=$(hostname) ; screen'
alias tmux='_ssh_auth_save ; export HOSTNAME=$(hostname) ; tmux'
@oremj
oremj / nagios.coffee
Created September 11, 2012 21:09
Nagios script for hubot
# Description:
# This script receives pages in the formats
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d state="$SERVICESTATE$" $CONTACTADDRESS1$
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d state="$HOSTSTATE$" $CONTACTADDRESS1$
#
# Author:
# oremj
irc = require('irc')
anonymous
anonymous / logstash.rb
Created August 17, 2012 08:58
Rails logstash logger first experiment
# Do not use this code in any production systems, really.
#
# Right now that that is out of the way, this is a hacked together
# 'see if it can be done' Rails logger for Logstash.
#
# It is a first look to see what would need to be done to replace
# standard rails logging with a nice logstash based solution.
#
# Current notes:
#
@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@lusis
lusis / log4j.xml
Created November 23, 2011 07:11
Ruby logstash cli application - allows searching historical data in ElasticSearch or live tailing from AMQP topic exchange
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: https://github.com/t0xa/gelfj -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>