Saturday, April 11, 2009

Dynamic Website Gotchas

List of things I found out trying to create xsiding.com, when I chose to eschew flash and go with fancy DHTML.
  1. ie7 has some problem with embedded sound, so use SoundManager2 (a javascript triggered flash player) to do your sounds reliably.
  2. Firefox doesn't allow negative z-index settings if you put it on a css class. Instead use an id (#layeredDiv) and you are OK.
  3. Firefox doesn't like backgroundPositionX or Y (which is actually correct since it is some IE monstrosity that Safari implements as well). You have to use backgroundPosition and set both x and y.
  4. Everyone is ok with .cur files for custom cursors, so don't bother trying png or something else. A .cur file is just an .ico file renamed. Works great with the .ico Photoshop plugin. Actually has better transparency than gif.
  5. Conditional ie code using the [if IE] or [if IE 6] thing can be very helpful since css positioning is frequently off on IE. You can improve the situation by turning off quirks mode with a strict doctype.
  6. If you set the target="_top" on an href with an onclick handler, IE ignores the onclick (IE 6,7,8)
More to come as I hit em... Notice I don't have any complaints about Safari. If anything they seem to really try to be compatible with everything... Great job Apple!

Thursday, April 2, 2009

Delete email from postfix queue containing XXX

I don' t know why no one would just put this simple info out on the web.  Here is a brain dead search and delete of the postfix queue.  It is not fast nor cool, but it works.

find /var/spool/postfix | xargs grep -l "your string" | sed -g 's|.*/||' | postsuper -d -

I am such a UNIX scripting wimp.  This should have been so easy...  Maybe that is why it wasn't on the net... ;-)

Some other aliases that answer missing postfix functions (bash):

Delete all emails with sent by the argument email address:
function delfrom() { mailq | grep "$1" | sed -g 's|\ .*$||'| postsuper -d - ;}

How many emails are in the queue going to a given host:
function hostq() { mailq | grep "\@$1" | wc -l ;}