Skip to content

Instantly share code, notes, and snippets.

View werkshy's full-sized avatar

Andy O'Neill werkshy

View GitHub Profile
@werkshy
werkshy / gist:4076327
Created November 15, 2012 02:46
MongoDB 2.2.1 crash during initial sync
Wed Nov 14 20:44:26 [rsSync] oplog sync 2 of 3
Wed Nov 14 20:44:26 [repl writer worker 4] CMD: drop ctp.onlineHvacStats
Wed Nov 14 20:44:26 [repl writer worker 4] CMD: drop ctp.tmp.mr.thermostat_67251_inc
Wed Nov 14 20:44:27 [conn2231] end connection XXXXXXXXXXXX (25 connections now open)
Wed Nov 14 20:44:27 [initandlisten] connection accepted from XXXXXXXXXXXX:44786 #2236 (26 connections now open)
Wed Nov 14 20:44:28 [repl writer worker 10] ERROR: writer worker caught exception: Cannot apply $push/$pushAll modifier to non-array on: { ts: Timestamp 135292
3785000|926, h: 4392487477760616592, op: "u", ns: "ctp.logEventByDay", o2: { _id: ObjectId('50a2e4e8870ad2152ea5572f'), logs.19: { $size: 8 }, logs.20: null },
o: { $pushAll: { logs.20: [ { ts: new Date(1352923260000), t: 68.5 }, { ts: new Date(1352923560000) } ], logs.19: [ { ts: new Date(1352922060000) }, { ts: new
Date(1352922360000) }, { ts: new Date(1352922660000) }, { ts: new Date(1352922960000), t: 69.0 } ] } } }
Wed Nov 14 20:44:28 [repl writer wor
@werkshy
werkshy / gist:4207807
Created December 4, 2012 19:32
Deserialization error
Dec 4, 2012 6:54:37 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession
WARNING: Found no validity info for session id 17AF5E7156C86AF174CB72C64209CB9B-n1
Dec 4, 2012 6:54:37 PM de.javakaffee.web.msm.LockingStrategy pingSession
WARNING: The session 17AF5E7156C86AF174CB72C64209CB9B-n1 should be touched in memcached, but it seemed to be not existing anymore.
Dec 4, 2012 6:54:37 PM de.javakaffee.web.msm.LockingStrategy$OnBackupWithoutLoadedSessionTask pingSessionBackup
WARNING: The secondary backup for session 17AF5E7156C86AF174CB72C64209CB9B-n1 should be touched in memcached, but it seemed to be not existing.
Dec 4, 2012 6:54:37 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
WARNING: Could not load session with id 17AF5E7156C86AF174CB72C64209CB9B-n1 from memcached.
java.lang.RuntimeException: The loaded object for sessionId 17AF5E7156C86AF174CB72C64209CB9B-n1 is not of required type byte[], but java.lang.Integer
at de.javakaffee.web.msm.MemcachedSessionService.loadF
@werkshy
werkshy / gist:4207817
Created December 4, 2012 19:34
Config
Tomcat6 Config:
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:qa-1:11211,n2:qa-2:11211"
sticky="false"
lockingMode="auto"
backupThreadCount="4"
requestUriIgnorePattern="(/ctp/rest/rtcoa/?$|/EDX/rest/dashboard/.*/bus$|/EDX/ping.json|/EDX/rest/diagnostics/ip|/EDX/rest/messaging/active/.*\.json)"
operationTimeout="400"
transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory"
@werkshy
werkshy / gist:4216495
Created December 5, 2012 15:22
Apache logs from
10.0.1.245 - - [04/Dec/2012:18:54:36 +0000] "POST /utility/j_spring_security_check HTTP/1.1" 302 2357 "https://qa-1-admin.energyhub.net/utility/autoLogout.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
10.0.1.245 - - [04/Dec/2012:18:54:37 +0000] "GET /utility/ HTTP/1.1" 302 437 "https://qa-1-admin.energyhub.net/utility/autoLogout.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
10.0.1.245 - - [04/Dec/2012:18:54:37 +0000] "GET /utility/login.html HTTP/1.1" 200 2404 "https://qa-1-admin.energyhub.net/utility/autoLogout.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
10.0.1.245 - - [04/Dec/2012:18:54:37 +0000] "GET /favicon.ico HTTP/1.1" 302 756 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
10.0.1.245 - - [04/Dec/2012:18:54:37 +0000] "GET /fa
@werkshy
werkshy / gist:4692229
Created February 1, 2013 16:08
Slow $inc commands
Fri Feb 1 15:40:01 [conn1232539] update ctp.summaryLogEvent query: { organizationId: 242, day: "20130201" } update: { $inc: { hours.15.minutes.8.o: 1 } } nscanned:1 nupdated:1 keyUpdates:0 locks(micros) w:283655 141ms
Fri Feb 1 15:40:16 [conn1232171] update ctp.summaryLogEvent query: { organizationId: 308, day: "20130201" } update: { $inc: { hours.15.minutes.19.h: 1 } } nscanned:1 nupdated:1 keyUpdates:0 locks(micros) w:1154812 577ms
Fri Feb 1 15:40:21 [conn1232813] update ctp.summaryLogEvent query: { organizationId: 317, day: "20130201" } update: { $inc: { hours.15.minutes.29.o: 1 } } nscanned:1 nupdated:1 keyUpdates:0 locks(micros) w:553760 285ms
Fri Feb 1 15:40:22 [conn1232804] update ctp.summaryLogEvent query: { organizationId: 316, day: "20130201" } update: { $inc: { hours.15.minutes.21.o: 1 } } nscanned:1 nupdated:1 keyUpdates:0 locks(micros) w:2555236 1277ms
Fri Feb 1 15:40:24 [conn1232729] update ctp.summaryLogEvent query: { organizationId: 207, day: "20130201" } update: { $inc: { hours.15.minute
@werkshy
werkshy / Example data
Created February 1, 2013 20:08
Example document
PRIMARY> db.summaryLogEvent.findOne({ organizationId: 242, day: "20130201" })
{
"_id" : ObjectId("510b0631b7458ea19c48ea32"),
"day" : "20130201",
"hours" : {
"0" : {
"minutes" : {
"0" : {
"h" : 70,
"h2" : 5,
@werkshy
werkshy / start-mysql-in-mem
Created March 29, 2013 14:37
Script to start a second mysql server using ramdisk/tmpfs for unit tests.
#!/bin/bash
DATADIR=/dev/shm/mysql
TMPDIR=/dev/shm/mysql_tmp
MYSQL_SOCKET=/dev/shm/mysql.sock
pkill -9 -f mysql.*datadir.*$DATADIR
mkdir -p $DATADIR
@werkshy
werkshy / di
Last active September 8, 2023 15:27
Digitally Imported MPD Script
#!/bin/bash
# Play a Digitally Imported station via MPD
#
# Usage:
# di list
# di trance
# di breaks
#
# Config:
@werkshy
werkshy / cr
Created October 22, 2013 18:49
Asana code review CLI
#!/usr/bin/env ruby
# cr: send an Asana ticket for code review
# It will add (or re-open) a sub-task called 'Code Review' owned
# by the specified user.
# Usage:
# cr [-a ASANA_ID] [-g GIT_COMMIT] username
#
# - If the Asana ticket ID is given, use that.
#!/usr/bin/env ruby
## git-publish-branch: a simple script to ease the unnecessarily complex
## task of "publishing" a branch, i.e., taking a local branch, creating a
## reference to it on a remote repo, and setting up the local branch to
## track the remote one, all in one go. you can even delete that remote
## reference.
##
## Usage: git publish-branch [-d] <branch> [repository]
##