Skip to content

Instantly share code, notes, and snippets.

View llowder's full-sized avatar

Lee Lowder llowder

View GitHub Profile
@llowder
llowder / es_updater.sh
Created June 12, 2012 21:06
shell script snippet to fix severity levels
count=`curl -s -XPOST 'http://localhost:9200/graylog2/_count?pretty=true' -d '{"term" : { "message" : "info" } }' | sed -n 's/.*count"[ ]:[ ]\([0-9]*\),/\1/p'`
echo "Fixing ${count} INFO messages"
if [ $count -ne 0 ]; then
for i in `curl -s -XPOST 'http://localhost:9200/graylog2/_search?pretty=true' -d "{\"fields\" : [\"_id\"], \"from\" : 0, \"size\" : ${count}, \"query\" : {\"term\" : { \"message\" : \"info\" } } }" | sed -n 's/"_id".*"\(.*\)",/\1/p'`
do
echo "i is: ${i}"
curl -XPOST "http://localhost:9200/graylog2/message/${i}/_update?pretty=true" -d '{ "script" : "ctx._source.level = 6" }'
echo ""
done
fi
Manually installed gems:
gem 'uuidtools (>= 0) ruby'
gem 'ruby_parser (>= 2.3.1) ruby'
gem 'json (>= 0) ruby'
gem 'rest-client (>= 0) ruby'
gem 'ruby2ruby (>= 0) ruby'
gem 'erubis (~> 2.6.6) ruby'
gem 'builder (~> 2.1.2) ruby'
gem 'i18n (~> 0.5.0) ruby'
@llowder
llowder / puppet.conf
Created July 27, 2012 19:26
puppet.conf, settings.yaml and error from starting foreman
# service foreman start
Libvirt binding are missing - hypervisor management is disabled
/var/lib/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/var/lib/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/var/lib/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/var/lib/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8
/usr/lib/ruby/1.8/puppet/settings.rb:278:in `convert': Error converting value for param 'hostcert': Error converting value for param 'certdir': Error converting value for param 'ssldir': Could not find value for $confdir (Puppet::Settings::InterpolationError)
from /usr/lib/ruby/1.8/puppet/settings.rb:271:in `gsub'
from /usr/lib/ruby/1.8/puppet/settings.rb:271:in `convert'
from /usr/lib/ruby/1.8/puppet/settings.rb:1021:in `value'
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
report=true
server=puppet-test-vm-000.domain.tld
certname=puppet-test-vm-000.domain.tld
@llowder
llowder / manifests_nodes_puppet_local_test.pp
Created August 6, 2012 21:04
Puppet 3 rc3 / hiera 1 rc4 / hiera-puppet rc2 issues
node 'puppet3-test.XXXXX.com' {
########################################
# Basic Server Configuration Items #
########################################
# -- Basenode -- #
class { 'basenode':
is_puppet_master => true,
}
# dpkg -l hiera-puppet
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================-=========================-==================================================================
ii hiera-puppet 1.0.0-0.1rc2 A simple pluggable Hierarchical Database.
root@puppet3-test:/etc/puppet# puppet master --verbose --debug --trace --no-daemonize
Debug: Failed to load library 'selinux' for feature 'selinux'
Debug: Using settings: adding file resource 'plugindest': 'File[/var/lib/puppet/lib]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/var/lib/puppet/lib"}'
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet"}'
Debug: Puppet::Type::User::ProviderPw: file pw does not exist
Debug: Puppet::Type::User::ProviderUser_role_add: file roledel does not exist
Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist
Debug: Failed to load library 'ldap' for feature 'ldap'
Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
Debug: Using settings: adding file resource 'server_datadir': 'File[/var/lib/puppet/server_data]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false,
root@puppet3-test:/usr/share/foreman# RAILS_ENV=production bundle exec rake db:migrate --trace
Libvirt binding are missing - hypervisor management is disabled
/usr/share/foreman/vendor/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/usr/share/foreman/vendor/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/usr/share/foreman/vendor/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/usr/share/foreman/vendor/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
# bundle exec gem install sqlite3
Building native extensions. This could take a while...
ERROR: While executing gem ... (NoMethodError)
undefined method `<<' for #<Bundler::SpecSet:0xb70d1148>
root@puppet3-test:/usr/share/foreman#
@llowder
llowder / elasticsearch_spec.rb
Created August 20, 2012 18:21
puppet spec test errors
require 'spec_helper'
describe 'elasticsearch', :type => 'class' do
it do
should contain_file('elastic_conf').with(
{
'ensure' => 'present',
'path' => '/opt/elasticsearch/config/elasticsearch.yml'
})