Monday, September 29, 2008

Tomcat 5.5 and JSTL

How to use JSTL tag library with Tomcat 5.5 and Maven:
  1. Add Maven dependencies:
  2. Make sure you use at least Servlet version 2.4 in web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="" xmlns:xsi=""
  3. Add declaration in your JSP file:
    <%@ taglib prefix="c" uri="" %>
  4. Use JSTL tags:
    <c:set var="conditionValue" value="${true}"/>
    <c:if test="${conditionValue}">

Sunday, March 16, 2008

Timed Screenshots on Mac

When working as a time-based contractor, recording spent time in "time manager" is sometimes problematic and always tedious. It happened to me that at the end of the day I have trouble recalling what tasks did I do and it what proportions. Now maybe this little shell script can help me:

# Makes screenshots every $PERIOD minutes 
# and puts them into /var/tmp/screens/ directory.  

for ((i=0; i<=10*60/PERIOD; i+=1)); do
    FILENAME=/var/tmp/screens/screen`date +%y%m%d_%H%M`.png
    echo Capturing $FILENAME...
    screencapture $FILENAME
    echo Done, next capture in $(($PERIOD*60)) seconds.
    sleep $(($PERIOD*60))