Thursday 16 April 2009

Word of the week: Slack

This one was inspired by my friend Richard Kolb's favorite distro: http://www.slackware.com/
which by the way has a new South-african derivative: http://www.kongoni.co.za/
This may not be that informative, but its still fun to call slackware lazy, weak, tardy, late, idle, quiet and slowing :)

slack

–adjective
1. not tight, taut, firm, or tense; loose: a slack rope.
2. negligent; careless; remiss: slack proofreading.
3. slow, sluggish, or indolent: He is slack in answering letters.
4. not active or busy; dull; not brisk: the slack season in an industry.
5. moving very slowly, as the tide, wind, or water.
6. weak; lax.
7. Nautical. easy (def. 15a).
–adverb
8. in a slack manner.
–noun
9. a slack condition or part.
10. the part of a rope, sail, or the like, that hangs loose, without strain upon it.
11. a decrease in activity, as in business or work: a sudden slack in output.
12. a period of decreased activity.
13. Geography. a cessation in a strong flow, as of a current at its turn.
14. a depression between hills, in a hillside, or in the land surface.
15. Prosody. (in sprung rhythm) the unaccented syllable or syllables.
16. British Dialect. a morass; marshy ground; a hollow or dell with soft, wet ground at the bottom.
–verb (used with object)
17. to be remiss in respect to (some matter, duty, right, etc.); shirk; leave undone: He slacked the most important part.
18. to make or allow to become less active, vigorous, intense, etc.; relax (efforts, labor, speed, etc.); lessen; moderate (often fol. by up).
19. to make loose, or less tense or taut, as a rope; loosen (often fol. by off or out).
20. to slake (lime).
–verb (used without object)
21. to be remiss; shirk one's duty or part.
22. to become less active, vigorous, rapid, etc. (often fol. by up): Business is slacking up.
23. to become less tense or taut, as a rope; to ease off.
24. to become slaked, as lime.
25. take up the slack,
a. to pull in or make taut a loose section of a rope, line, wire, etc.: Take up the slack before releasing the kite.
b. to provide or compensate for something that is missing or incomplete: New sources of oil will take up the slack resulting from the embargo.

Origin:
bef. 900; ME slac (adj.), OE sleac, slæc; c. ON slakr, OHG slach, L laxus lax


slack⋅ing⋅ly, adverb
slackly, adverb
slackness, noun


1. relaxed. 2. lazy, weak. 3. dilatory, tardy, late. 4. idle, quiet. 11. slowing, relaxation. 17. neglect. 18. reduce, slacken. 21. malinger.
http://dictionary.reference.com/search?q=slack

sweet ubuntu commandline network trafic monitor

sudo apt-get install iftop
sudo iftop -Bp

I looked at the other recommendations at:
http://ubuntuforums.org/showthread.php?t=965242
but I thing I prefer iftop at the moment.

I wish I could see which processes are using the bandwidth,
but that would probably involve a lot of magic.

Tuesday 14 April 2009

Alfresco pain

After struggling a lot, I finally got Alfresco running on my Glassfish (v2ur2-b04),
for a couple of minutes then it broke again. I'll update this if I get it working one day.

First of all, look at the following for how to install using an oracle db.
http://wiki.alfresco.com/wiki/Database_Configuration
Which worked mostly, except it seems like you have to use the AlfrescoOracle9Dialect eg.:
hibernate.dialect=org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect


Initially I got the following exceptions:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.

and
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Lj
ava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
This was fixed by putting the correct hibernate jars in the domain1/lib and domain1/lib/ext folders.
I put asm-attrs.jar, cglib-2.1.3.jar, ojdbc14_g.jar (for oracle) in domain1/lib and
asm.jar, serializer.jar, xalan.jar in domain1/lib/ext


Next when I tried to log into the share webapp, I got the following:
"The remote server may be unavailable or your authentication details have not been recognized."
Thanks to the following link I figured out that alfresco does not like to run on a different port the server port is hardcoded into the war files in several places:
http://forums.alfresco.com/en/viewtopic.php?f=8&t=13625&start=15&st=0&sk=t&sd=a&hilit=The+remote+server+may+be+unavailable+or+your+authentication+details+have+not+been+recognised#p45826

Since I'd like to run it on a non-default port, I updated the port number by replacing all occurrences of 8080 with 12080.

I'm lazy so I did it like this:
$ cd domain1
$ replace 8080 12080 -- `find -iname "*.wsdl"`
$ replace 8080 12080 -- `find -iname "*.xml"`
$ replace 8080 12080 -- `find -iname "*.ftl"`
(btw this replace command I used is part of mysql-server-5.0: /usr/bin/replace)
See
http://wiki.alfresco.com/wiki/Changing_Default_Port_Configuration for more info.


Next I got this exception in my logs:

org.alfresco.web.framework.exception.RendererExecutionException: Unable to execute 'body' JSP include: /site-index.jsp
Caused by: java.lang.ClassCastException: org.alfresco.tools.FakeHttpServletResponse cannot be cast to org.apache.coyote.tomcat5.CoyoteResponseFacade

I found a fixed up version of alfresco-web-framework.jar which goes in domain1/applications/j2ee-modules/share/WEB-INF/lib on this forum:
http://forums.java.net/jive/thread.jspa?threadID=58906
Now I could actually log in.


But somewere along the line I got the following:
org.alfresco.web.framework.exception.RendererExecutionException: FreemarkerProcessor failed to process template: org/alfresco/global/slingshot-login.ftl
Caused by: freemarker.core.InvalidReferenceException: on line 32, column 70 in org/alfresco/global/slingshot-login.ftl link not found.
on line 32, column 70 in org/alfresco/global/slingshot-login.ftl link not found.
The problematic instruction:
----------
==> user-directive link [on line 32, column 70 in org/alfresco/global/slingshot-login.ftl]
in user-directive template.body [on line 6, column 1 in org/alfresco/global/slingshot-login.ftl]
and what fixed it for me AFAICT is to add the sun-web.xml described here:
http://blogs.sun.com/mandy/entry/alfresco_on_glassfish_short_version

mm.. seems like everything is not working for me yet. I have to switch between the patched and the original versions of alfresco-web-framework.jar (i.e log in with the one and play further with the other)

I'm doing a svn checkout at the moment to see if the developent verion works better on glassfish.
Maybe I can submit some patches if necessary.

Wednesday 8 April 2009

Looking for unread gmail

I was trying to get look at only my unread e-mail under a particular label. It turns out you can search your mail with is:unread

There are other tricks too, have a look at this:
https://mail.google.com/support/bin/answer.py?answer=7190

Jaunty Jackalope (Ubuntu 9.04) is coming soon

It is expected to be released on the 23rd of April 2009.