Skip to content

Instantly share code, notes, and snippets.

@lefthand
lefthand / rundeck-execution-trip
Created March 21, 2017 23:26
Shell script that will remove old Rundeck executions
#!/bin/bash
# for rundeck with mysql db
# keep last X executions for each job
KEEP=300
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`

Keybase proof

I hereby claim:

  • I am lefthand on github.
  • I am lefthand (https://keybase.io/lefthand) on keybase.
  • I have a public key whose fingerprint is 7FC3 093E F5EB 8B3A 9244 5B6F B94B 71A8 5FBB 010F

To claim this, I am signing this object:

@lefthand
lefthand / Collectd conf for elasticsearch
Created March 17, 2015 18:03
Collectd config file for gathering Elasticsearch status using curl_json plugin.
# Inspired by https://gist.github.com/dc2447/6783658
# Added index stats and selected more suitable types.
<Plugin curl_json>
# Gather a few index specific stats
<URL "http://<%= @hostname %>:9200/<%= @index_name %>/_stats">
Instance "<%= @index_name %>"
<Key "_all/total/docs/count">
Type "gauge"
</Key>
@lefthand
lefthand / query_grok
Last active August 29, 2015 14:15
Logstash Grok pattern for matchin the query type and primary table from a SQL query.
QUERY %{WORD:query_type}(?:\\n)?%{SPACE}(?:(?:[\a-zA-Z()'0-9-_\*+,. ]+?)?(?:\\n)?%{SPACE}(?:FROM|INTO|TEMPORARY TABLE)(?:\\n)?%{SPACE})?(?:%{WORD}\.)?%{WORD:table}