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:2931870
Created June 14, 2012 18:07
Headers for MSM sessionId re-use problem
=== Request: POST username and password (posted from login.html) ===
POST /EDX/j_spring_security_check HTTP/1.1
Host: localhost
Connection: keep-alive
Content-Length: 54
Cache-Control: max-age=0
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5
Content-Type: application/x-www-form-urlencoded
@werkshy
werkshy / gist:2932371
Created June 14, 2012 19:24
m-s-m timeout with session-fixation-prevention enabled
FINE: <<<<<< Request finished: GET /EDX/login.html ==================
Jun 14, 2012 3:08:44 PM de.javakaffee.web.msm.ReadOnlyRequestsCache modifyingRequest
FINE: Registering modifying request: GET /EDX/login.html
Jun 14, 2012 3:09:01 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /EDX/j_spring_security_check (requestedSessionId 9A0BAF5E3E4296D251F0382B785AB3E7-n1) ==================
Jun 14, 2012 3:09:01 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /EDX/j_spring_security_check (requestedSessionId 9A0BAF5E3E4296D251F0382B785AB3E7-n1) ==================
Jun 14, 2012 3:09:01 PM de.javakaffee.web.msm.SessionIdFormat createSessionId
FINE: Creating new session id with orig id 'ping' and memcached id 'n1'.
Jun 14, 2012 3:09:01 PM de.javakaffee.web.msm.NodeAvailabilityCache updateIsNodeAvailable
@werkshy
werkshy / gist:2961723
Created June 20, 2012 19:33
Testing jars attached to #143
Jun 20, 2012 3:29:29 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /EDX/j_spring_security_check (requestedSessionId 48EB1F5F2907DC391846C183332D0A08-n1) ==================
Jun 20, 2012 3:29:29 PM de.javakaffee.web.msm.RequestTrackingHostValve invoke
FINE: >>>>>> Request starting: POST /EDX/j_spring_security_check (requestedSessionId 48EB1F5F2907DC391846C183332D0A08-n1) ==================
Jun 20, 2012 3:29:29 PM de.javakaffee.web.msm.SessionIdFormat createSessionId
FINE: Creating new session id with orig id 'ping' and memcached id 'n1'.
Jun 20, 2012 3:29:29 PM de.javakaffee.web.msm.NodeAvailabilityCache updateIsNodeAvailable
FINE: CacheLoader returned node availability 'true' for node 'n1'.
Jun 20, 2012 3:29:29 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
@werkshy
werkshy / sleeper-0.2
Created August 25, 2012 02:44
Sleeper: a tool to suspend your PC under lightweight window managers
#!/bin/bash
# Sleeper: a tool to suspend your PC under lightweight window managers
# By Andy O'Neill <andy@potatoriot.com> 2012
# Released to the public domain
# Depends on xprintidle & console-kit (apt-get install xprintidle console-kit)
# Usage: just launch it from your .xinitrc or whatever you use to launch your WM
# e.g. sleeper &
@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,