Skip to content

Instantly share code, notes, and snippets.

View evan4498's full-sized avatar

Evan Ochs evan4498

View GitHub Profile
@evan4498
evan4498 / graylog2mon.sh
Created February 1, 2012 22:06
Script for monitoring graylog2 log file and restarting service
#!/bin/bash
#
# File: logmon.sh
# Description: Restart graylog2 if the error message is found in the current log file.
#
# History:
# Date Author Comment
# 2012-02-01 Evan Ochs initial version
#
@evan4498
evan4498 / gist:2702618
Created May 15, 2012 15:23
pip install fail on chef run
root@hosted-client:~# sudo chef-client -l debug
[Tue, 15 May 2012 15:22:54 +0000] INFO: *** Chef 0.10.10 ***
[Tue, 15 May 2012 15:22:54 +0000] DEBUG: Loading plugin os
[Tue, 15 May 2012 15:22:54 +0000] DEBUG: Loading plugin kernel
[Tue, 15 May 2012 15:22:54 +0000] DEBUG: Loading plugin ruby
[Tue, 15 May 2012 15:22:54 +0000] DEBUG: Loading plugin languages
[Tue, 15 May 2012 15:22:54 +0000] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(host_cpu=#{::Config::CONFIG['host_cpu']},host_vendor=#{::Config::CONFIG['host_vendor']},target=#{::Config::CONFIG['target']},release_date=#{RUBY_RELEASE_DATE},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},bin_dir=#{::Config::CONFIG['bindir']},target_cpu=#{::Config::CONFIG['target_cpu']},host_os=#{::Config::CONFIG['host_os']},platform=#{RUBY_PLATFORM},host=#{::Config::CONFIG['host']},target_vendor=#{::Config::CONFIG['target_vendor']},version=#{RUBY_VERSION},target_os=#{::Config::CONFIG['target_os']},)" STDOUT ----
[Tue, 15 May
root@cmtest:~# chef-client -l debug
[2012-06-11T14:54:50+00:00] INFO: *** Chef 0.10.10 ***
[2012-06-11T14:54:50+00:00] DEBUG: Loading plugin os
[2012-06-11T14:54:50+00:00] DEBUG: Loading plugin kernel
[2012-06-11T14:54:50+00:00] DEBUG: Loading plugin ruby
[2012-06-11T14:54:50+00:00] DEBUG: Loading plugin languages
[2012-06-11T14:54:50+00:00] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(host_vendor=#{::Config::CONFIG['host_vendor']},target=#{::Config::CONFIG['target']},release_date=#{RUBY_RELEASE_DATE},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},bin_dir=#{::Config::CONFIG['bindir']},target_cpu=#{::Config::CONFIG['target_cpu']},host_os=#{::Config::CONFIG['host_os']},target_vendor=#{::Config::CONFIG['target_vendor']},platform=#{RUBY_PLATFORM},host=#{::Config::CONFIG['host']},target_os=#{::Config::CONFIG['target_os']},version=#{RUBY_VERSION},host_cpu=#{::Config::CONFIG['host_cpu']},)" STDOUT ----
[2012-06-11T14:54:50+00:00] DEBUG: host_vendor=pc,target=x86_
#
# Cookbook Name:: cloud_monitoring
# Recipe:: default
#
# Copyright 2012, Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
r = gem_package "rackspace-monitoring" do
version node['cloud_monitoring']['version']
action :nothing
end
pkg_chk_cmd="dpkg -s libxslt-dev libxml2-dev"
if `#{pkg_chk_cmd}`
r.run_action(:install)
end
if system("dpkg -s libxslt-dev libxml2-dev")
r = gem_package "rackspace-monitoring" do
version node['cloud_monitoring']['version']
action :nothing
end
r.run_action(:install)
else
package "libxslt-dev" do
action :install
@evan4498
evan4498 / gist:2917908
Created June 12, 2012 14:35 — forked from eherot/gist:2917872
failure
case node[:platform]
when "ubuntu","debian"
package( "libxslt-dev" ).run_action( :install )
package( "libxml2-dev" ).run_action( :install )
when "redhat","centos","fedora","scientific"
package( "libxslt-devel" ).run_action( :install )
package( "libxml2-devel" ).run_action( :install )
end
r = gem_package "rackspace-monitoring" do
@evan4498
evan4498 / gist:5760758
Last active December 18, 2015 09:19
Create temp url
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 Rackspace
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
@evan4498
evan4498 / gist:5767051
Last active December 18, 2015 10:18
packages.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 Rackspace
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
@evan4498
evan4498 / gist:5767061
Last active December 18, 2015 10:18
packages.json
[
{
"name": "Windows Training",
"files": [
"file1.txt",
"file2.txt"
]
},
{
"name": "Linux Training",