Skip to content

Instantly share code, notes, and snippets.

View cwjohnston's full-sized avatar

Cameron Johnston cwjohnston

View GitHub Profile
[Thu, 18 Nov 2010 17:50:51 GMT] [error] [<0.25294.4>] OS Process Error :: {os_process_error,"OS process timed out."}
[Thu, 18 Nov 2010 17:50:51 GMT] [error] [emulator] Error in process <0.25294.4> with exit value: {{nocatch,{os_process_error,"OS process timed out."}},[{couch_os_process,prompt,2},{couch_query_servers,'-start_doc_map/2-fun-0-',2},{lists,foreach,2},{couch_query_servers,start_doc_map,2},{couch_view_updater,view_compute...
[Thu, 18 Nov 2010 17:50:56 GMT] [error] [<0.25291.4>] ** Generic server <0.25291.4> terminating
** Last message in was {'EXIT',<0.25294.4>,
{{nocatch,
{os_process_error,"OS process timed out."}},
return unless ["ubuntu", "debian"].include?(node[:platform])
remote_file "/usr/src/splunk-4.1.5-85165-linux-2.6-amd64.deb" do
source "http://www.splunk.com/index.php/download_track?file=4.1.5/linux/splunk-4.1.5-85165-linux-2.6-amd64.deb&ac=wiki_download&wget=true&name=wget&typed=releases"
not_if { File.exist?("/usr/src/splunk-4.1.5-85165-linux-2.6-amd64.deb") }
end
dpkg_package "splunk" do
action :install
source "/usr/src/splunk-4.1.5-85165-linux-2.6-amd64.deb"
@cwjohnston
cwjohnston / gist:721136
Created November 30, 2010 04:09
network data structure
"network": {
"default_interface": "eth1",
"interfaces": {
"lo": {
"flags": [
"UP",
"LOOPBACK",
"RUNNING"
],
"addresses": {
DEBUG: template[/home/cwj/.ssh/authorized_keys] using Chef::Provider::Template
DEBUG: looking for template authorized_keys.erb in cookbook "users"
DEBUG: Not storing cookbooks/users/templates/default/authorized_keys.erb, as the cache is up to date.
DEBUG: Current content's checksum: 66f7f64779de54a6787a0d789a4714dbe5f5a696046ce1813cb102a384c62b7b
DEBUG: Rendered content's checksum: ddc892e4c0d314f87333b2c6809fd1015ce9a079999eb358c8aff188c3d345f4
INFO: Writing updated content for template[/home/cwj/.ssh/authorized_keys] to /home/cwj/.ssh/authorized_keys
INFO: Backing up template[/home/cwj/.ssh/authorized_keys] to /var/chef/backup/home/cwj/.ssh/authorized_keys.chef-20101207162821
INFO: Removing backup of template[/home/cwj/.ssh/authorized_keys] at /var/chef/backup/./home/cwj/.ssh/authorized_keys.chef-20101206063850
root@concentrator.dp1-ut1:/etc/sysctl.d# chef-client
INFO: Starting Chef Run (Version 0.9.8)
INFO: Storing updated cookbooks/rsyslog/recipes/client.rb in the cache.
INFO: Ran execute[apt-get update] successfully
ERROR: Running exception handlers
ERROR: Exception handlers complete
ERROR: Re-raising exception: TypeError - can't convert String into Integer
/srv/chef/cache/cookbooks/rsyslog/recipes/client.rb:29:in `[]'
/srv/chef/cache/cookbooks/rsyslog/recipes/client.rb:29:in `from_file'
/usr/lib/ruby/1.8/chef/mixin/recipe_definition_dsl_core.rb:72:in `instance_eval'
@cwjohnston
cwjohnston / swapfile.rb
Created January 7, 2011 18:36
non-functional attempt at a swapfile provider for chef
#
# Provider Name:: swapfile
#
# Copyright 2010, Blue Coat Systems Inc.
#
require 'chef/mixin/command'
include Chef::Mixin::Command
action :create do
extsys@master:~$ git clone https://github.com/edouard/campfire-git-post-receive-hook.git
Initialized empty Git repository in /home/extsys/campfire-git-post-receive-hook/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?
extsys@master:~$ git clone http://github.com/edouard/campfire-git-post-receive-hook.git
Initialized empty Git repository in /home/extsys/campfire-git-post-receive-hook/.git/
Getting alternates list for http://github.com/edouard/campfire-git-post-receive-hook.git
Also look at http://github.com/network/156970.git/
Getting pack list for http://github.com/edouard/campfire-git-post-receive-hook.git
Getting pack list for http://github.com/network/156970.git/
server=<% node[:splunk][:indexers].each do |i| %><%= i.chomp %><% unless i == node[:splunk][:indexers].last %>,<% end %><% end %>
irb(main):001:0> require 'open-uri'
=> true
irb(main):003:0> string = open('http://example.com/blah')
=> #<StringIO:0xb752f370>
irb(main):004:0> p string
#<StringIO:0xb752f370>
=> nil
irb(main):006:0> string.class
=> StringIO
import fnmatch
import os
coredir = "/Users/cwj/Dropbox/Needle/corecheck/test"
histfile = "/Users/cwj/Dropbox/Needle/corecheck/corehist.txt"
cores = [file for file in os.listdir(coredir) if fnmatch.fnmatch(file, 'core.*')]
if os.path.exists(histfile):
with open(histfile, 'w') as f: