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
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
@rurounijones
rurounijones / DsmSet.rb
Created Sep 12, 2012
Torquebox 2.1.0 error
View DsmSet.rb
class DsmSet
include Mongoid::Document
def to_jpg(opts = nil, user = nil, api = nil)
opts ||= {}
opts[:text] ||= 'Gemini'
opts[:width] ||= 210
opts[:compression] ||= 8
opts[:watermark] ||= false
@rurounijones
rurounijones / Equivalent Rails Log entry
Created Sep 11, 2012
Logstash Formatted JSON log entry from Rails
View Equivalent Rails Log entry
Started GET "/account/register" for 127.0.0.1 at 2012-09-11 09:10:20 +0900
Processing by AccountController#register as HTML
(0.1ms) SELECT MAX("settings"."updated_on") AS max_id FROM "settings"
AnonymousUser Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."type" IN ('AnonymousUser') LIMIT 1
Setting Load (0.1ms) SELECT "settings".* FROM "settings" WHERE "settings"."name" = 'default_language' LIMIT 1
Setting Load (0.1ms) SELECT "settings".* FROM "settings" WHERE "settings"."name" = 'password_min_length' LIMIT 1
CustomField Load (0.1ms) SELECT "custom_fields".* FROM "custom_fields" WHERE (type = 'UserCustomField') ORDER BY position
Rendered account/register.html.erb within layouts/base (50.7ms)
UserPreference Load (0.1ms) SELECT "user_preferences".* FROM "user_preferences" WHERE "user_preferences"."user_id" = 2 LIMIT 1
Completed 200 OK in 62ms (Views: 58.7ms | ActiveRecord: 0.9ms)
You can’t perform that action at this time.