Skip to content

Instantly share code, notes, and snippets.

#! /bin/sh
#
# /etc/rc.d/init.d/logstash
#
# Starts Logstash as a daemon
#
# chkconfig: 2345 20 80
# description: Starts Logstash as a daemon
### BEGIN INIT INFO
@Zordrak
Zordrak / rc.dhcpd
Created November 29, 2013 14:29
Slackware ISC DHCPD init script
#!/bin/sh
#
# /etc/rc.d/rc.dhcpd
# This shell script takes care of starting and stopping
# the ISC DHCPD service
#
# Put the command line options here that you want to pass to dhcpd:
DHCPD_OPTIONS="-q eth0"
@Zordrak
Zordrak / log_check_es
Last active December 30, 2015 03:09
Script to be run from cron every X minutes to e-mail the stack trace of any tomcat exceptions discovered in the previous X minutes.
#!/bin/bash
#
# log_check_es
#
# Check ElasticSearch for recent exceptions from the live tomcat servers
##Debug
#set -x
# Exit on Error
@Zordrak
Zordrak / lumberjack.conf
Created December 9, 2013 10:16
Lumberjack config file
{
"network": {
"servers": ["<logstash indexer ip>:6782"],
"ssl certificate": "/etc/pki/tls/certs/lumberjack.crt",
"ssl ca": "/etc/pki/tls/certs/lumberjack.crt",
"ssl key": "/etc/pki/tls/private/lumberjack.key",
"timeout": 15
},
"files": [
{
OS: CentOS 6.5
ES: 0.90.13
# curl -XGET 'http://localhost:9200/_cluster/stats?human&pretty'
{
"timestamp" : 1402486567302,
"cluster_name" : "elasticsearch",
"status" : "yellow",
"indices" : {
"count" : 177,
@Zordrak
Zordrak / gist:1515e59960cd5610ce97
Created June 18, 2014 14:07
Merge Request Fail
014-06-18 15:05:29 +0100
Started GET "/tools/clubs-deploy/merge_requests/1/automerge?utf8=%E2%9C%93&merge_commit_message=Merge+branch+%27robots.txt%27+into+%27master%27%0D%0A%0D%0ARobots.Txt%0D%0A%0D%0AAdded+reverse+proxypass+for+robots.txt+in+puppet+apache+template.&should_remove_source_branch=1&commit=Accept+Merge+Request" for 127.0.0.1 at 2014-06-18 15:05:36 +0100
Processing by Projects::MergeRequestsController#automerge as JS
Parameters: {"utf8"=>"â", "merge_commit_message"=>"Merge branch 'robots.txt' into 'master'\r\n\r\nRobots.Txt\r\n\r\nAdded reverse proxypass for robots.txt in puppet apache template.", "should_remove_source_branch"=>"1", "commit"=>"Accept Merge Request", "project_id"=>"tools/clubs-deploy", "id"=>"1"}
==> /home/git/gitlab/log/githost.log <==
June 18, 2014 15:05 -> ERROR -> Command failed [1]: /usr/bin/git --git-dir=/home/git/gitlab-satellites/tools/clubs-deploy/.git push origin master
remote: /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler/d
June 19, 2014 11:11 -> ERROR -> Command failed [1]: /usr/bin/git --git-dir=/home/git/gitlab-satellites/tools/clubs-deploy/.git push origin master
remote: /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler/dsl.rb:39:in `eval_gemfile': Gemfile syntax error compile error (Bundler::GemfileError)
remote: on line 22: syntax error, unexpected ':', expecting $end
remote: gem "mysql2", group: :mysql
remote: ^
remote: from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler/dsl.rb:10:in `evaluate'
remote: from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler/definition.rb:26:in `build'
remote: from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler.rb:153:in `definition'
remote: from /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/bundler-1.6.0/lib/bundler.rb:116:in `setup'
@Zordrak
Zordrak / gist:76c5bd0d90f2b69af025
Last active August 29, 2015 14:02
Git Path determines server update hook ruby version
16:39:30 git@gitlab 0:~/gitlab-satellites/tools/clubs-deploy$ which git
/usr/bin/git
16:39:35 git@gitlab 0:~/gitlab-satellites/tools/clubs-deploy$ git push origin master
Counting objects: 1, done.
Writing objects: 100% (1/1), 247 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: 2.0.0
remote: GitLab: You are not allowed to access master!
remote: error: hook declined to update refs/heads/master
@Zordrak
Zordrak / update
Created June 20, 2014 12:25
/home/git/repositories/tools/clubs-deploy.git/hooks/update -> /home/git/gitlab-shell/hooks/update
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
# You can add your own hooks to this file, but be careful when updating gitlab-shell!
# Added for debug
puts RUBY_VERSION
refname = ARGV[0]
node default {
}
node '1.customer1.com' {
class {
'deployment_server':
apache_clubs => [ 'thing1', 'thing2' ],
ec_url => 'cheapthing1.customer1.com',