Tuesday, November 08, 2005

Code from the genius himself

from the worst-code-ever-dept.

/**
* @author root
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/

Sunday, November 06, 2005

favicon.ico 404

Favicons are small (16x16 or 32x32 pixels) page icons displayed in the browsers addressbar or your favorites listings (hence: favorites icon). Most modern browsers support favicons and therefore send a http request for either /facicon.ico or whatever is specified in the <link rel="icon"...> tag specified in the header of the page. If the favicon.ico file does not exist browsers show a standard icon and ignore error responses from the server. Simlarly many web servers filter favicon related error messages to keep their error logs readable.

If the favicon.ico file resides in a protected directory (which is likely if the context root is protected) browsers get confused and display a resource not found (404 ) error message. When a browser is pointed to http://somehost.com/ it requests the favicon file /favicon.ico. However since / is protected the browser is redirected to the login page. After specifying the correct login and password, the favicon is loaded and shown - but not the content of / (e.g. index.html).

To solve the problem save the favicon file in a public context or specifically allow access to the file. For example:

<security-constraint>
<web-resource-collection>
<web-resource-name>restricted</web-resource-name>
<url-pattern>/public/favicon.ico</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
</security-constraint>

Then in the header of the login page specify the location of the icon file
<link rel="icon" href="public/favicon.ico" />
<link rel="shortcut icon" href="/public/favicon.ico" />

Tuesday, November 01, 2005

ClamXav & Fink

ClamXav comes with its own installer for the clamav engine. The installer, however, is not as frequently updated as is the clamav engine itself, yielding:

LibClamAV Warning: ********************************************************
LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/faq.html ***
LibClamAV Warning: ********************************************************



in the log files. The fink version of clamav is much more recent. To make clamXav use the fink version follow this procedure:
  1. Download the lastest clamXav (if this is the first install preceed like here: http://www.clamxav.com/index.php?page=FAQ
  2. Run the removeEngine script
  3. Run fink install clamav
  4. Run fink install clamav-daemon
  5. Edit ~/Library/Preferences/uk.co.markallan.clamxav.plist and set User Defined clamav Path to /sw (or whereever your fink installation is)
  6. If not already there copy ClamXav to /Applications