Skip to content

Instantly share code, notes, and snippets.

@denishaskin
denishaskin / knife.log
Created February 17, 2012 00:10
knife can't find my bootstrap template
DEBUG: Looking for bootstrap template in /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/chef-0.10.8/lib/chef/knife/bootstrap
DEBUG: Looking for bootstrap template in /Users/dwhsix/clients/zmx/workspace/zmx/chef-repo/.chef/bootstrap
DEBUG: Looking for bootstrap template in /Users/dwhsix/.chef/bootstrap
Can not find bootstrap definition for ubuntu10.04-gems-zmx.erb
/Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/chef-0.10.8/lib/chef/knife/bootstrap.rb:129:in `load_template': No such file or directory (Errno::ENOENT)
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/chef-0.10.8/lib/chef/knife/bootstrap.rb:196:in `ssh_command'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/chef-0.10.8/lib/chef/knife/bootstrap.rb:177:in `knife_ssh'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/chef-0.10.8/lib/chef/knife/bootstrap.rb:154:in `run'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/knife-ec2-0.5.10/lib/chef/knife/ec2_server_create.rb:218:in `run'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx/gems/c
@denishaskin
denishaskin / summarize_pom.rb
Created February 22, 2012 18:45
Summarize profile properties in a maven pom.xml
# Summarize profile properties in a maven pom.xml
# Parameter: pom.xml filename
# Output: tab-delimited table of profiles & properties
require 'crack/xml'
x = Crack::XML.parse(File.new(ARGV[0]))
m = {}
all_properties = {}
@denishaskin
denishaskin / gist:2960926
Created June 20, 2012 16:57
why can't I see commit?
hanuman:workspace dwhsix$ git clone git://github.com/hryk/homebrew.git hryk-homebrew
Cloning into 'hryk-homebrew'...
remote: Counting objects: 69392, done.
remote: Compressing objects: 100% (34885/34885), done.
remote: Total 69392 (delta 46470), reused 54302 (delta 33709)
Receiving objects: 100% (69392/69392), 9.90 MiB | 401 KiB/s, done.
Resolving deltas: 100% (46470/46470), done.
hanuman:workspace dwhsix$ cd hryk-homebrew/
hanuman:hryk-homebrew dwhsix$ git --no-pager log | grep d4308592d3df7767963048027145dea22c81fb04
hanuman:hryk-homebrew dwhsix$
@denishaskin
denishaskin / chef-stacktrace.out
Created July 8, 2012 19:38
LoadError: no such file to load -- mysql
Generated at 2012-07-08 19:33:15 +0000
LoadError: no such file to load -- mysql
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/var/chef/cache/cookbooks/database/libraries/provider_database_mysql.rb:29:in `load_current_resource'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:453:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in `block in converge'
@denishaskin
denishaskin / t.log
Created July 9, 2012 12:16
can't install mysql cookbook
hanuman:chef-repo dwhsix$ knife cookbook delete mysql
ERROR: Cannot find a cookbook named mysql to delete
hanuman:chef-repo dwhsix$ ls cookbooks/mysql
ls: cookbooks/mysql: No such file or directory
hanuman:chef-repo dwhsix$ knife cookbook site install mysql
Installing mysql to /Users/dwhsix/clients/zmx/workspace/zmx2/chef-repo/cookbooks
Checking out the master branch.
Pristine copy branch (chef-vendor-mysql) exists, switching to it.
Downloading mysql from the cookbooks site at version 1.2.6 to /Users/dwhsix/clients/zmx/workspace/zmx2/chef-repo/cookbooks/mysql.tar.gz
Cookbook saved: /Users/dwhsix/clients/zmx/workspace/zmx2/chef-repo/cookbooks/mysql.tar.gz
@denishaskin
denishaskin / innnodb-status.txt
Created July 10, 2012 18:25
show engine innodb status
mysql> show engine innodb status\G
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
120710 18:22:35 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
-----------------
select sysdate(), c.time_received, c.archive_time_received,
time_to_sec(timediff(sysdate(), c.time_received)) as 'LocProxyReceivedLatency',
time_to_sec(timediff(sysdate(), c.archive_time_received)) as 'LocDbReceivedLatency',
time_to_sec(timediff(c.archive_time_received, c.time_received)) as 'LocProxyToDbLatency'
from obanyc_cclocationreport c where time_received>=subtime(sysdate(), '1:00') order by time_received desc limit 1
@denishaskin
denishaskin / gist:3085449
Created July 10, 2012 18:43
explain-output
id select_type table type possible_keys key key_len ref rows Extra
-- ----------- ----- ----- ------------- ------- ------- ------ ---- -----------
1 SIMPLE c index (null) PRIMARY 20 (null) 1 Using where
@denishaskin
denishaskin / gist:3085463
Created July 10, 2012 18:45
create-table
CREATE TABLE `obanyc_cclocationreport` (
`id` bigint(20) NOT NULL DEFAULT '0',
`archive_time_received` datetime NOT NULL,
`data_quality_qualitative_indicator` tinyint(4) DEFAULT NULL,
`dest_sign_code` int(11) NOT NULL,
`direction_deg` decimal(5,2) NOT NULL,
`emergency_code` varchar(1) DEFAULT NULL,
`latitude` decimal(9,6) NOT NULL,
`longitude` decimal(9,6) NOT NULL,
`manufacturer_data` varchar(64) NOT NULL,
@denishaskin
denishaskin / gist:3086434
Created July 10, 2012 21:48
knife-essentials for redis
hanuman:chef-repo dwhsix$ knife show /cookbooks/redis/attributes/default.rb
remote/cookbooks/redis/attributes/default.rb:
#
# Locations
#
default[:redis][:conf_dir] = "/etc/redis"
default[:redis][:log_dir] = "/var/log/redis"
default[:redis][:data_dir] = "/var/lib/redis"