Skip to content

Instantly share code, notes, and snippets.

Jeffrey Jones rurounijones

Block or report user

Report or block rurounijones

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rurounijones
rurounijones / connector.json
Created May 17, 2013
Chef json and master cookbook recipe.
View connector.json
{
"run_list": [ "recipe[connector]" ],
"postgresql" : {
"version" : "9.2",
"enable_pgdg_yum" : "true",
"password" : {
"postgres" : "password"
},
"config" : {
"listen_addresses" : "*"
@rurounijones
rurounijones / gist:5062171
Created Mar 1, 2013
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.
View gist:5062171
-------------------------------------------------------------------------------
>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
View gist:4943156
# 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
View gist:4760311
http://yum.postgresql.org/9.2/redhat/rhel-6Server-x86_64/repodata/primary.sqlite.bz2 [Errno -1] Metadata file does not match checksum.
View node_status_processor.rb
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 Jan 29, 2013
Logstash problem, elasticsearch status
View elasticsearchstatus.json
{
"ok" : true,
"_shards" : {
"total" : 220,
"successful" : 110,
"failed" : 0
},
"indices" : {
"logstash-2013.01.06" : {
"index" : {
@rurounijones
rurounijones / write.rb
Last active Dec 11, 2015
exceedingly simple code which is failing on windows on jruby
View write.rb
# 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 Oct 3, 2012
Bootstrap compatible Kaminari Templates
View _first_page.html.haml
-# 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 Sep 18, 2012
Delete LogSubscribers kludge
View kludge.rb
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")
View apartment.rb
Apartment.configure do |config|
config.excluded_models = ['Company']
config.persistent_schemas = ['hstore']
config.database_names = lambda{ Company.select(:name).map(&:name) }
end
You can’t perform that action at this time.