Skip to content

Instantly share code, notes, and snippets.

@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
{
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
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
@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)
@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 / gc
Created November 14, 2011 15:51
gc
bash-3.2$ /opt/java/sdk/current/bin/jstack -l 4482
2011-11-14 09:50:10
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0000000040a29800 nid=0x5e2b waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
--delete
0:00am (148m) sent 90163832 bytes received 6124 bytes 10304.55 bytes/sec
4:00am (150m) sent 133433213 bytes received 39736 bytes 14975.93 bytes/sec
-- del
8:00am (106m) sent 210545136 bytes received 133064 bytes 34131.75 bytes/sec
[maven@sonatype-central02 logs]$ ps -ef | grep rsync
maven 6309 20317 1 08:12 ? 00:00:04 rsync --exclude-from=/home/maven/bin/synchronize/syncopate/exclusions-nexus.txt --ignore-existing -Lrtivz --rsh=ssh [email protected]:/x1/nexus-work/storage/releases/org/apache/ /home/maven/repository-staging/to-ibiblio/maven2/org/apache/
maven 6312 6309 0 08:12 ? 00:00:00 ssh -l central repository.apache.org rsync --server --sender -vLtrz . /x1/nexus-work/storage/releases/org/apache/
maven 8011 6309 0 08:12 ? 00:00:00 rsync --exclude-from=/home/maven/bin/synchronize/syncopate/exclusions-nexus.txt --ignore-existing -Lrtivz --rsh=ssh [email protected]:/x1/nexus-work/storage/releases/org/apache/ /home/maven/repository-staging/to-ibiblio/maven2/org/apache/
maven 10758 10750 1 06:30 ? 00:01:06 rsync -avz --delete /data/repositories/to-ibiblio/maven2 172.16.1.3:/data/repositories/to-ibiblio/
maven 10759 10758 0 06:30 ? 00:00:05 ssh 172.16.1.3
2011-09-14 08:29:27 INFO [er_start_runner] - o.s.p.a.SimpleAppli~ - Unexpected exception in listener, continuing listener notification.
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, java.lang.IllegalStateException: Could not start up H2DatabaseManager components!
at com.sonatype.nexus.licensing.api.access.h2.H2UserIPTracker.<init>(Unknown Source)
at file:/home/nexus/nexus-professional-webapp-1.9.2.2/./runtime/apps/nexus/plugin-repository/nexus-licensing-plugin-1.9.2.2/nexus-licensing-plugin-1.9.2.2.jar!/
while locating com.sonatype.nexus.licensing.api.access.h2.H2UserIPTracker
while locating com.sonatype.nexus.licensing.api.access.UserIPTracker annotated with @com.google.inject.name.Named(value=h2)
for field at com.sonatype.nexus.licensing.api.access.UserIPEventInspector.usersIpTracker(Unknown Source)
at file:/home/nexus/nexus-professional-webapp-1.9.2.2/./runtime/apps/nexus/plugin-repository/nexus-licensing-plugin-1.9.2.2/nexus-licensin
Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement " CREATE TABLE hash_file ( sha1 varchar(41) NOT NULL, container_sha1 varchar(41) default NULL, path varchar(400) NOT NULL, fileSize int(11) NOT NULL, "; expected "identifier"; SQL statement:
CREATE TABLE hash_file ( sha1 varchar(41) NOT NULL, container_sha1 varchar(41) default NULL, path varchar(400) NOT NULL, fileSize int(11) NOT NULL, -- This could be joined in from the hash table, but that may be pointless. lastModified bigint(20) NOT NULL, CONSTRAINT hash_file_pk PRIMARY KEY (sha1, path, filename, extension), CONSTRAINT hash_file_fk FOREIGN KEY (sha1) REFERENCES hash(sha1) CON