Tuesday, January 31, 2012

linux: Searching in command history

This is a great trick for everyone who uses linux console a lot.

1. Ctrl+R in console
2. Enter search string
3. OS suggests you a line from command history
4. If you want an older command with same search string, just hit Ctrl+R.
5. that's all folks

Monday, January 23, 2012

EJBCA with jboss

EJBCA 4.07 supports jBoss version 5.1 but not jboss 6.0 or jboss 7.0. I checked with jboss web profile and with full version too.

The error message is in ant command

ant bootstrap

The error was:

"package javax.ejb does not exist"


So how i resolved it? I returned to jboss 5.1. :(

Thursday, January 5, 2012

Optimizing queries with EXPLAIN

The explain command gives information about indexes which are used for the query, so you could check, whether it is optimized as you expected.

Tuesday, January 3, 2012

Problem with WebDAV folders in debian linux

Here is my problem:

When I try to copy some files / folders to webdav folder, I get an error in Windows XP and this log in my Linux box:

[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] File does not exist: /the/webdav/folder/some-file.JPG
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] The locks could not be queried for verification against a possible "If:" header. [500, #0]
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] Could not open the lock database. [500, #400]
[Tue Jan 03 13:49:35 2012] [error] [client 123.123.123.123] (2)No such file or directory: Could not open property database. [500, #1]

Monday, December 19, 2011

Connecting to HTTPS site with specific certificate in PHP

Here is an example how you could connect to a server, which requires that you identify yourself with a certificate.
Your certificate and the server certificate are signed by an authority whose certificate is in ca.ctr.

Wednesday, December 14, 2011

Match multiple patterns with a single regex expression

I wanted to add multiple patterns to single regex expression. Such as password check. For example:

Friday, October 21, 2011

solved maven error "NoClassDefFoundError" ComponentLifecycleException


niskia:/xxyyzz# mvn jar:jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/component/repository/exception/ComponentLifecycleException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.getMethods(Class.java:1410)
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 9 more

The solution was reinstalling maven. For debian is done by:

apt-get remove maven2
apt-get install maven2