With Puppet:
puppet module install rtyler-jenkins
puppet apply -v -e "include jenkins"
#!/usr/bin/env perl | |
# Parameters supported: | |
# | |
# config | |
# autoconf | |
# | |
# Magic markers: | |
#%# family=auto | |
#%# capabilities=autoconf |
#!/bin/bash | |
# pre-commit git hook to check the validity of a puppet manifest | |
# | |
# Prerequisites: | |
# gem install puppet-lint puppet | |
# | |
# Install: | |
# /path/to/repo/.git/hooks/pre-comit | |
# Source RVM if needed |
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New new -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
# Create a self-signed cert | |
openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout lumberjack.key -out lumberjack.crt | |
# Create a self-signed with DNS SAN | |
openssl req -x509 -nodes -new -subj "/CN=localhost" -addext "subjectAltName = DNS:localhost" -newkey rsa:2048 -keyout | |
/tmp/server.key -out /tmp/server.crt | |
Operation: Decouple whisper from graphite.
Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.
Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?
The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.
cluster: | |
name: elasticsearch | |
network: | |
host: 127.0.0.1 | |
path: | |
logs: /var/log/elasticsearch | |
data: /var/lib/elasticsearch | |
conf: /etc/elasticsearch |
input { | |
tcp { | |
type => 'json-logger' | |
port => 3517 | |
format => "json_event" | |
} | |
} | |
filter { | |
mutate { | |
# Convert hostname => @source_host, because it's overwritten |
Can be used in crontab like this:
SHELL=/bin/bash
BASH_ENV=~/.bash_profile
# m h dom mon dow command
0 * * * * /home/portfolio/portfolio/bin/session.pl 2> >(json-logger -ep pf_session) | json-logger -p pf_session
0 2 * * * /home/portfolio/portfolio/bin/purge_deleted_messages.pl 2> >(json-logger -ep pf_purge_deleted_messages) | json-logger -p pf_purge_deleted_messages
0,30 * * * * /home/portfolio/portfolio/bin/expire_page_views.pl 2> >(json-logger -ep pf_expire_page_views) | json-logger -p pf_expire_page_views
I would suggest you put it in /usr/bin to avoid having to setup your PATH variable.
#!/usr/bin/ruby | |
queue_list = `rabbitmqctl list_queues`.split("\n") | |
queue_list.pop | |
queue_list.shift | |
queues = Hash.new | |
queue_list.each do |queue| | |
queue = queue.strip.split(/\s+/).collect(&:strip) | |
queue_stat = queue.pop | |
queue_name = queue.pop |