<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All the Good Titles Were Taken - Chris Scott &#187; Hacks</title>
	<atom:link href="http://iamzed.com/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamzed.com</link>
	<description>Chris Scott's Blog</description>
	<lastBuildDate>Thu, 07 Jan 2010 20:51:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Cheat Sheet</title>
		<link>http://iamzed.com/2005/02/15/google-cheat-sheet/</link>
		<comments>http://iamzed.com/2005/02/15/google-cheat-sheet/#comments</comments>
		<pubDate>Tue, 15 Feb 2005 22:49:14 +0000</pubDate>
		<dc:creator>Chris Scott</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://www.iamzed.com/?p=693</guid>
		<description><![CDATA[<p>Want Google to be your bitch? Check out the <a href="http://www.google.com/help/cheatsheet.html">cheat sheet</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>Want Google to be your bitch? Check out the <a href="http://www.google.com/help/cheatsheet.html">cheat sheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamzed.com/2005/02/15/google-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ipod shuffle linux update</title>
		<link>http://iamzed.com/2005/01/26/ipod-shuffle-linux-update/</link>
		<comments>http://iamzed.com/2005/01/26/ipod-shuffle-linux-update/#comments</comments>
		<pubDate>Wed, 26 Jan 2005 23:04:46 +0000</pubDate>
		<dc:creator>Chris Scott</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://www.iamzed.com/?p=691</guid>
		<description><![CDATA[<p>UPDATE -- 01/31/05: 
</p>
<div>Adrian (gnupod) sent me some test files<br />
over the weekend that worked for me. He is going to be releasing these<br />
in gnupod 0.98. You can subscribe to be notified when it is out at <a href="http://freshmeat.net/projects/gnupod/">http://freshmeat.net/projects/gnupod/</a>
</div>
<p>A big thanks to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>UPDATE -- 01/31/05: 
</p>
<div>Adrian (gnupod) sent me some test files<br />
over the weekend that worked for me. He is going to be releasing these<br />
in gnupod 0.98. You can subscribe to be notified when it is out at <a href="http://freshmeat.net/projects/gnupod/">http://freshmeat.net/projects/gnupod/</a>
</div>
<p>A big thanks to Jeff for working out the<br />
file format of the new files and to Adrian for working out the new<br />
iTunesDB flags needed to make this work and for updating the gnupod<br />
scripts to work with the shuffle.
</p>
<p>After my <a href="http://chris.geekcollective.com/blog/_archives/2005/1/23/273932.html">initial post</a>,<br />
I've been working with the gnupod and foo_pod authors to get them<br />
samples of different iTunesSD and other files to get the formats worked<br />
out. Jeff (foo_pod)&nbsp;has been updating the <a href="http://ipodlinux.org/ITunesDB#iTunesSD_file">iTunesDB wiki page</a><br />
with the file format info for iTunesSD and iTunesStats files that the<br />
shuffle uses. If this kind of thing gets you moist with anticipation,<br />
be sure to check it regularly.</p>
<p>I'm not sure where all this will lead yet but it looks like it will<br />
help Windows and Linux users to be able to use their shuffle with<br />
software other than iTunes. That is a good thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamzed.com/2005/01/26/ipod-shuffle-linux-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>using the treo 600 as a gprs modem on linux</title>
		<link>http://iamzed.com/2005/01/02/using-the-treo-600-as-a-gprs-modem-on-linux/</link>
		<comments>http://iamzed.com/2005/01/02/using-the-treo-600-as-a-gprs-modem-on-linux/#comments</comments>
		<pubDate>Mon, 03 Jan 2005 03:08:19 +0000</pubDate>
		<dc:creator>Chris Scott</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Treo 600]]></category>

		<guid isPermaLink="false">http://www.iamzed.com/?p=682</guid>
		<description><![CDATA[<p>UPDATE: 1/2/04 to add Palm app. to go in and out of tethered mode and prevent having to reset device.</p>
<p>I recently changed to Ubuntu Linux on my laptop. I previously used<br />
PdaNet on XP to use my Treo 600 as a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>UPDATE: 1/2/04 to add Palm app. to go in and out of tethered mode and prevent having to reset device.</p>
<p>I recently changed to Ubuntu Linux on my laptop. I previously used<br />
PdaNet on XP to use my Treo 600 as a GPRS modem and wanted to do the<br />
same thing now. After a bit of searching and some trial and error, I<br />
got it working. Here&#39;s what I ended up doing. My provider is T-Mobile<br />
so the Init3 and Phone settings in /etc/wvdial.conf may vary for other<br />
providers.</p>
<p>Edit /etc/wvdial.conf and add the following:</p>
<div><code>[Dialer Defaults]<br />
Modem = /dev/ttyUSB1<br />
<br />
Baud = 57600</p>
<p>[Dialer ppp0]<br />
<br />
Init1 = ATH<br />
<br />
Init2 = ATE1<br />
<br />
Init3 = at+cgdcont=1,"ip","wap.voicestream.com"<br />
Dial Command = ATD<br />
<br />
Password = web<br />
<br />
Init1 = ATZ<br />
<br />
Phone = *99***1#<br />
<br />
Username = web<br />
<br /></code>
</div>
<p>
Edit /etc/ppp/options and comment out the following lines (this<br />
prevents pppd from disconnecting after 2 minutes):<br />

<div><code>lcp-echo-interval 30<br />
<br />
lcp-echo-failure 4<br />
<br /></code>
</div>
<p>
After editing the above files and saving them, connect your Treo using<br />
the USB data cable. Depending on which port you plug in to, you may<br />
need to edit number at the end of the Modem setting in wvdial.conf. On<br />
my system, when I plug it in I get two new USB devices created,<br />
/dev/ttyUSB0 and /dev/ttyUSB1 even though only one of them has a device<br />
plugged in. I assume that the kernel activates all ports on the hub.</p>
<p>Download the following app and do a HotSync to install it:<br />
<a href="http://butterfeet.org/wireless-modem.prc">http://butterfeet.org/wireless-modem.prc</a><br />
This will enable you to put the Treo in and out of tethered mode easily<br />
without having to dial the number manually and without having to reset<br />
it to get out of tethered mode.</p>
<p>On your Treo, start the Modem app you installed above. Choose USB as the port and click on Enabled. Now,<br />
on your computer start wvdial to dial the modem and start pppd using the following:<br />
</p>
<div>wvdial ppp0<br />

</div>
<p>
If everything went well, you should get a connection.<br />
Hit Ctrl+C to disconnect.</p>
<p>References:<br />
<a href="http://www.kevinboone.com/treo_notes.html">http://www.kevinboone.com/treo_notes.html</a><br />
<a href="http://www.1src.com/forums/showthread.php?p=680621#post680621">http://www.1src.com/forums/showthread.php?p=680621<br />
#post680621</a><br />
<a href="http://sourceforge.net/mailarchive/forum.php?forum_id=4987&amp;max_rows=25&amp;style=nested&amp;viewmonth=200404">http://sourceforge.net/mailarchive/forum.php?forum_id=4987&amp;<br />
max_rows=25&amp;style=nested&amp;viewmonth=200404</a><br /> <a href="http://discuss.treocentral.com/showthread.php?t=49400&amp;page=1&amp;pp=20">http://discuss.treocentral.com/showthread.php?t=49400<br />
&amp;page=1&amp;pp=20</a></p>
]]></content:encoded>
			<wfw:commentRss>http://iamzed.com/2005/01/02/using-the-treo-600-as-a-gprs-modem-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>how to: create firefox search plugins</title>
		<link>http://iamzed.com/2004/11/22/how-to-create-firefox-search-plugins/</link>
		<comments>http://iamzed.com/2004/11/22/how-to-create-firefox-search-plugins/#comments</comments>
		<pubDate>Tue, 23 Nov 2004 00:45:04 +0000</pubDate>
		<dc:creator>Chris Scott</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://www.iamzed.com/?p=672</guid>
		<description><![CDATA[<p>Last week I had some time so I figured I'd create a search plugin for Firefox to search the <a href="http://orlando.citywikis.com/">Orlando Wiki</a>. I thought this would be a quick effort. Alas, I was wrong.&#160;Sure, the <a href="http://mycroft.mozdev.org/deepdocs.html">Mycroft docs</a> are good,&#160;but I figured there&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Last week I had some time so I figured I'd create a search plugin for Firefox to search the <a href="http://orlando.citywikis.com/">Orlando Wiki</a>. I thought this would be a quick effort. Alas, I was wrong.&nbsp;Sure, the <a href="http://mycroft.mozdev.org/deepdocs.html">Mycroft docs</a> are good,&nbsp;but I figured there had to be something on the web with a quick howto.&nbsp;Since I didn't find one, here it is.</p>
<p>Step One: Create a .src File</p>
<p>The<br />
.src file is what tells the search feature how to conduct the search<br />
and, optionally, how to interpret the results. Here's the .src file I<br />
created:&nbsp;</p>
</p>
<pre>&lt;search		version="7.1"	name="Orlando Wiki Search"	description="Search the Orlando Wiki"	action="http://orlando.citywikis.com/tiki-searchresults.php"	method="GET"	target="_blank"&gt;

&lt;input name="sourceid" value="Mozilla-search"&gt;&lt;input name="words" user=""&gt;&lt;input name="where" value="pages"&gt;</pre>
<p>This<br />
is all that's needed for a very basic search that uses GET (a<br />
querystring URL) to perform the search and displays the results page in<br />
the browser. Let's take a look at this file and what it means.</p>
<p>The version="7.1" attribute of the search tag should be just<br />
that.&nbsp;<br />
Don't mess with it. The name attribute is what you can use to give your<br />
plugin a name. The description attribute is for the description. The<br />
action attribute is the base URL to your search page. This must be a<br />
page that uses GET (a querystring). This is everything before the ? in<br />
a URL that you would see in your browser's address bar when you do a<br />
search. The method attribute should be GET. Use target="_blank" to have<br />
your results open in a new window (or tab, depending on your config).<br />
Use target="" to open in an existing page/tab.
</p>
<p>The next few input<br />
tags are used to build the querystring sent to the server. The sourceid<br />
input should be there and left as it is above--don't ask me why, I just<br />
recall that it is part of the spec. The next two input tags need to<br />
correspond to the GET variables your server is expecting to execute the<br />
search. For example, when I go to the wiki and do a search for wifi,<br />
the URL that is used is: <a href="http://orlando.citywikis.com/tiki-searchresults.php?search=go&amp;words=wifi&amp;where=pages">http://orlando.citywikis.com/tiki-searchresults.php?search=go&amp;words=wifi&amp;where=pages</a> </p>
<p>The search=go is the value of the search button on the search page and<br />
isn't used to process the search--you can tell by leaving it our of the<br />
URL. The words=wifi is where the search string I typed is passed in. To<br />
make this into an input tag, take the field name (words) and use that<br />
as the name attribute value. The search terms entered in a Firefox<br />
toolbar search will be passed in as the user value (or at least that's<br />
what I'm assuming since I have no idea about the internals and I'm too<br />
lazy to read the docs ;-). That is where the user="" comes from in the<br />
input tag.
</p>
<p>The last input tag is used to specify where to<br />
search.&nbsp; This is determined by the wiki--I'm just using the<br />
name="where" and value="pages" to match the querystring.</p>
<p>OK, now<br />
you have your .src file. Save it. I used orl-wiki-search.src as the<br />
filename. Note that&nbsp;you will be using the base name (without the<br />
.src extension) of this file later on and it will also show up<br />
in&nbsp;the user's searchplugins folder&nbsp;when it is<br />
installed,&nbsp;so pick something that makes sense.</p>
<p>Step Two: Creating the Icon</p>
<p>When<br />
you load a search plugin, it has an icon that it shows in the toolbar.<br />
From what I gather of the spec, this is optional but having no icon is<br />
just lame, so let's create one. Use your favorite image editing program<br />
to create a 16&#215;16 PNG file. You can use GIF also, but I couldn't get it<br />
to work and don't really care why since PNG worked fine ;-). Save that<br />
file with a .png extension using the same base name as your .src file.<br />
This is important if you want it to work. Since my .src file is<br />
orl-wiki-search.src, my icon file is orl-wiki-search.png.</p>
<p>Step Three: Adding JavaScript and Creating the Install Link</p>
<p>To install a search plugin, you have to use a bit of JavaScript code which you'll call using a link. Here's the code:</p>
</p>
<pre>&lt;script type="text/javascript"&gt;function addEngine(name,ext,cat){	if ((typeof window.sidebar == "object") 		&amp;&amp; (typeof  window.sidebar.addSearchEngine == "function"))	{		window.sidebar.addSearchEngine("http://chris.geekcollective.com/" + name + ".src",			"http://chris.geekcollective.com/" + name + "." + ext,			name, cat );	}	else	{		//you could put an error handler here		;	}}&lt;/script&gt;</pre>
<p>Put<br />
this in the HEAD of your page or an external .js file that is linked in<br />
to your page. You can put it in the BODY in a pinch (as I did since I<br />
put this on my blog and doing per-page HEAD modifications wasn't<br />
something I wanted to think about. I was lazy and didn't feel like<br />
changing the script I lifted to figure out the base URL of the site it<br />
is on so you'll need to change <a href="http://chris.geekcollective.com/">http://chris.geekcollective.com/</a> to your own site if you use this. Other than that, this doesn't need to be modified.
<p>To create the link that will be used to install, use the following HTML code:</p>
</p>
<pre>&lt;a href="javascript:addEngine(&#39;orl-wiki-search&#39;, &#39;png&#39;, &#39;Orlando Wiki Search&#39;)"&gt;install it&lt;/a&gt;</pre>
</p>
<p>Change<br />
orl-wiki-search to the base name of your .src and .png files. Leave png<br />
as it is unless you are using a gif file, then change it to gif. I'm<br />
sure the third parameter for the category should be something different<br />
but since I couldn't find any good docs on it, I made up my own. It<br />
seems to work, but if anyone has any info. on this, I'd like to know.</p>
<p>That's it. <a href="http://chris.geekcollective.com/blog/_archives/2004/11/19/187278.html">See it work here</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://iamzed.com/2004/11/22/how-to-create-firefox-search-plugins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>smarty output processor, mod_rewrite, and TikiWiki</title>
		<link>http://iamzed.com/2004/11/18/smarty-output-processor-mod_rewrite-and-tikiwiki/</link>
		<comments>http://iamzed.com/2004/11/18/smarty-output-processor-mod_rewrite-and-tikiwiki/#comments</comments>
		<pubDate>Thu, 18 Nov 2004 23:32:13 +0000</pubDate>
		<dc:creator>Chris Scott</dc:creator>
				<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://www.iamzed.com/?p=667</guid>
		<description><![CDATA[<p><b>UPDATED 11/18/04:</b> Modified code to handle action= and other querystrings. This fixes a problem with the Lock and Unlock page links not working</p>
<p><a href="http://www.tikiwiki.org/">TikiWiki</a> is very nice. I used it to set up the <a href="http://orlando.citywikis.com/">Orlando Wiki</a>&#160;and was very happy with everything you could&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><b>UPDATED 11/18/04:</b> Modified code to handle action= and other querystrings. This fixes a problem with the Lock and Unlock page links not working</p>
<p><a href="http://www.tikiwiki.org/">TikiWiki</a> is very nice. I used it to set up the <a href="http://orlando.citywikis.com/">Orlando Wiki</a>&nbsp;and was very happy with everything you could do with it until <a href="http://www.hivelogic.com/">Dan</a><br />
looked a the wiki and said something to the effect of "good, now let&#39;s<br />
rewrite those URLs to get good search engine rankings". After a heated<br />
IM debate on whether it mattered to Google if links to the wiki pages<br />
were querystrings (e.g. <a href="http://orlando.citywikis.com/tiki-index.php?page=HomePage">http://orlando.citywikis.com/tiki-index.php?page=HomePage</a>) or if they were SEF (search engine friendly) URLs (e.g. <a href="http://orlando.citywikis.com/HomePage">http://orlando.citywikis.com/HomePage</a>)<br />
I was swayed by Dan&#39;s persuasive argument (which boiled down to: you<br />
are wrong and I know it) and decided to change the URLs to be SEF.</p>
<p>I<br />
figured we could use mod_rewrite in a .htaccess file to rewrite the<br />
incoming requests to something that TikiWiki can understand. This<br />
turned out to be easy when I came across a post describing <a href="http://tikiwiki.org/tiki-index.php?page=TikiWikiRewriteRule">how to do this</a>.<br />
So, now we have the incoming links being rewritten, but what about the<br />
links the TikiWiki spits out? Since it uses Smarty, we can hook into<br />
the page processor and rewrite the output before it is sent to the<br />
browser. Someone had already <a href="http://www.coofercat.com/2003/00000010.html">described how to do this</a>, so I had a place to start.</p>
<p>Basically,<br />
you have to write a function that the Smarty&nbsp;output<br />
filter&nbsp;can use. I used the code in the article above as a base. To<br />
do what I wanted was much simpler--at least it was after battling to<br />
get the correct regexp. Here&#39;s the code I used as the output filter: 
</p>
<pre>&lt;?
function smarty_outputfilter_urlt($string) {
&nbsp;&nbsp;&nbsp;&nbsp; $result = preg_replace(&#39;/&lt;a(.*?)href="\"tiki\-index\.php\?page="(.*?)\"(.*?)""&gt;/&#39;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;&lt;a$1href="$2"$3&gt;&#39;,$string);
&nbsp;&nbsp;&nbsp;&nbsp; // If the page was passed in an action, the link that was
&nbsp;&nbsp;&nbsp;&nbsp; // &#39;tiki-index.php?page=foo&amp;action=lock&#39; will now look like &#39;foo&amp;action=lock&#39;
&nbsp;&nbsp;&nbsp; &nbsp;// The first &amp; needs to be converted to a ?
&nbsp;&nbsp;&nbsp; &nbsp;$result = preg_replace(&#39;/(href=\"[a-zA-Z0-9]+?)(&amp;amp;|&amp;)/&#39;, &#39;$1?&#39;, $result);
&nbsp;&nbsp;&nbsp;&nbsp; return $result;
}
?&gt;</pre>
<p>I saved that as outputfilter.urlt.php and uploaded it to the<br />
lib/smarty/plugins directory. The next step was to add the following<br />
line at the end of the code in setup_smarty.php in the root of the site:</p>
</p>
<pre>$smarty-&gt;load_filter(&#39;output&#39;,&#39;urlt&#39;);</pre>
<p>This filter rewrites the URLs to be more SEF. Check out the home page of the <a href="http://orlando.citywikis.com/">Orlando wiki</a> for an example.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamzed.com/2004/11/18/smarty-output-processor-mod_rewrite-and-tikiwiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
