<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>geekgeekgeek</title>
	<link>http://geekgeekgeek.antithetical.org</link>
	<description>geeky stuff</description>
	<pubDate>Thu, 10 Jul 2008 12:52:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>javascript open tab browser link</title>
		<link>http://geekgeekgeek.antithetical.org/2008/07/javascript-open-tab-browser-link/</link>
		<comments>http://geekgeekgeek.antithetical.org/2008/07/javascript-open-tab-browser-link/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 12:52:56 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>javascript</category>
	<category>browser</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2008/07/javascript-open-tab-browser-link/</guid>
		<description><![CDATA[Someone just asked me how to open a link in a new tab with JavaScript (in Firefox). I thought it couldn&#8217;t be done. Went looking for confirmation, and discovered that it can be done, sort of. This post by Larry Williams from March 2005 explains how to open a new tab with JavaScript (from an [...]]]></description>
			<content:encoded><![CDATA[<p>Someone just asked me how to open a link in a new tab with JavaScript (in Firefox). I thought it couldn&#8217;t be done. Went looking for confirmation, and discovered that it can be done, sort of. This post by Larry Williams from March 2005 explains <a class="ext external" href="http://www.jroller.com/larrywilliams/entry/opening_new_tabs_with_javascript">how to open a new tab with JavaScript</a> (from an extension).  However the current top-ranked link to this post on Google inexplicably points to a non-existent entry from January 2005 instead. I&#8217;m posting this spider-friendly corrected pointer as a public service announcement. You&#8217;re welcome.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2008/07/javascript-open-tab-browser-link/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>pluginreg.dat + flash + DO NOT WANT</title>
		<link>http://geekgeekgeek.antithetical.org/2008/06/pluginregdat-flash-do-not-want/</link>
		<comments>http://geekgeekgeek.antithetical.org/2008/06/pluginregdat-flash-do-not-want/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 10:28:38 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>Uncategorized</category>
	<category>plugins</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2008/06/pluginregdat-flash-do-not-want/</guid>
		<description><![CDATA[I don&#8217;t think I&#8217;m being all that unreasonable. Here&#8217;s what I want:

Opera has superior tools for maintaining privacy. I use Opera for all the things people send me links to. I don&#8217;t mind installing plugins, within reason, including Flash, since I can easily clean up after each browsing session.
Firefox is the browser that I use [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t think I&#8217;m being all that unreasonable. Here&#8217;s what I want:</p>
<ul>
<li><a class="ext external" href="http://www.opera.com">Opera</a> has superior tools for maintaining privacy. I use Opera for all the things people send me links to. I don&#8217;t mind installing plugins, within reason, including Flash, since I can easily clean up after each browsing session.</li>
<li><a class="ext external" href="http://www.spreadfirefox.com/?q=affiliates&#038;id=95051&#038;t=76">Firefox</a> is the browser that I use for anything transactional. I allow persistent cookies from trusted sites. I don&#8217;t want plugins installed. (Mozilla itself says <a class="ext external" href="http://kb.mozillazine.org/Flash">&#8220;Plug-ins can cause crashes and hangs and may contain security vulnerabilities&#8221;</a>).
</ul>
<p>Last time I updated the Flash player in Opera, it installed itself into Firefox&#8217;s plugin directory as well. I was not pleased, but the fix was simple: in .&nbsp;.&nbsp;./Firefox/plugins I renamed <code>NPSFW32.dll</code> to <code>NPSFW32.DONOTWANT.DLL</code> and all was well.</p>
<p>With the latest update, however, the Flash installer doesn&#8217;t copy the DLLs to Firefox&#8217;s plugin directory &#8212; it puts a pointer to the version in Opera in Firefox&#8217;s pluginreg.dat:</p>
<p><code>...\Opera\program\plugins\NPSWF32.dll|$</code></p>
<p>So I change it to </p>
<p><code>...\Opera\program\DONOTWANT\NPSWF32.dll|$</code></p>
<p>.&nbsp;.&nbsp;.and the next time I restart Firefox, pluginreg.dat is re-written from scratch, and Flash is back.</p>
<p>Next thing I try is to see where the data that generates pluginreg.dat is. This is not straightforward. I can&#8217;t find NPSFW32.dll as a plaintext string anywhere obvious.</p>
<p>Next attempt seemed to work at first but didn&#8217;t. I made pluginreg.dat a read-only file. Firefox currently respects its read-only status and leaves my DONOTWANT edit intact. </p>
<p><ins datetime="2008-06-17T23:40:28+00:00">Update:</ins> turns out pluginreg.dat sounds promising but is just a red herring. (Adobe has a <a class="ext external" href="http://www.adobe.com/products/flash/about/">Flash version test page</a> so it&#8217;s easy to tell.) Even with a DONOTWANT string in pluginreg.dat, Firefox still finds the plugin somehow. Argh!</p>
<p>Next I notice that opera&#8217;s ini file specifies a plugin directory instead of specific plugins. </p>
<p>Aha! I can rename the flash DLL to something like _NPSFW32.dll. Opera loads it fine. Firefox can&#8217;t find it, and removes the entry from pluginreg.dat completely. Success, for real .&nbsp;.&nbsp;. for now.</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2008/06/pluginregdat-flash-do-not-want/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>renner - hacky little file renaming utility</title>
		<link>http://geekgeekgeek.antithetical.org/2007/11/renner-hacky-little-file-renaming-utility/</link>
		<comments>http://geekgeekgeek.antithetical.org/2007/11/renner-hacky-little-file-renaming-utility/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 20:25:30 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>perl</category>
	<category>file management</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2007/11/renner-hacky-little-file-renaming-utility/</guid>
		<description><![CDATA[Even in these days of graphical development environments, I often find myself needing to change the extensions of hundreds of files, or remove &#8220;_converted&#8221; from the end of a file name, or zero-pad the beginning of a file name so &#8220;001&#8243; &#8220;2&#8243; and &#8220;03&#8243; will sort correctly.
Renner is a little perl script I hacked together [...]]]></description>
			<content:encoded><![CDATA[<p>Even in these days of graphical development environments, I often find myself needing to change the extensions of hundreds of files, or remove &#8220;_converted&#8221; from the end of a file name, or zero-pad the beginning of a file name so &#8220;001&#8243; &#8220;2&#8243; and &#8220;03&#8243; will sort correctly.</p>
<p><a href="http://geekgeekgeek.antithetical.org/renner/renner.pl">Renner</a> is a little perl script I hacked together to do all those tasks. It&#8217;s not pretty, but it&#8217;s gotten the job done for me for years. Mostly I&#8217;m putting it on the Internets so it&#8217;s easy for me to find it when I need it.</p>
<p>How to use it:</p>
<h3>Summary Help</h3>
<p>perl  renner.pl location [matchcriterion] action [utility]<br />
S = a string<br />
n = a number (of characters)<br />
match criteria:<br />
  -mask S|-unmask S<br />
  -dir<br />
actions:prepend/append/unprepend/unappend(truncate):<br />
  -app S| -pre S| -unapp n| -unpre n<br />
actions:filename substitutions:<br />
  -mask S1 -sub S2<br />
  -dig n1 n2<br />
recursion:<br />
  -r<br />
utility:<br />
  -help | -silent | -test | -v</p>
<h3>Example</h3>
<p>Add .jpg to all non jpg files<br />
  perl /pathto/renner.pl . -unmask jpg$ -app .jpg</p>
<h3>Match Criteria</h3>
<p> $ - anchors a match to END of string<br />
 ^ - anchors a match to START of string</p>
<p>  -mask string<br />
  default: .<br />
act only on filenames that match the string<br />
<em>example:</em>  perl renner.pl . -mask .txt -app .bak<br />
append .bak to any file in currect directory matching .txt<br />
  foo.txt -> foo.txt.bak<br />
  foo.txt.bak -> foo.txt.bak.txt<br />
<em>example:</em>  renner.pl . -mask .txt$ -app .bak<br />
append .bak to any file with extension .txt<br />
  foo.txt -> foo.txt.bak<br />
  foo.txt.bak -> foo.txt.bak<br />
  -unmask string<br />
act only on filenames that do NOT match the string<br />
<em>example:</em>  renner.pl . -unmask ^_ -app .txt<br />
append .txt to any file in current directory that does NOT<br />
begin with underscore<br />
  _foo    -> foo<br />
  foo     -> foo.txt<br />
NOTE: -mask and -umask may not be used in the same operation.</p>
<p> -dir<br />
Rename directories in addition to plain files.<br />
NOTE: -dir and -r (recursion) may not be used in the same operation.</p>
<h3>Add or Remove Strings from Filename</h3>
<p> -app string<br />
 -pre string<br />
append or prepend string to all matching filenames<br />
<em>example</em>:  renner.pl . -app .bak<br />
append .bak to all files in current directory<br />
  foo         -> foo.bak<br />
<em>example</em>:  renner.pl . -mask .gif$ -pre _<br />
prepend all .gif files in current directory with underscore<br />
  foo.gif -> _foo.gif<br />
  foo.txt -> foo.txt</p>
<p> -unapp integer<br />
 -unpre integer<br />
delete integer characters from start or end of filename.<br />
<em>example</em>:  renner.pl . -mask .txt$ -unapp 4<br />
delete extension from all txt files in current directory<br />
  foo.txt      -> foo<br />
<em>example</em>:  renner.pl . -unmask . -unapp 1<br />
delete leading character from all files in current directory with<br />
no extension<br />
  afoo      -> foo</p>
<h3>Perform Substitutions on Filename</h3>
<p> -mask searchstring - sub replacestring<br />
replace searchstring in filename with replacestring. searchstring<br />
is required in this form.<br />
<em>example</em>:  renner.pl -mask display -sub d<br />
  display1.jpg -> d1.jpg</p>
<p> -dig integer1 integer2<br />
zeropad strings of integer1 consecutive digits to integer2 digits<br />
<em>example</em>:  renner.pl -mask .txt$ -dig 2 3<br />
  23.txt  -> 023.txt<br />
  123.txt -> 123.txt<br />
To include a space in a mask, sub, or unmask, use $space</p>
<h3>Recursion</h3>
<p> -r<br />
recursively traverse directories.<br />
NOTE: -r and -dir (rename directories) may not be used in the same operation.</p>
<h3>Utility</h3>
<p> -help<br />
print this message</p>
<p> -silent<br />
suppress messages</p>
<p> -test<br />
describe action but don&#8217;t actually rename files</p>
<p> -v<br />
print detailed messages</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2007/11/renner-hacky-little-file-renaming-utility/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>flagging &#8220;dictionary attack&#8221; spam at the MTA level</title>
		<link>http://geekgeekgeek.antithetical.org/2006/07/flagging-dictionary-attack-spam-at-the-mta-level/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/07/flagging-dictionary-attack-spam-at-the-mta-level/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 18:02:51 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>spamassassin</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/07/flagging-dictionary-attack-spam-at-the-mta-level/</guid>
		<description><![CDATA[I have a server that hosts several domain names. It gets gobs of &#8220;dictionary attack&#8221; spam to addresses that have never been valid.
Spamassassin is running at the MTA level, and set to quarantine mail between a set of threshhold values. (Mostly to give me a chance to identify false positives while I&#8217;m tuning the rulesets.) [...]]]></description>
			<content:encoded><![CDATA[<p>I have a server that hosts several domain names. It gets gobs of &#8220;dictionary attack&#8221; spam to addresses that have never been valid.</p>
<p>Spamassassin is running at the MTA level, and set to quarantine mail between a set of threshhold values. (Mostly to give me a chance to identify false positives while I&#8217;m tuning the rulesets.) The problem is, the quarantine operation happens <em>before</em> the MTA decides whether to accept the incoming mail message, so mail to boty72fg@mydomain.example.com can be quarantined to my review queue even though it would normally be rejected.</p>
<p>I started by playing around with the blacklist_to and whitelist_to directives. The problem is, I don&#8217;t want to just whitelist_to every valid alias (because valid aliases get plenty of spam). And I don&#8217;t want to have to blacklist_to <em>everything</em> of the form boty72fg@mydomain.example.com.  What I want is to flag all mail that <em>doesn&#8217;t</em> match a known alias as probable spam.</p>
<p>Here&#8217;s my first cut at implementing this as a meta rule:</p>
<div>
<code>header __EXAMPLE_ALIAS_RECOGNIZED ToCc =~ &#47;&#92;b(?:bogus|bugos|gosub|gubos|sobug|sugob)&#64;&#47;i<br />
<br />header __EXAMPLE_DOM_RECOGNIZED ToCc =~ &#47;\bexample\.com/i<br />
<br />describe EXAMPLE_ALIAS_UNRECOGNIZED Mail to invalid alias<br />
meta EXAMPLE_ALIAS_UNRECOGNIZED (!__EXAMPLE_ALIAS_RECOGNIZED &#038;&#038; __EXAMPLE_DOM_RECOGNIZED)<br />
score EXAMPLE_ALIAS_UNRECOGNIZED 5.0</code>
</div>
<p>Seems to work okay, but it&#8217;s a little verbose, and will need to be updated whenever valid email addresses are added or removed.</p>
<p>I also thought about trying something like this:</p>
<p><code># ALL addresses @mydomain.example.com are blacklisted<br />
score USER_IN_BLACKLIST_TO 5.0<br />
# some addresses @mydomain.example.com are ALSO whitelisted<br />
# negating the effect of the blacklist<br />
score USER_IN_WHITELIST_TO -5.0<br />
blacklist_to *mydomain.example.com<br />
whitelist_to bogus@mydomain.example.com<br />
whitelist_to bugos@mydomain.example.com<br />
whitelist_to gosub@mydomain.example.com<br />
whitelist_to gubos@mydomain.example.com<br />
whitelist_to sobug@mydomain.example.com<br />
whitelist_to subog@mydomain.example.com<br />
</code></p>
<p>But I&#8217;m not sure if that&#8217;s truly equivalent (?). And it&#8217;s even more verbose, and doesn&#8217;t strike me as any easier to maintain &#8212; I still have a requirement to either generate the rulesets from virtusertable or manually update the rulesets when virtusertable is updated.</p>
<p>Anybody got a better way to do this?
</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/07/flagging-dictionary-attack-spam-at-the-mta-level/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>using guardMailto</title>
		<link>http://geekgeekgeek.antithetical.org/2006/07/using-guardmailto/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/07/using-guardmailto/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 19:59:21 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>javascript</category>
	<category>anti-spam</category>
	<category>guardMailto</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/07/using-guardmailto/</guid>
		<description><![CDATA[Introduction
guardMailto is a lightweight unobtrusive JavaScript library to make it more difficult for spammers to extract email addresses from web sites. 
You don&#8217;t need to be a JavaScript expert to use it. On the other hand, it has some options intended for use by people who are comfortable programming JavaScript. My hope is that you&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>guardMailto is a lightweight unobtrusive JavaScript library to make it more difficult for spammers to extract email addresses from web sites. </p>
<p>You don&#8217;t need to be a JavaScript expert to use it. On the other hand, it has some options intended for use by people who are comfortable programming JavaScript. My hope is that you&#8217;ll find it useful if you&#8217;ve never used JavaScript in a web page before, and even more useful if you&#8217;re a guru.</p>
<p><small>(This is the short version. <a href="http://geekgeekgeek.antithetical.org/2006/06/guardmailto/">introducing guardMailto</a> is an article that discusses the design approach behind this library in more detail.)</small></p>
<h3>Adding guardMailto to Your Site</h3>
<p>You can download either the raw javascript <a href="http://geekgeekgeek.antithetical.org/guardMailto/guardMailto.js" title="guardMailto JavaScript source">guardMailto.js</a> or a gzip archive <a href="http://geekgeekgeek.antithetical.org/guardMailto/guardMailto.js.gz" title="guardMailto gzipped">guardMailto.js.gz</a>. </p>
<p>Just include guardMailto.js in the &lt;head&gt; section of your pages:</p>
<p><code>&lt;script type="text/javascript" src="guardMailto.js&gt;&lt;/script&gt;</code></p>
<p>There is one function, mwmw.guardMailto(). It has 3 required arguments (and some options).</p>
<ol>
<li>&#8220;linkElement&#8221; can be either the id of the element (as a string) or an HTML Element Node
</li>
<li>&#8220;userName&#8221; is the part of the email address preceding the @ character:<br />
<strong>test</strong>@example.com
</li>
<li>&#8220;domain&#8221; is the part of the email address between the @ character and the top level domain (.com, .org, .net, etc.):<br />
test@<strong>example</strong>.com
</li>
</ol>
<p>You need a way to identify each place where you want an email link to be inserted. One quick way is to put the link text in a &lt;span&gt; with its &#8220;id&#8221; attribute set, like this:</p>
<p><code>&lt;p&gt;&lt;span id="contactMe"&gt;email me&lt;span&gt; for more information.&lt;/p&gt;</code></p>
<div class="annotate">
(Many WYSIWYG editors create id attributes for you automatically &#8212; there&#8217;s usually a &#8220;source code&#8221; or &#8220;detail&#8221; view that will let you check. I prefer human-readable id values like &#8220;contactMe,&#8221; but id=&#8221;span018&#8243; or id=&#8221;g78956b&#8221; will work fine too. It doesn&#8217;t matter what the id is, as long as it&#8217;s unique within the page.)
</div>
<p>Then call mwmw.guardMailto to make the link like this:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
new mwmw.guardMailto("contactMe","test","example");<br />
&lt;/script&gt;</code></p>
<div class="annotate">
This will link the text &#8220;email me&#8221; from the example above to the email address test@example.com.</div>
<p>Remember, this has to happen <em>after</em> the browser displays the original span. The quick and dirty way is to put the script in the page body after the original span. That&#8217;s how this site works &#8212; the email text in the footer of this page is immediately followed by JavaScript that makes it a link. </p>
<h3>Want to See It in Action?</h3>
<p>You can view source on this page (scroll all the way to the bottom; guardMailto is used in the footer). There&#8217;s also a <a href="http://geekgeekgeek.antithetical.org/guardMailto/">basic sample</a> page that shows  the features, and a <a href="http://geekgeekgeek.antithetical.org/guardMailto/fancy.html">fancier sample</a> page that demonstrates some of the cool things you can do if you throw <a class="external" href="http://prototype.conio.net/">prototype</a> into the mix. The sample pages also demonstrate two different techniques for adding the links in an &#8220;onload&#8221; function, which is what I would recommend in most cases.</p>
<h3>Options</h3>
<p>If you want to set additional options, they should be passed as a JavaScript object literal, which looks like this:</p>
<p><code>{propertyName:propertyValue, AnotherPropertyName:anotherPropertyValue}</code></p>
<p>You can see all of these options in use on the <a href="http://geekgeekgeek.antithetical.org/guardMailto/">basic sample</a> page.</p>
<p>The options are (in alphabetical order):</p>
<ul>
<li>domainSuffix: Set your top level domain if it isn&#8217;t &#8220;com&#8221; (e.g., &#8220;edu&#8221; or &#8220;org&#8221;). Don&#8217;t include the &#8220;.&#8221;
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {domainSuffix:"org"});</code></p>
<p>To make a link to test@example.org</li>
<li>linkAddress: Replace the original link text with the email address itself. To replace &#8220;test -at- example -dot- com&#8221; with &#8220;test@example.com&#8221;:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkAddress:true});</code></p>
</li>
<li>linkClass: Specify the HTML class attribute of the new link, so you can style it with CSS:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkClass:"emailLink"});</code></p>
<p>If you want multiple styles, separate them with spaces:</p>
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkClass:"emailLink siteNavigation"});</code></p>
</li>
<li>linkId: Specify the HTML id attribute of the new link, so you can style it with CSS:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkId:"authorContact"});</code></p>
</li>
<li>linkHtml: Completely replace the original link. If the browser doesn&#8217;t support replacing the contents of an element, the original contents will be left unchanged:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkHtml:"&lt;img class='icon' src='/emailicon' alt='click to email' / &gt;"});</code></p>
</li>
<li>linkText: Replace the text of the original link. If the browser doesn&#8217;t support replacing the text of an element, the original text will be left unchanged:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkText:"email the author"});</code></p>
<p>(If you want the link text to be the email address itself, use the linkAddress option instead.)</p>
</li>
<li>linkTitle: Specify the HTML title attribute of the new link. This is often displayed as a tooltip when the user hovers over the link:
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkTitle:"Click to email the author"});</code></p>
</li>
</ul>
<p>You can mix and match almost all of these:</p>
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkClass:"deadAuthor european" linkText:"Franz Kafka" linkTitle:"Click to email the author"});</code></p>
<p>The options linkAddress, linkHtml, and linkText are exceptions to the mix and match rule. Since they all change the contents of the link that&#8217;s displayed, you should only use one of them at a time.</p>
<h3>License</h3>
<p>guardMailto is released under <a class="external" href="http://www.opensource.org/licenses/mit-license.php">The MIT License</a>.</p>
<h3>Browsers:</h3>
<p>guardMailto has been tested in recent versions of Firefox, Internet Explorer (5.5, 6, and 7 beta), Mozilla, Netscape, and Opera, on Windows 98SE, 2000, and XP.</p>
<h3>Current Version</h3>
<p>1.0.01, last updated 8.jul.2006.<br />
<a href="http://geekgeekgeek.antithetical.org/guardMailto/changelog.txt">View changelog.</a></p>
<h3>Acknowledgments</h3>
<p>Rich Thornett provided excellent suggestions on everything from nomenclature to tweaking the API. I&#8217;m grateful for his generosity with his time and expertise. Thanks are also due Kathy Cashel for suggestions on clarifying this documentation.</p>
<h3>Feedback?</h3>
<p>Find it useful? Find it useless? Bugs? Tested on a different browser/platform? Suggestions? I&#8217;d love to hear from you. Leave a comment, or email me using the link in the footer.</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/07/using-guardmailto/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>guardMailto update</title>
		<link>http://geekgeekgeek.antithetical.org/2006/07/guardmailto-update/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/07/guardmailto-update/#comments</comments>
		<pubDate>Sat, 08 Jul 2006 14:52:17 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>javascript</category>
	<category>anti-spam</category>
	<category>guardMailto</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/07/guardmailto-update/</guid>
		<description><![CDATA[After implementing guardMailto on a few web sites, I realized I hadn&#8217;t done a good job of handling cases in which the link text should be the email address itself, e.g., test@example.com.
This:
new mwmw.guardMailto("contactMe", "test", "example", {linkText:"test@example.com"});
is not a good solution because it leaves a valid email address in the page body where spammers can find [...]]]></description>
			<content:encoded><![CDATA[<p>After implementing guardMailto on a few web sites, I realized I hadn&#8217;t done a good job of handling cases in which the link text should be the email address itself, e.g., test@example.com.</p>
<p>This:</p>
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkText:"test@example.com"});</code></p>
<p>is not a good solution because it leaves a valid email address in the page body where spammers can find it. Oops.</p>
<p>If you&#8217;re comfortable writing JavaScript, you might realize that the value of linkText can be any expression that evaluates to a string. So you could hide the address by doing something like this:</p>
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkText:("test"+String.fromCharCode(64)+"example."+"com")});</code></p>
<p>But that&#8217;s clunky, redundant, and less than user-friendly for web designers who don&#8217;t care to be JavaScript gurus. The obvious thing to do was to add an option to automatically replace the original link text with the address itself, so that&#8217;s why I did for version 1.0.01. Just set option linkAddress to true like this:</p>
<p><code>new mwmw.guardMailto("contactMe", "test", "example", {linkAddress:true});</code></p>
<p>On a related note, guardMailto is perhaps a little less secure than my original &#8220;munge&#8221; library in that the default implementation does include a user name and domain string in plain text in the page. The <a href="http://geekgeekgeek.antithetical.org/guardMailto/fancy.html">fancier sample</a> page has been updated to demonstrate a technique that bypasses this limitation.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/07/guardmailto-update/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>introducing guardMailto</title>
		<link>http://geekgeekgeek.antithetical.org/2006/06/guardmailto/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/06/guardmailto/#comments</comments>
		<pubDate>Thu, 29 Jun 2006 21:24:21 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>javascript</category>
	<category>anti-spam</category>
	<category>guardMailto</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/06/guardmailto/</guid>
		<description><![CDATA[
The Problem

If you put something like this in your website:
&#60;a href="mailto:test@example.com"&#62;email me!&#60;/a&#62;
spammers can identify that test@example.com is an email address with automated tools that review thousands of websites (analogous to the &#8220;spiders&#8221; used by search engines like Google and Yahoo). They can add your address to their databases. And eventually, they will surely do so. [...]]]></description>
			<content:encoded><![CDATA[<h3>
The Problem<br />
</h3>
<p>If you put something like this in your website:</p>
<p><code>&lt;a href="mailto:test@example.com"&gt;email me!&lt;/a&gt;</code></p>
<p>spammers can identify that test@example.com is an email address with automated tools that review thousands of websites (analogous to the &#8220;spiders&#8221; used by search engines like Google and Yahoo). They can add your address to their databases. And eventually, they will surely do so. In fact, it turns out that spammers are pretty good at extracting anything that looks like an email address, whether it&#8217;s in a mailto: link or not.</p>
<h3>
First Generation Solutions<br />
</h3>
<p>There are already several libraries (and some commercial products) that use JavaScript to dynamically create mailto: links. I even <a class="external" href="http://www.mwmw.com/client/munger.html" title="The mwmw.com email 'munger'">wrote one myself</a> a couple of years ago when I was providing web hosting for a number of small businesses.</p>
<p>The underlying theory is that while spammers could easily get your email address by going to the site, loading the page, and looking at the results, very few spammers will invest the time necessary to do so. If the automated tool doesn&#8217;t return an email address, they won&#8217;t check each site by hand. The economics of spamming are contingent on the incremental cost of sending each email being very, very low &#8212; anything that requires the spammer to invest time eats into the profit margin.</p>
<p>Most of these products used the principal of <em>graceful degradation</em>: If JavaScript was enabled in your browser, you got a functional email link. If JavaScript wasn&#8217;t available, you got alternate content provided in a &lt;noscript&gt; tag, if the page author provided it &#8212; or maybe nothing at all.  Code for this approach &#8212; including my &#8220;munge&#8221; library &#8212; generally followed the following format:</p>
<p>A JavaScript library would be included in the &lt;head&gt; section of the document:</p>
<p><code>&lt;script type="text/javascript" src="emailLib.js&gt;&lt;/script&gt;</code></p>
<div class="annotate">
(Don&#8217;t worry if you&#8217;re not familiar with reading and writing JavaScript code. You don&#8217;t need to be a JavaScript expert to use guardMailto, and you can safely skip these examples.)
</div>
<p>Then, in the body of the page, there would be some inline JavaScript that used document.write() to insert the link into the page:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
document.write(makeAnEmailLink("stringEncryptingEmailAddress"));<br />
&lt;/script&gt;</code></p>
<p>And, if you were lucky, there&#8217;d be a &lt;noscript&gt; tag that would provide a fallback for users without JavaScript:</p>
<p><code>&lt;noscript&gt;<br />
email: test (at) example (dot) com<br />
&lt;/noscript&gt;</code></p>
<h3>
Towards a Second Generation Solution<br />
</h3>
<p>I observed several serious problems with my &#8220;munge&#8221; library:</p>
<ul>
<li>It was too complicated and hard to use. Programmers seemed comfortable with it, but web designers often weren&#8217;t, and &#8220;ordinary&#8221; people struggled mightily with it.</li>
<li>It was inflexible. It worked ok for text links that were all by themselves, but it didn&#8217;t readily support linking an image, for example.</li>
<li>It didn&#8217;t play particularly well with many &#8220;what-you-see-is-what-you-get&#8221; (WYSIWIG) web page editors.</li>
<li>It put the burden of creating the fallback &lt;noscript&gt; support on the page author. Many page authors were confused about how to do this effectively, and many just didn&#8217;t bother.</li>
</ul>
<p>In the intervening time, I&#8217;ve learned a lot about object-oriented JavaScript, and I&#8217;ve become an advocate of <em>progressive enhancement</em> as an alternative to graceful degradation. (<em>unobtrusive JavaScript</em> is a related buzzword; I prefer &#8220;progressive enhancement&#8221; because it&#8217;s a design philosophy that&#8217;s applicable to more than just JavaScript.)</p>
<p>Progressive enhancement reverses the paradigm of graceful degradation: start with a basic html page that works &#8220;as-is,&#8221; and then enhance the functionality of the basic page for browsers that support it. Progressive enhancement makes it impossible to strand users of older browsers by omitting a &lt;noscript&gt; tag. It also better supports users who have a modern browser but may have JavaScript disabled or restricted for reasons of security and/or corporate policy. Finally, it often better addresses the accessibility needs of users with visual or other impairments.</p>
<p>Conceptually, the progressive enhancement model looks like this. </p>
<p>We still start with a library included in the &lt;head&gt; section:</p>
<p><code>&lt;script type="text/javascript" src="emailLib.js&gt;&lt;/script&gt;</code></p>
<p>In the body of the page, we have the link information in a format that is easily human-readable, but less easily machine-readable:</p>
<p><code>email me at &lt;span id="contactAddress"&gt;test (at) example (dot) com&lt;/span&gt;</code></p>
<p>And then we have some JavaScript that turns the human-readable text into a clickable link:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
makeAnEmailLink("contactAddress","stringEncryptingEmailAddress")<br />
&lt;/script&gt;</code></p>
<p>That JavaScript code can be inline in the page body, but it can also be somewhere else, so we can separate the page <em>content</em> from the presentation <em>logic</em>. </p>
<p>There&#8217;s one significant catch: You can&#8217;t turn the text into a link until <em>after</em> the browser has displayed it in the page. That makes this code a good candidate for an &#8220;onload&#8221; event, which the browser will run after the page finishes loading.</p>
<h3>
Enough Talk, Where&#8217;s the Code?<br />
</h3>
<p>You can download either the raw javascript <a href="http://geekgeekgeek.antithetical.org/guardMailto/guardMailto.js" title="guardMailto JavaScript source">guardMailto.js</a> or a gzip archive <a href="http://geekgeekgeek.antithetical.org/guardMailto/guardMailto.js.gz" title="guardMailto gzipped">guardMailto.js.gz</a>.</p>
<p>guardMailto is released under <a class="external" href="http://www.opensource.org/licenses/mit-license.php">The MIT License</a>.</p>
<p>Instructions for adding guardMailto to your site are covered in <a href="http://geekgeekgeek.antithetical.org/2006/07/using-guardmailto/">using guardMailto</a>.</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/06/guardmailto/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>passing false when the default is true</title>
		<link>http://geekgeekgeek.antithetical.org/2006/06/passing-false-when-the-default-is-true/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/06/passing-false-when-the-default-is-true/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 14:31:13 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>javascript</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/06/passing-false-when-the-default-is-true/</guid>
		<description><![CDATA[Lately, inspired by the prototype and scriptaculous libraries, I&#8217;ve frequently been defining JavaScript functions that accept an anonymous options object, so they can be called like this:
mynamespace.myFunction(requiredParam1, requireParam2, {
    overrideSomeDefault:true,
    customCallback: mynamespace.myOtherFunction
});
And I&#8217;ve gotten fond of boolean short-circuits for parsing the options object and assigning defaults:
options.overrideSomeDefault = options.overrideSomeDefault &#124;&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, inspired by the <a class="external" href="http://prototype.conio.net/">prototype</a> and <a class="external" href="http://script.aculo.us/">scriptaculous</a> libraries, I&#8217;ve frequently been defining JavaScript functions that accept an anonymous options object, so they can be called like this:</p>
<p><code>mynamespace.myFunction(requiredParam1, requireParam2, {<br />
    overrideSomeDefault:true,<br />
    customCallback: mynamespace.myOtherFunction<br />
});</code></p>
<p>And I&#8217;ve gotten fond of boolean short-circuits for parsing the options object and assigning defaults:</p>
<p><code>options.overrideSomeDefault = options.overrideSomeDefault || false;</code></p>
<p>Since everything except null, 0, &#8220;&#8221;, NaN, and undefined is &#8220;truthy&#8221; in JavaScript (see Simon Willison&#8217;s great presentation &#8220;A (Re)-Introduction to JavaScript&#8221; either as pretty <a class="external" href="http://simon.incutio.com/slides/2006/etech/javascript/js-tutorial.001.html">slides</a> or texty <a class="external" href="http://simon.incutio.com/slides/2006/etech/javascript/js-reintroduction-notes.html"> notes</a>) this is fast, terse, and readable.</p>
<p>Unless for some reason you explictly need to pass one of the &#8220;falsey&#8221; values. I hit this first trying to make an autocompleter library work the way I wanted it to, something along these lines:</p>
<p><code>autocompleter.init(myTarget,myCallback,{minCharsToMatch:0});<br />
...<br />
autocompleter {<br />
    init:function(_target,_callback,options) {<br />
        options = options || {};<br />
        options.minCharsToMatch = options.minCharsToMatch || 1;<br />
...<br />
</code></p>
<p>Oops, I was stuck with minCharsToMatch of 1, which is not what I wanted. </p>
<p>I also think there are times when it makes more sense for a property to have a default value of true than false. It&#8217;s clearer (imo) for &#8220;enabled&#8221; to default true than for &#8220;disabled&#8221; to default false.</p>
<p>Here&#8217;s my attempt at a solution. If it&#8217;s reasonable to expect a &#8220;falsey&#8221; option value, you can do this:</p>
<p><code>option.aBool = ("undefined" != typeof option.aBool ? option.someBool : true);</code></p>
<p>Not as pretty, and not as fast. But should get the job done.</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/06/passing-false-when-the-default-is-true/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>fixing wordpress</title>
		<link>http://geekgeekgeek.antithetical.org/2006/06/fixing-wordpress/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/06/fixing-wordpress/#comments</comments>
		<pubDate>Fri, 23 Jun 2006 18:32:17 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>wordpress</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/06/fixing-wordpress/</guid>
		<description><![CDATA[I kid. I love WordPress. But I always have to mess with it, and I figured it was worth documenting how I always mess with it. If you&#8217;re not me, you may or may not find this useful, but if you are me, it should save you some time and help you make sure you [...]]]></description>
			<content:encoded><![CDATA[<p>I kid. I love WordPress. But I always have to mess with it, and I figured it was worth documenting how I always mess with it. If you&#8217;re not me, you may or may not find this useful, but if you <em>are</em> me, it should save you some time and help you make sure you (I) hit everything the first time through.</p>
<h3>
Basic Hardening<br />
</h3>
<ul>
<li>Get rid of xmlrpc.php and wp-trackback.php.<br />
(disallows trackbacks, but should protect against remote procedure attacks) </li>
<li>Rename wp-register.php and wp-login.php to something else.<br />
Change all occurences of wp-login.php in the file to whatever you renamed it to (so that the forms invoke the right action). This may seem pretty paranoid, but otherwise it&#8217;s vulnerable to brute force attacks.</li>
<li>Protect wp-admin with .htaccess</li>
<li>Install <a class="external" href="http://unknowngenius.com/blog/wordpress/spam-karma/">Spam Karma</a><br />
&#8220;Kinda mean&#8221; setting seems to work well</li>
<li>Remove meta links in sidebar.php</li>
</ul>
<h3>basic functional customization</h3>
<ul>
<li>options:permalink<br />
touch .htaccess (in main blog directory) world-writable, set reasonable permalink structure, and remove world-write from .htaccess</li>
<li>options:writing<br />
make sure visual editor and emoticons are both unchecked
</li>
<li>links<br />
delete all the bogus default links
</li>
</ul>
<h3>style tyranny</h3>
<ul>
<li>
grep the template directory for jS and change all &#8220;F jS, Y&#8221; to &#8220;j F Y&#8221; because I prefer day/month/year order.
</li>
<li>
grep the template directory, add <?php get_sidebar(); ?> to templates (and change all occurences of  class=&#8221;narrowcolumn&#8221; to class=&#8221;widecolumn&#8221;), because I want nav on all pages.
</li>
<li>
Change most occurences of &#8220;center&#8221; in style.css to left<br />
(headings, mostly)
</li>
<li>
Change <em>all</em> occurences of &#8220;justify&#8221; to left
</li>
<li>
Get rid of the huge header image. Need to adjust<br />
#headerimg .description (left margin)<br />
h1, h1 a, etc. &#8212; link, left-margin, alignment <em>and</em> padding<br />
#header<br />
#headerimg
</li>
<li>
get rid of the horrible bullet characters, don&#8217;t forget to set:<br />
<code>text-indent:none</code>
</li>
<li>
If you want to allow lists within comments (and why not?):</p>
<p><code>.commentlist ol li {<br />
        list-style:decimal;<br />
}<br />
.commentlist ul li {<br />
        list-style:disc;<br />
}<br />
</code><br />
(apply font-weight:normal, too)
</li>
<li>Distinguish external links:
<p><code>a.external:hover, a.ext:hover {<br />
        color: #147;<br />
        text-decoration: none;<br />
        border-bottom:1px dashed #147;<br />
        }<br />
</code>
</li>
</ul>
<h3>hacking</h3>
<p>In post-editing mode, I don&#8217;t like the fact that the categories selection controls are collpased by default when the editing page loads. Currently, I&#8217;ve got the &#8220;more meta&#8221; group of editing controls (Discussion ,Password-Protect Post, Post-slug ,Categories, Post Status) set to dispay opened. This is suboptimal: I rarely want to password-protect posts or customize the slug, and I&#8217;d be happy to have those hidden. But having the categories hidden is a pain that leads to posts published with incorrect tags.</p>
<p>I also don&#8217;t like my fix, which will be overwritten whenever WP is upgraded. In wp-includes/js the file dbx-key.js initializes 2 dbxGroup control sets, one called &#8220;meta&#8221; and one called &#8220;advanced&#8221;. If the default state (7th parameter) for &#8220;meta&#8221; is set to &#8220;open&#8221; vs. the default &#8220;closed&#8221; then the &#8220;more meta&#8221; control set will be initialized in the expanded state.</p>
<p>I suppose I could write a javascript library that inserts itself into the onload stack and opens just the categories box, but that also seems likely to be fragile against software upgrades.</p>
<p>I have a very hacky little &#8220;plugin&#8221; that overrides some of WP&#8217;s defaults for marking up text and comments. It should stop text strings like www.example.com from being marked up as links automatically, it should add class=&#8221;external&#8221; to links in comments, and it should format ellipses (.&nbsp;.&nbsp;.) the way my editor tells me they should be formatted.<br />
Here&#8217;s what&#8217;s in it right now:</p>
<p><code>function dmw_texturize($data) {<br />
    # leave my ellipses alone!<br />
    $data = str_replace(".&nbsp;.&nbsp;.",".&nbsp;.&nbsp;.",$data);<br />
    return $data;<br />
}<br />
function dmw_rel_nofollow( $text ) {<br />
// dmw hack: class ext applied to links that are rel nofollowd.<br />
        $text = preg_replace('|&lt;a (.+?)>|i', '&lt;a class="external" $1 rel="nofollow">', $text);<br />
        return $text;<br />
}<br />
# do the regular wp_texturize, then undo some particular things<br />
add_filter('the_content', 'dmw_texturize');<br />
# makes www.something into a link. just don't do this at all.<br />
remove_filter('comment_text', 'make_clickable');<br />
# get rid of the standard wp_rel_nofollow, replace with my version.<br />
remove_filter('pre_comment_content', 'wp_rel_nofollow');<br />
add_filter('pre_comment_content', 'dmw_rel_nofollow');<br />
</code></p>
<h3>TODO</h3>
<p>Code in comments has proliferating slashes all over the place. Need to figure out how to have this not happen w/o compromising the extra security applied to content text, or trying to write improperly escaped strings into the db.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/06/fixing-wordpress/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>upgrading sendmail 8.12.8 to 8.13.7</title>
		<link>http://geekgeekgeek.antithetical.org/2006/06/upgrading-sendmail-8128-to-8137/</link>
		<comments>http://geekgeekgeek.antithetical.org/2006/06/upgrading-sendmail-8128-to-8137/#comments</comments>
		<pubDate>Thu, 22 Jun 2006 20:03:45 +0000</pubDate>
		<dc:creator>geekgeekgeek</dc:creator>
		
	<category>sendmail</category>
		<guid isPermaLink="false">http://geekgeekgeek.antithetical.org/2006/06/upgrading-sendmail-8128-to-8137/</guid>
		<description><![CDATA[I&#8217;m sure I didn&#8217;t do this the way I was supposed to, but here&#8217;s what I did. Seems to be working (knock on silicon).
Tried yum, rpm, no dice.
Untarred archive from sendmail.org
service sendmail stop
/$srcpath/sh Build
/$srcpath/sh Build install
(had to make paths for man pages in order to get a clean build)
cd /etc/mail
edit sendmail.mc to add FEATURE(`greet_pause', `1000')
(incidentally, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure I didn&#8217;t do this the way I was supposed to, but here&#8217;s what I did. Seems to be working (knock on silicon).</p>
<p>Tried yum, rpm, no dice.<br />
Untarred archive from <a class="external" xhref="http://www.sendmail.org/">sendmail.org</a></p>
<p><code>service sendmail stop</code></p>
<p><code>/$srcpath/sh Build</code></p>
<p><code>/$srcpath/sh Build install</code></p>
<p>(had to make paths for man pages in order to get a clean build)</p>
<p><code>cd /etc/mail</code></p>
<p>edit sendmail.mc to add <code>FEATURE(`greet_pause', `1000')</code></p>
<p>(incidentally, here&#8217;s a discussion about the <a class="external" xhref="http://www.samag.com/documents/s=10080/sam0606a/0606a.htm">order for whitelisting senders with greetpause</a>)</p>
<p> <code>make -C /etc/mail</code></p>
<p>make complained about missing $path/sendmail-cf/feature/great_pause.m4</p>
<p>backed up sendmail-cf directory to sendmail-cf.8.12.8, copied new cf from usr/src/sendmail-8.13.7/cf</p>
<p> <code>make -C /etc/mail</code></p>
<p>make complained about mssing $path/sendmail-cf/hack/popauth.m4</p>
<p>copied that from the sendmail-cf.8.12.8 backup</p>
<p> <code>make -C /etc/mail</code></p>
<p>is happy</p>
<p><code>service sendmail restart</code></p>
<p>confirmed version 8.13.7 via</p>
<p><code>/usr/sbin/sendmail -d0 < /dev/null | grep -i version</code></p>
<p>and headers on test emails look good.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://geekgeekgeek.antithetical.org/2006/06/upgrading-sendmail-8128-to-8137/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
