September 2009
2 posts
Writing The Delete view in Lift →
Writing a View Page in Lift →
August 2009
3 posts
Writing a Create Form in Lift →
Lift: Listing the entities without CRUDify →
Simple Lift CRUD →
October 2008
1 post
Using Hibernate in Grails to Drop and Create... →
September 2008
3 posts
Maven dependencies
Nice little tool to show your maven dependencies at http://www.jfrog.org.
Splitting up your Grails resources.groovy file →
Grails And Spring Batch →
August 2008
1 post
Grails Simple Captcha Plugin →
June 2008
2 posts
Find out information on a solaris process
/usr/ucb/ps -auxww | grep 23914
where you grep for a process id that could be obtained using prstat
In oracle add predicate based on dates
activity_time >= to_date( ‘11-MAY-2008’,’dd-MM-yyyy’)
May 2008
1 post
svn checkout with long paths
Using svn windows binary to check out files with a long path causes an error i.e. using the command svn co https://mysvnrepo.com/mycode pathToCheckout/dir to check out some code gives A pathToCheckout\dir\pathOne\src\main\resources\local\testdata\ getDataMocksvn: Your .svn/tmp directory may be missing or corrupt; run ‘svn cleanup’ and try againsvn: Can’t open file ’...
April 2008
2 posts
Load Java.util.Properties from a file in Spring...
Inject properties into you spring beans using PropertiesFactoryBean and set the file location using setLocation.
svnadmin: Can't stat directory
If you get this error
“svnadmin: Can’t stat directory ‘myRepo’: Partial results are valid but processing is incomplete”
when running svnadmin create myRepo check that the version svn you have on your path matches the version you have on the server.
March 2008
1 post
Maven, Hudson and Windows Default User Gives Disk...
When you deploy Hudson to Apache Tomcat and run Tomcat as default user maven sets the repository to be ~/.m2/repository (which is normally C:\Documents and Settings\Default User.m2/repository). Unfortunately windows will also copy that directory every time a new user logs on to that box. So in our case we ended up with 2GB of repeated repository.
Solution
Change your maven ‘settings.xml’...
February 2008
3 posts
Convert ssl certificate from .cer to .pem
openssl x509 -in inputfile.cer -inform d -out file.pem
Find out what sessions are connect to a oracle...
select * from V$SESSION
Find the version of oracle you are running
select * from v$version
where banner like ‘Oracle%’;
January 2008
5 posts
Linux Job Control
While running a job you can suspend a job using ctrl -z or terminate a job using ctrl -c.
You can list the current jobs using the command jobs. The list will show a number next to each job. You can control each job referencing using these numbers.
A job can be moved to the foreground by fg %N .
A job can be moved to the background by bg %N .
A job can be killed by kill %N && fg.
A...
Stopping maven checking for new snapshots
If you are having problems building with maven because it’s trying to grab online resources try running mvn –o …. It won’t work if there are missing dependencies but it will stop it check online for new snapshots.
Delete all the text in a file in vi
Go to the start of the file and type not in edit mode and type dG
Object-Oriented Software Metrics
The levels to strive for An application should consist of no more than 40 stories and no more than 100 classes. The application’s entire business domain should not require more than 1000 classes. 25-30% of the code should be discarded after each iteration. Responsibilities per class: average of 7. Methods per class: average of 12. Lines of code per method: ...
Getting round "Terminal Server Has Exceeded the...
Connect to the server using ‘mstsc /v:servername /f /console’ if the server is running windows server 2003. Credit to http://geeksaresexy.blogspot.com/2007/02/rdp-magic.html
November 2007
8 posts
Get Axis to log all Http Request
Put log4j.category.org.apache.axis.transport.http.HTTPSender=debug,stdout in the log4j configuration.
Launching links from office documents
If you click a link form a MS office document (excel, word etc) and that link gives you back a HTTP 302 response I found that two requests were made for the destination of the 302.
i.e Fiddler logs
302 http://www.myserver/mypage (gives back 302 to http://www.myserver/myloginpage)
200 http://www.myserver/myloginpage
200 http://www.myserver/myloginpage
Strangely this didn’t...
Wondering where the plugin config goes on...
The websphere apache plugin gets written to /opt/Websphere/AppServer/config/cells/plugin-cfg.xml
IBM Websphere Application Server Process id
Finding the process of a Websphere application server can be hard work since it just shows up as a java process. The good news is that the process id (pid) of a Websphere application server is written into a folder in the logs directory with the format {application-server-name}.pid you can cat that file to find the process number. If this file is there it means the process is still running even if...
Run Javascript from your browser address bar.
By writing javascript: followed by the java script you want to execute in your browser address bar you can execute java script. For example javascript:alert(new Date()) will bring a alert with the current time set. Using this method you can do things like view cookies set in the current document by using javascript:alert(document.cookie) .
Websphere requestURL with ? in path
I was trying to use friendly URLs in Websphere where the path includes encoded ‘?’ (Hex %3F). Calling HTTPServletRequest.getRequestURL() on Websphere only returns the path up to the first %3F.
This means that the value returned for a URL such as http://myserver/mypage/what-u-say%3F/id/123/videodetail.do would be http://myserver/mypage/what-u-say .
It looks like this method is performing...
IBM Websphere Apache restart
To restart websphere apache server go into IBNIHS/bin directory. In our environments this is under /opt/. Run ./apachectl stop or /apachectl start to stop or start the apache box.
IE cookies and framesets
Got caught out by this today http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q323752 . We were using a nested frameset where the outer frameset was a different domain from the inner one. One to watch out for if your cookies start to disappear in IE. I’m not sure how firefox handles this. Fixed it by adding the header like they suggest in the link.