Difference between revisions of "User:Pavila"

From OpenKM Documentation
Jump to: navigation, search
m
Line 34: Line 34:
 
<source lang="bash">
 
<source lang="bash">
 
find -name "*.okm" -exec sed -i 's/<font>//g' {} \;
 
find -name "*.okm" -exec sed -i 's/<font>//g' {} \;
find -name "*.okm" -exec sed -i 's/</font>//g' {} \;
+
find -name "*.okm" -exec sed -i 's/<\/font>//g' {} \;
 
find -name "*.okm" -exec sed -i 's/<font class="">//g' {} \;
 
find -name "*.okm" -exec sed -i 's/<font class="">//g' {} \;
 
</source>
 
</source>

Revision as of 19:00, 12 April 2013

OpenKM Core developer.

Application with CLOSE_WAIT

sudo netstat -tonp | grep CLOSE_WAIT

See:

File descriptors used by Tomcat

sudo lsof -p $(ps -ef | grep java | grep tomcat | awk '{ print $2 }') | wc -l

Show charset and locale configuration

import java.util.*;
import java.nio.charset.*;

print("Charset: " + Charset.defaultCharset()+"<br/>");
print("Locale: " + Locale.getDefault()+"<br/>");

Show Java version

print("Java Vendor: " + System.getProperty("java.vm.vendor")+"<br/>");
print("Java Version: " + System.getProperty("java.version")+"<br/>");

Fix permissions

find -name "*.okm" -exec sed -i 's/<font>//g' {} \;
find -name "*.okm" -exec sed -i 's/<\/font>//g' {} \;
find -name "*.okm" -exec sed -i 's/<font class="">//g' {} \;

If you have problems read How to set up a clean UTF-8 environment in Linux.

Find duplicates - HSQL

select nd.uuid, nd.name, ndv.checksum from NodeDocument nd, NodeDocumentVersion ndv where nd.uuid = ndv.parent and ndv.checksum in 
  (select ndv.checksum from NodeDocumentVersion ndv where ndv.current = true group by ndv.checksum having count(ndv.checksum) > 1) 
order by ndv.checksum, nd.name;

Find duplicates - SQL

select NBS_UUID, NBS_NAME, NDV_CHECKSUM from OKM_NODE_BASE, OKM_NODE_DOCUMENT_VERSION where NBS_UUID = NDV_PARENT and NDV_CHECKSUM in 
  (select NDV_CHECKSUM from OKM_NODE_DOCUMENT_VERSION where NDV_CURRENT='T' group by NDV_CHECKSUM having count(NDV_CHECKSUM) > 1)
order by NDV_CHECKSUM, NBS_NAME;

Find documents with assigned roles

select count(*) from NodeDocument nd where size(nd.rolePermissions) > 0; -- Slower
select count(*) from NodeDocument nd where exists elements(nd.rolePermissions); -- Faster

Find documents with a keyword

from NodeDocument nd where 'xxx' in elements(nd.keywords);

Find documents with a role

from NodeDocument nd left join nd.rolePermissions as rolePerms where index(rolePerms) = 'ROLE_USER';

Show documents in trash

select nbase.NBS_UUID, nbase.NBS_NAME, nbase.NBS_CONTEXT from OKM_NODE_DOCUMENT ndoc, OKM_NODE_BASE nbase where ndoc.NBS_UUID = nbase.NBS_UUID and NBS_CONTEXT='okm_trash';

TO DO

Books

See also