Skip to content

Instantly share code, notes, and snippets.

@rurounijones
rurounijones / Add attribute
Last active December 18, 2015 10:49
yum error in Chef wrapper cookbook
tarting Chef Client, version 11.4.4
[2013-06-17T02:12:45+00:00] INFO: *** Chef 11.4.4 ***
[2013-06-17T02:12:45+00:00] DEBUG: Building node object for
connector-dev
[2013-06-17T02:12:45+00:00] DEBUG: Extracting run list from JSON attributes
provided on command line
[2013-06-17T02:12:45+00:00] INFO: Setting the run_list to
["recipe[connector::default]"] from JSON
[2013-06-17T02:12:45+00:00] DEBUG: Applying attributes from json file
[2013-06-17T02:12:45+00:00] DEBUG: Platform is centos version 6.4
@rurounijones
rurounijones / connector.json
Created May 17, 2013 00:36
Chef json and master cookbook recipe.
{
"run_list": [ "recipe[connector]" ],
"postgresql" : {
"version" : "9.2",
"enable_pgdg_yum" : "true",
"password" : {
"postgres" : "password"
},
"config" : {
"listen_addresses" : "*"
@rurounijones
rurounijones / gist:5062171
Created March 1, 2013 03:02
visualVM logfile. Initial connection failure is when visualvm attempted to auto-connect based on previous session, for some reason it does not keep username/password. After that I connected manually according to torquebox documentation and the connection succeeds but no information is being displayed: * Monitor tab empty * Thread tab empty etc.
-------------------------------------------------------------------------------
>Log Session: Friday, March 1, 2013 11:57:08 AM JST
>System Info:
Product Version = VisualVM 1.3.5
Operating System = Windows Server 2008 R2 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.7.0_15-b03
Java Home = C:\Program Files\Java\jdk1.7.0_15\jre
System Locale; Encoding = ja_JP (visualvm); MS932
Home Directory = C:\Users\Administrator
# yum clean all
loaded plugins: product-id, subscription-manager
Updating certificate-based repositories
Please use yum-config-manager to configure which software
repositories are used with Red Hat Subscription Management.
Cleaning repos: epel pgdg92 rhel-6-server-cf-tools-1-rpms
: rhel-6-server-optional-rpms rhel-6-server-rhev-agent-rpms
: rhel-6-server-rpms
http://yum.postgresql.org/9.2/redhat/rhel-6Server-x86_64/repodata/primary.sqlite.bz2 [Errno -1] Metadata file does not match checksum.
class NodeStatusProcessor < TorqueBox::Messaging::MessageProcessor
def on_message(message)
status_record = DocumentQueue.where(:name => message[:queue_name]).first.
document_queue_processors.where(:node_name => message[:node_name]).first
if status_record
# For some reason this isn't triggering automatically so we will do it manually.
status_record.updated_at = Time.zone.now
@rurounijones
rurounijones / elasticsearchstatus.json
Created January 29, 2013 04:39
Logstash problem, elasticsearch status
{
"ok" : true,
"_shards" : {
"total" : 220,
"successful" : 110,
"failed" : 0
},
"indices" : {
"logstash-2013.01.06" : {
"index" : {
@rurounijones
rurounijones / write.rb
Last active December 11, 2015 04:29
exceedingly simple code which is failing on windows on jruby
# encoding: utf-8
require 'tmpdir'
File.open(File.join(Dir.tmpdir,"jtest.txt"),"w:utf-8") {|f| f.write "テスト123漢字"}
@rurounijones
rurounijones / _first_page.html.haml
Created October 3, 2012 06:07
Bootstrap compatible Kaminari Templates
-# Link to the "First" page
-# available local variables
-# url: url to the first page
-# current_page: a page object for the currently displayed page
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
- if current_page.first?
%span.first
= t('views.pagination.first')
@rurounijones
rurounijones / kludge.rb
Created September 18, 2012 00:18
Delete LogSubscribers kludge
config.after_initialize do
notifier = ActiveSupport::Notifications.notifier
subscribers = notifier.listeners_for("sql.active_record")
subscribers += notifier.listeners_for("identify.active_record")
subscribers += notifier.listeners_for("start_processing.action_controller")
subscribers += notifier.listeners_for("process_action.action_controller")
subscribers += notifier.listeners_for("render_template.action_view")
subscribers += notifier.listeners_for("render_partial.action_view")