Skip to content

Instantly share code, notes, and snippets.

@juven
juven / db log
Created December 12, 2011 16:11
db log
00:09:21,927 DEBUG JDBCTransaction:83 - current autocommit status: true
00:09:21,927 DEBUG JDBCTransaction:86 - disabling autocommit
00:09:21,944 DEBUG AbstractBatcher:410 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
00:09:21,945 DEBUG SQL:111 - select count(*) as y0_ from unknown_artifact this_
Hibernate: select count(*) as y0_ from unknown_artifact this_
00:09:21,960 DEBUG GooGooStatementCache:457 - cxnStmtMgr.statementSet( com.mysql.jdbc.JDBC4Connection@698fe8fc ).size(): 1
00:09:21,961 DEBUG GooGooStatementCache:196 - checkoutStatement: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 1; checked out: 1; num connections: 1; num keys: 1
00:09:21,964 DEBUG AbstractBatcher:426 - about to open ResultSet (open ResultSets: 0, globally: 0)
00:09:21,964 DEBUG Loader:1322 - result row:
00:09:21,966 DEBUG AbstractBatcher:433 - about to close ResultSet (open ResultSets: 1, globally: 1)
@juven
juven / gist:1589558
Created January 10, 2012 15:17
ossrh thread dump
in the threaddump of ossrh, I found about 30 threads blocked by 0x0000000058151000] with similar stackstrace
jvm 1 | "195956184@qtp-1400799112-16610" prio=10 tid=0x00002aaabe0ad800 nid=0x518d waiting for monitor entry [0x0000000058151000]
jvm 1 | java.lang.Thread.State: BLOCKED (on object monitor)
jvm 1 | at org.sonatype.security.realms.tools.AbstractConfigurationManager.getConfiguration(AbstractConfigurationManager.java:30)
jvm 1 | - waiting to lock <0x00000000c0679470> (a org.sonatype.security.realms.tools.ResourceMergingConfigurationManager)
jvm 1 | at org.sonatype.security.realms.tools.ResourceMergingConfigurationManager.getConfiguration(ResourceMergingConfigurationManager.java:489)
jvm 1 | at org.sonatype.security.realms.tools.ResourceMergingConfigurationManager.readRole(ResourceMergingConfigurationManager.java:323)
jvm 1 | at org.sonatype.security.usermanagement.xml.SecurityXmlUserManager.toRole(SecurityXmlUserManager.java:130)
bash-3.2$ diff current/runtime/apps/nexus/conf/ehcache.xml nexus-professional-2.0/nexus/WEB-INF/classes/ehcache.xml
4,19c4,13
< Copyright (c) 2008-2011 Sonatype, Inc.
< All rights reserved. Includes the third-party code listed at http://www.sonatype.com/products/nexus/attributions.
<
< This program is free software: you can redistribute it and/or modify it only under the terms of the GNU Affero General
< Public License Version 3 as published by the Free Software Foundation.
<
< This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
< warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License Version 3
3621212 4 drwxr-xr-x 3 nexus nexus 4096 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base
3621217 4 -rw-r--r-- 1 nexus nexus 319 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base/maven-metadata.xml
3621221 4 -rw-r--r-- 1 nexus nexus 40 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base/maven-metadata.xml.sha1
3621223 4 -rw-r--r-- 1 nexus nexus 32 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base/maven-metadata.xml.md5
3621227 4 drwxr-xr-x 2 nexus nexus 4096 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base/1.0.2
3621228 4 -rw-r--r-- 1 nexus nexus 486 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-base/1.0.2/osgi-javaee-base-1.0.2-javadoc.jar.asc
3621231 4 -rw-r--r-- 1 nexus nexus 40 Feb 21 13:23 ./orgglassfish-002/org/glassfish/fighterfish/osgi-javaee-ba
@juven
juven / gist:3121028
Created July 16, 2012 06:11
how to use customized c# attributes
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace RTP_Composite
{
[TestClass]
public class AttributeSpike
{
@juven
juven / trello_json_to_xls.rb
Created March 5, 2013 02:33
export your data in Trello and use this script to covert the exported json to xls
require 'json'
require 'spreadsheet'
if ARGV.size < 2
puts 'Usage: ruby trello_to_csv.rb input.json output.xls'
exit 1
end
@json_file = ARGV[0]
@xls_file = ARGV[1]
@juven
juven / gist:5318861
Last active December 15, 2015 20:29
272) null returned by binding at org.sonatype.guice.bean.binders.LocatorWiring
but parameter 0 of org.eclipse.aether.internal.impl.Slf4jLoggerFactory.<init>() is not @Nullable
while locating org.slf4j.ILoggerFactory
for parameter 0 at org.eclipse.aether.internal.impl.Slf4jLoggerFactory.<init>(Slf4jLoggerFactory.java:66)
while locating org.eclipse.aether.internal.impl.Slf4jLoggerFactory
while locating java.lang.Object annotated with *
at org.sonatype.guice.bean.binders.LocatorWiring
while locating org.eclipse.aether.spi.log.LoggerFactory
for parameter 1 at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.<init>(DefaultUpdateCheckManager.java:77)
while locating org.eclipse.aether.internal.impl.DefaultUpdateCheckManager
juven@juvens-mac Sandbox$ sudo tcpdump -v -i en1 | grep "180\.149"
tcpdump: listening on en1, link-type EN10MB (Ethernet), capture size 65535 bytes
10.18.214.201.49159 > 180.149.134.227.jabber-client: Flags [P.], cksum 0x24dd (correct), seq 80830300:80830353, ack 3786364426, win 8192, options [nop,nop,TS val 1557572090 ecr 1283918751], length 53
10.18.214.201.49159 > 180.149.134.227.jabber-client: Flags [FP.], cksum 0xfe58 (correct), seq 53:90, ack 1, win 8192, options [nop,nop,TS val 1557572090 ecr 1283918751], length 37
180.149.134.227.jabber-client > 10.18.214.201.49159: Flags [.], cksum 0x2308 (correct), ack 53, win 29, options [nop,nop,TS val 1283945313 ecr 1557572090], length 0
10.18.214.201.49159 > 180.149.134.227.jabber-client: Flags [F.], cksum 0x02dc (correct), seq 90, ack 1, win 8192, options [nop,nop,TS val 1557572125 ecr 1283945313], length 0
180.149.134.227.jabber-client > 10.18.214.201.49159: Flags [F.], cksum 0x22e1 (correct), seq 1, ack 91, win 29, options [nop,nop,TS val
puts "METHOD,CASE,DESCRIPTION,PRE,SCENARIO,PRIORITY"
basedir = ARGV[0]
def get_tag_value(tag, file)
File.open(file, 'r') do |f|
f.each do |line|
pattern = Regexp.new("(^\\*+ +)(#{tag}) ([^\\r\\n]*)")
begin
BEGIN {
FS = ","
bytes_created = 0
bytes_wrote = 0
bytes_deleted = 0
}
$4 == "createFile" {
bytes_field_length = length($10)
bytes_created += substr($10, 3, bytes_field_length-3)