The Noble Art of Maintenance Programming

Posted in IT StuffTagged

Yes, I am a big fan of code readability and refactoring. I always have in mind this: Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it? – Brian Kernighan….

Delete Files Older Than x Days on Linux

Posted in IT StuffTagged

Command Syntax find /folder/files* -mtime +15 -exec rm {} \;find /folder/files* -mtime +15 -exec rm {} \; The first argument is the path to the files. This can be a path, a directory, or a wildcard as in the example above. The second argument, -mtime, is used to specify the number of days old that….

How do I fix a 65535 bytes limit Stacktrace?

Posted in IT StuffTagged ,

It is possible that after an upgrade you may encounter this error on some of the more complex pages and root cause provided by tomcat console is : To solve the issue you need to locate the file [Tomcat_Home]/conf/web.xml and search the file for ‘JspServlet’. This should return an xml node of containing some values…..

How to kill all processes with a given (partial) name?

Posted in IT StuffTagged ,

Usually I open more than on instance of tail -f to monitor my application, so, to kill all with one single command I can use this: ps -ef | grep tail | grep -v grep | awk ‘{print $2}’ | xargs kill -9ps -ef | grep tail | grep -v grep | awk ‘{print $2}’….

MappingJacksonHttpMessageConverter not found

Posted in IT StuffTagged , ,

I was trying to run a java batch that call an application context without success (it’s a java app that calls a Camel spring context). This is what I get during the startup: ERROR ApplicationProperties @ addApplicationProperty [28] org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [/MessageRouting/src/test/resources/META-INF/spring/LOCALHOST-db-context.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/http/converter/json/MappingJacksonHttpMessageConverter Fatal error! java.lang.RuntimeException:….

Which log4j configuration are you using?

Posted in IT StuffTagged ,

Sometimes log4j is not working properly and you need to verify where it is actually writing the log entries. This can be easily verified turning on the log4j.debug: -Dlog4j.debug-Dlog4j.debug It will print to System.out lots of helpful information about which file it used to initialize itself, which loggers / appenders got configured and how etc.

Looking for new challenge – Day #7

Replied to more than 20 job offers. No replies. Too much experience? If found this article really interesting about the relocation: Relocation? No way! But please, keep requiring it by @alobbs Consider this, here in Italy the job offers are for something absolutely not interesting (in some case really boring) and / or not honestly….

Parse an unknown JSON with Jquery

Posted in IT StuffTagged , , ,

Sometime it happens to receive a JSON string than need to be visualized without knowing the structure. Suppose we have an HTML table: <tbody id="reportTable"> </tbody><tbody id="reportTable"> </tbody> To populate this table with jQuery it’s possible to use this simple code: var rows = ${reportRows}; var html = $.each(rows, function(key, value){   $("#reportTable").append("<tr>");   $.each(value,….

Looking for new challenge – Day #1

Posted in Uncategorized

It’s clear. I need to move on. Prospective are not so rosy. What’s the next step? Anguish. (Poetry 2.0)