<?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>Guillaume Boudreau Geek Blog &#187; Mac OS X</title>
	<atom:link href="http://www.pommepause.com/blog/category/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pommepause.com/blog</link>
	<description>My Geek Life</description>
	<lastBuildDate>Mon, 03 Oct 2011 14:53:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Show/Hide DesktopShelves using a Hot Corner</title>
		<link>http://www.pommepause.com/blog/2011/10/showhide-desktopshelves-using-a-hot-corner/</link>
		<comments>http://www.pommepause.com/blog/2011/10/showhide-desktopshelves-using-a-hot-corner/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 14:24:36 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/blog/?p=434</guid>
		<description><![CDATA[Here's how I setup a Hot Corner to show or hide my DesktopShelves.
(Note that this trick can also be used to launch any program or AppleScript using a Hot Corner.)]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I setup a Hot Corner to show or hide my DesktopShelves.<br/><br />
(Note that this trick can also be used to launch any program or AppleScript using a Hot Corner.)<br/><br />
<br/><br />
The magic lies in a nice piece of software written by <a class="vt-p" href="http://swannman.wordpress.com/">Matt Swann</a>: <a class="vt-p" href="http://swannman.wordpress.com/projects/scriptsaver/">ScriptSaver</a><br/><br />
This screen saver will in fact execute any AppleScript you specify instead (or before) launching a screen saver.<br/><br />
<br/><br />
Here&#8217;s step-by-step instructions for how to use it to show &#038; hide your DesktopShelves:</p>
<ul>
<li>Download <a class="vt-p" href="http://swannman.wordpress.com/projects/scriptsaver/">ScriptSaver</a></li>
<li>Download the AppleScript I created: <a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2011/10/ActivateDesktopShelves.scpt_.zip">ActivateDesktopShelves.scpt</a> or, if you&#8217;d like to use the iPhoto screen saver instead of the standard ones (Arabesque, Flurry, &#8230;), use this script instead: <a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2011/10/ActivateDesktopShelves-iPhotoScreenSaver.scpt_.zip">ActivateDesktopShelves-iPhotoScreenSaver.scpt</a></li>
<li>Download MouseLocation* using <strong>Terminal.app</strong>. (Just paste the complete line below in Terminal.)<br />
[crayon nums="false" title="Terminal.app"]curl -so /tmp/MouseLocation.zip http://www.pommepause.com/blog/wp-content/uploads/2011/10/MouseLocation.zip ; unzip /tmp/MouseLocation.zip ; sudo mv MouseLocation /usr/local/opt/[/crayon]</li>
<li>Extract the AppleScript from the above download, and put the .scpt file in ~/Applications (or anywhere really!)</li>
<li>If you&#8217;ll be using ActivateDesktopShelves.scpt, open it in AppleScript Editor (just double-click it) and change the 2nd line from the bottom to start your preferred screen saver. The default is &#8220;Flurry&#8221;, and the list of available screen savers appears just above that line. Save it once you&#8217;re done.</li>
<li>If you&#8217;ll be using ActivateDesktopShelves-iPhotoScreenSaver.scpt instead, there&#8217;s two additional steps:</li>
<ul>
<li>Go in <strong>System Preferences</strong>, and select the iPhoto screen saver. Chooses the options you&#8217;d like to use.</li>
<li>In <strong>Terminal</strong>, create a copy of the screen saver preferences file. (Just paste the following 3 lines in Terminal.)<br />
[crayon lang="bash" nums="false" title="Terminal.app"]uuid=`/usr/sbin/system_profiler SPHardwareDataType | grep &#8216;Hardware UUID&#8217; | cut -c22-57`<br />
file=~/Library/Preferences/ByHost/com.apple.screensaver.$uuid.plist<br />
cp $file $file.iPhoto[/crayon]</li>
</ul>
<li>Install ScriptSaver: double click the <strong>ScriptSaver.saver</strong> file</li>
<li>Click <strong>Options&#8230;</strong></li>
<ul>
<li>Activation Script: select the .scpt file you downloaded above (in ~/Applications)</li>
<li>Run asynchronously: checked</li>
<li>Screen Saver: None</li>
<li>Deactivation Script: empty</li>
<li>Show desktop while synchronous scripts execute: checked</li>
</ul>
<li>Click <strong>Hot Corners&#8230;</strong> Assign one or more Hot Corner to <strong>Start Screen Saver</strong>.</li>
</ul>
<p>The AppleScript will detect if the mouse is in a corner, and if so, will launch DesktopShelves.app, which will in turn display your shelves.<br/><br />
If the mouse isn&#8217;t in a corner, then your screen saver will start.<br/><br />
<br/><br />
Voilà! A nice way to start any app using a Hot Corner, and a nice way to use DesktopShelves only with your mouse.<br/><br />
<br/><br />
<strong>Footnotes</strong><br/><br />
* MouseLocation is a simple Objective-C executable created using the following code:<br />
[crayon lang="objective-c" title="MouseLocation.m"]<br />
#import <AppKit/AppKit.h></p>
<p>int main (int argc, const char * argv[]) {<br />
	NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];</p>
<p>	NSPoint mouseLoc = [NSEvent mouseLocation]; //get current mouse position<br />
	NSString* locString = [NSString stringWithFormat:@"%.0f, %.0f", mouseLoc.x, mouseLoc.y];<br />
	printf(&#8220;%s\n&#8221;, [locString UTF8String]);</p>
<p>	[pool drain];<br />
	return 0;<br />
}<br />
[/crayon]<br />
Compiled using the following command (Xcode required):<br />
[crayon lang="bash" nums="false" title="Terminal.app"]<br />
sudo gcc -o /usr/local/opt/MouseLocation MouseLocation.m -framework AppKit<br />
[/crayon]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2011/10/showhide-desktopshelves-using-a-hot-corner/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Start iPhoto screen saver from AppleScript</title>
		<link>http://www.pommepause.com/blog/2011/10/start-iphoto-screen-saver-from-applescript-2/</link>
		<comments>http://www.pommepause.com/blog/2011/10/start-iphoto-screen-saver-from-applescript-2/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 10:02:22 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/blog/?p=439</guid>
		<description><![CDATA[Starting the screen saver from AppleScript is simple enough. Even starting another screen saver than the default from System Preferences is simple, if you want one of the standard screen saver. But it becomes much more complicated if you'd like to start the iPhoto screen saver, and use another as the System Preferences default. Here's how I did it.]]></description>
			<content:encoded><![CDATA[<p>Starting the screen saver from AppleScript is simple enough:<br />
[crayon lang="applescript" nums="false" title="AppleScript Editor.app"]tell application &#8220;System Events&#8221; to start current screen saver[/crayon]<br />
Even starting another screen saver than the default from System Preferences is simple, if you want one of the standard screen saver:<br />
[crayon lang="applescript" nums="false" title="AppleScript Editor.app"]tell application &#8220;System Events&#8221; to tell screen saver &#8220;Arabesque&#8221; to start[/crayon]<br />
But it becomes much more complicated if you&#8217;d like to start the iPhoto screen saver, and use another as the System Preferences default.<br />
Here&#8217;s how I did it:</p>
<ul>
<li>Go in <strong>System Preferences</strong>, and select the iPhoto screen saver. Chooses the options you&#8217;d like to use.</li>
<li>In <strong>Terminal</strong>, create a copy of the screen saver preferences file:<br />
[crayon lang="bash" nums="false" title="Terminal.app"]uuid=`/usr/sbin/system_profiler SPHardwareDataType | grep &#8216;Hardware UUID&#8217; | cut -c22-57`<br />
file=~/Library/Preferences/ByHost/com.apple.screensaver.$uuid.plist<br />
cp $file $file.iPhoto[/crayon]</li>
<li>Go back in <strong>System Preferences</strong>, and change the screen saver to the other screen saver you&#8217;d like to use as your default.</li>
</ul>
<p>Once you did all that, here&#8217;s how to start the iPhoto screen saver from AppleScript:<br />
[crayon lang="applescript" title="AppleScript Editor.app"]<br />
tell application &#8220;System Events&#8221;<br />
set uuid to do shell script (&#8220;/usr/sbin/system_profiler SPHardwareDataType | grep &#8216;Hardware UUID&#8217; | cut -c22-57&#8243;)<br />
set theFolder to folder (preferences folder&#8217;s path &amp; &#8220;ByHost&#8221;)<br />
set theFile to &#8220;com.apple.screensaver.&#8221; &amp; uuid &amp; &#8220;.plist&#8221;<br />
do shell script &#8220;cd &#8221; &amp; POSIX path of theFolder &amp; &#8220;; cp &#8221; &amp; theFile &amp; &#8221; &#8221; &amp; theFile &amp; &#8220;.orig; cp &#8221; &amp; theFile &amp; &#8220;.iPhoto &#8221; &amp; theFile<br />
start current screen saver<br />
do shell script &#8220;sleep 5; cd &#8221; &amp; POSIX path of theFolder &amp; &#8220;; cp &#8221; &amp; theFile &amp; &#8220;.orig &#8221; &amp; theFile<br />
end tell<br />
[/crayon]<br />
Explanations:</p>
<ul>
<li>line 2: find the machine&#8217;s UUID; this is needed because the screen saver preferences file contains that in it&#8217;s name;</li>
<li>line 3: the folder where the preferences file is: ~/Library/Preferences/ByHost/;</li>
<li>line 4: the name of the preferences file: com.apple.screensaver.[UUID].plist;</li>
<li>line 5: create a .orig backup of the current preferences file, and then overwrite it with the iPhoto copy that was created manually above;</li>
<li>line 6: start the iPhoto screen saver;</li>
<li>line 7: wait 5 seconds, to allow the iPhoto screen saver some time to launch, then put back the .orig backup we made at line 5, so that your default screen saver will be used when it&#8217;s time.</li>
</ul>
<p>Convoluted? Yes. Achieves the desired result? You bet!</p>
<p>I did this because I wanted to show the iPhoto screen saver when an AppleScript triggered by ScriptSaver was executed. More details in <a class="vt-p" title="Show/Hide DesktopShelves using a Hot Corner" href="http://www.pommepause.com/blog/2011/10/showhide-desktopshelves-using-a-hot-corner/">Show/Hide DesktopShelves using a Hot Corner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2011/10/start-iphoto-screen-saver-from-applescript-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Videotron Internet Usage Monitor</title>
		<link>http://www.pommepause.com/blog/2011/03/videotron_internet_usage_monitor/</link>
		<comments>http://www.pommepause.com/blog/2011/03/videotron_internet_usage_monitor/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 17:29:26 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/blog/?p=362</guid>
		<description><![CDATA[Would you like to monitor your monthly Videotron Internet quota easily? Use either my Mac Dashboard widget, or my Google Chrome Extension.]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; border: 1px solid #E6DB55; background: lightYellow; width: 500px; padding: 10px 0 10px 0; margin: 0 auto;"><strong><span style="color: #ff0000;"><span style="color: #000000;">Important note:</span> the softwares below are now officially unsupported.<br />
</span>I&#8217;m not a Videotron client anymore, so it became difficult, and without interest, for me to continue development on both of those solutions to track your bandwidth quota.<br />
</strong><br />
<strong>If you know any developer that might be interested in continuing development and support, feel free to send them a note.</strong><br />
<strong>(JavaScript is the main programming language of both softwares.)</strong></div>
<p>Would you like to monitor your monthly Videotron Internet quota easily?</p>
<p>I offer two choices:</p>
<p>1) a <a class="vt-p" href="https://chrome.google.com/webstore/detail/fnhepcakkcnkaehfhpagimbbkpelkdha">Google Chrome extension</a></p>
<p><a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2011/03/videotron_chrome_ext_ss.png"><img class="alignnone size-full wp-image-425" title="videotron_chrome_ext_ss" src="http://www.pommepause.com/blog/wp-content/uploads/2011/03/videotron_chrome_ext_ss.png" alt="" width="400" height="275" /></a></p>
<p>2) a <a class="vt-p" href="http://www.pommepause.com/blog/2010/01/mac-widget-videotron-internet-usage-monitor/">Mac Dashboard widget</a></p>
<p><img class="alignnone" src="http://www.pommepause.com/blog/wp-content/uploads/2010/01/screenshot1.png" alt="Mac Dashboard widget screenshot" width="400" height="180" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2011/03/videotron_internet_usage_monitor/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Hacking Crome extensions &#8211; How I added keyboard shortcuts to 1Password in Chrome</title>
		<link>http://www.pommepause.com/blog/2010/05/hacking-crome-extensions-how-i-added-keyboard-shortcuts-to-1password-in-chrome/</link>
		<comments>http://www.pommepause.com/blog/2010/05/hacking-crome-extensions-how-i-added-keyboard-shortcuts-to-1password-in-chrome/#comments</comments>
		<pubDate>Fri, 14 May 2010 13:02:30 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/blog/?p=249</guid>
		<description><![CDATA[I love 1Password. It looks good, it's safe, it has a web-accessible UI, it has an iPhone/iPad application...

What I didn't like about it was it's Chrome extension, which required me to use the mouse to click the 1Password icon in the toolbar each time I wanted to auto-fill a form with login details!! That was so annoying.

So annoying in fact that I took upon myself to implement keyboard shortcuts in the 1Password extensions.]]></description>
			<content:encoded><![CDATA[<p>I love <a class="vt-p" href="http://agilewebsolutions.com/products/1Password">1Password</a>. It looks good, it&#8217;s safe, it has a web-accessible UI, it has an iPhone/iPad application&#8230;</p>
<p>What I didn&#8217;t like about it was it&#8217;s Chrome extension, which required me to use the mouse to click the 1Password icon in the toolbar each time I wanted to auto-fill a form with login details!! That was so annoying.</p>
<p>So annoying in fact that I took upon myself to implement keyboard shortcuts in the 1Password extensions.<span id="more-249"></span> I knew it wouldn&#8217;t be that hard, since Chrome extensions are basically JavaScript &amp; HTML files.</p>
<p>And it turned out to be pretty easy indeed:</p>
<p>I added an event listener for keyUp in the content script (that&#8217;s executed each time a page is loaded):</p>
<pre>window.addEventListener("keyup", keyListener, false);</pre>
<p>Then in the keyListener function, I simply check for the keyboard shortcuts I want:</p>
<pre>if (e.ctrlKey &amp;&amp; e.keyCode) {
  if (e.keyCode == 220 || e.keyCode == 191 || (e.altKey &amp;&amp; e.keyCode == 80)) {
    chrome.extension.sendRequest({name: "openPopUp"});
  }
}</pre>
<p>That sendRequest line simply calls another JavaScript function, but a function that is defined and executed in the &#8216;background&#8217; context (the equivalent of a singleton pattern for Chrome extensions).<br />
In the background HTML file, I simply added some code in that function that would popup a small window that would show the same popup.html file as when I clicked the 1Password button in the toolbar.</p>
<pre>var url = chrome.extension.getURL('popup.html');
[...]
window.popUpWindow = window.open(url, "1Password for Chrome", options);</pre>
<p>The only thing left was to change the existing functions from popup.html that fetched the available login informations, and auto-filled the forms, to use the parent tab, instead of the current tab, when invoked from the popup.<br />
And how lucky I was; there was already a null parameter used for the target window in both those functions! I simply changed that parameter to the parent window id, if the popup was invoked from the keyboard, and that&#8217;s it! <img src='http://www.pommepause.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I now have a working 1Password extension that I can use without my hands leaving the keyboard.</p>
<p>I created a patch of my changes, and posted it in the <a class="vt-p" href="http://support.agilewebsolutions.com/showthread.php?22830-Does-this-mean-that-we-could-use-a-keystroke&amp;p=117474#post117474">1Password forums</a>, so that them developers could take it and base the official implementation from there.</p>
<p>If you really must try it yourself, you can try to patch your extension (version 0.6.2; might not work on future versions; but you can try).<br />
Download <a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2010/05/1password_chrome_extension_keyboard_shorcut.patch.txt">1password_chrome_extension_keyboard_shorcut.patch.txt</a> first on your desktop.</p>
<p>In Terminal.app:</p>
<pre>cd Library/Application\ Support/Google/Chrome/Default/Extensions/gkndfifopckmhdkohjeoljlbfnjhekfg/0.6.2/
patch &lt; ~/Desktop/1password_chrome_extension_keyboard_shorcut.patch.txt</pre>
<p>Result should look like:</p>
<pre>patching file onepassword_background.html
patching file onepassword_loader.js
patching file popup.html
patch unexpectedly ends in middle of line</pre>
<p>Restart Chrome.<br />
Then try the shortcuts: Ctrl-/ or Ctrl-\</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2010/05/hacking-crome-extensions-how-i-added-keyboard-shortcuts-to-1password-in-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Network-wide incoming calls notifications using Growl, Boxcar and XBMC</title>
		<link>http://www.pommepause.com/blog/2010/05/network-wide-incoming-call-notifications-using-growl-and-xbmc/</link>
		<comments>http://www.pommepause.com/blog/2010/05/network-wide-incoming-call-notifications-using-growl-and-xbmc/#comments</comments>
		<pubDate>Thu, 13 May 2010 00:33:42 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/blog/?p=230</guid>
		<description><![CDATA[Earlier this week, I stumbled upon an iPhone app that allowed users to receive push notifications on XBMC.
When a notification is received in XBMC, it appears in the lower right corner of the screen.
Pretty cool.

This made me think it would be nice to see incoming phone calls there.

So I took out the Ovolab Phlink device I had sitting on a shelf, and created a small 'ring' script for it. That (Apple)script checks for the caller ID when the phone rings (and for a matching entry in my address book), and if it is available, calls an external PHP script that handles the network-wide notifications.]]></description>
			<content:encoded><![CDATA[<p>Earlier this week, I stumbled upon an iPhone app that allowed users to receive push notifications on XBMC.<br />
When a notification is received in XBMC, it appears in the lower right corner of the screen.<br />
Pretty cool.</p>
<p>This made me think it would be nice to see incoming phone calls there.</p>
<p>So I took out the Ovolab Phlink device I had sitting on a shelf, and created a small &#8216;ring&#8217; script for it. That (Apple)script checks for the caller ID when the phone rings (and for a matching entry in my address book), and if it is available, calls an external PHP script that handles the network-wide notifications.<span id="more-230"></span></p>
<p>That script takes in parameters:</p>
<ul>
<li>the message to send</li>
<li>a title</li>
<li>the list of recipients (computers)</li>
<li>the image to use for the Growl notifications (XBMC notifications don&#8217;t show any images, just a title and the message).</li>
</ul>
<p>So, before calling this PHP script, the ring script will create the message to send, and if there&#8217;s a picture for that person in my address book, it will save that picture to a shared directory on the local computer. Remote computers all have that shared directory mounted all the time, so they instantly have access to the caller photo, if any. <img src='http://www.pommepause.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The notification PHP script then loop on all recipient computers, and depending on what they are will either:</p>
<ul>
<li>Call growlnotify remotely using SSH</li>
<li>Make a HTTP call to the remote XBMC process, to send the notification</li>
<li>Make a HTTPS call to the Boxcar API, to send a Push notification on iPhone / iPad devices</li>
</ul>
<p>This worked really well. But I wanted to go one step further.</p>
<p>On the XBMC running on the Mac Mini that we use as home theater, I wanted to pause whatever was playing when the phone rang. Luckily, there&#8217;s also a HTTP call available to do that. Sadly, I soon realized that the &#8220;Paused&#8221; graphic appeared over any notifications! If I paused the video, the notification would simply not be readable.<br />
I <em>fixed</em> that by using Growl on that computer. The Growl notifications appear over everything, and the currently playing videos is paused. Hooray!</p>
<p><a class="vt-p" href="http://www.flickr.com/photos/gboudreau/4602881864/"><img src="http://farm5.static.flickr.com/4018/4602881864_ca8c43b4f8.jpg" alt="" /></a><br />
<span style="font-size: 11px;">Notification using Growl + paused XBMC</span></p>
<p><a class="vt-p" href="http://www.flickr.com/photos/gboudreau/4602280447/"><img src="http://farm5.static.flickr.com/4063/4602280447_fed6102412.jpg" alt="" /></a><br />
<span style="font-size: 11px;">Notification using XBMC on Apple TV</span></p>
<p>Here&#8217;s my scripts:<br />
<a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2010/05/ring.scpt_.txt">ring.scpt<br />
</a><a class="vt-p" href="/blog/wp-content/uploads/2010/05/automate_notification.php_.txt">automate_notification.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2010/05/network-wide-incoming-call-notifications-using-growl-and-xbmc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Widget: Vidéotron Internet Usage Monitor</title>
		<link>http://www.pommepause.com/blog/2010/01/mac-widget-videotron-internet-usage-monitor/</link>
		<comments>http://www.pommepause.com/blog/2010/01/mac-widget-videotron-internet-usage-monitor/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:13:02 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/videotron_usage_monitor_widget.html#unique-entry-id-11</guid>
		<description><![CDATA[Having received earlier this week a letter from Vidéotron, my ISP, about my account getting capped at 100GB monthly in the upcoming months, I decided I needed an easy way to monitor my monthly bandwidth usage. A Dashboard widget was a good fit.]]></description>
			<content:encoded><![CDATA[<div style="text-align: center; border: 1px solid #E6DB55; background: lightYellow; width: 500px; padding: 10px 0 10px 0; margin: 0 auto;"><strong><span style="color: #ff0000;"><span style="color: #000000;">Important note:</span> the software below is now officially unsupported.<br />
</span>I&#8217;m not a Videotron client anymore, so it became difficult, and without interest, for me to continue development of this solution to track your bandwidth quota.<br />
</strong><br />
<strong>If you know any developer that might be interested in continuing development and support, feel free to send them a note.</strong><br />
<strong>(JavaScript is the main programming language.)</strong></div>
<p>&nbsp;</p>
<h3 style="text-align: center; border: 1px solid #E6DB55; background: lightYellow; width: 300px; padding: 10px 0 10px 0; margin: 0 auto;"><a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2010/01/Videotron-Internet-Usage-Monitor.wdgt-139.zip">Download the widget</a> version 1.3.9</h3>
<p style="text-align: center;"><strong>What&#8217;s new in 1.3.9</strong><br />
Bugfix: During the 1st day of the month, you could see<br />
a warning about reaching &#8216;infinity&#8217; at the end of the month!</p>
<hr />
<p><strong>Update</strong>: There is now a <a class="vt-p" href="https://chrome.google.com/webstore/detail/fnhepcakkcnkaehfhpagimbbkpelkdha">Google Chrome extension</a> that replicates this widget&#8217;s functionalities (and adds notifications). Get it on the <a class="vt-p" href="https://chrome.google.com/webstore/detail/fnhepcakkcnkaehfhpagimbbkpelkdha">Chrome Web Store</a>.</p>
<hr />
<p>Having received earlier this week a letter from Vidéotron, my ISP, about my account getting capped at 100GB monthly in the upcoming months, I decided I needed an easy way to monitor my monthly bandwidth usage. A Dashboard widget was a good fit.</p>
<p>I downloaded a couple of widget samples from Apple.com, and started a new widget from there.</p>
<p>The end result:</p>
<p><img class="alignnone size-full wp-image-170" title="screenshot" src="http://www.pommepause.com/blog/wp-content/uploads/2010/01/screenshot1.png" alt="" width="400" height="180" /></p>
<p>A nice little widget, sitting on my Dashboard, that can tell me how much of my monthly quota I&#8217;ve used so far.<br />
Preferences are: Vidéotron Use Key (something that looks like FFFFFF1234567890), and if you&#8217;d like to visualize upload (versus download) using a different color, on the graph.</p>
<p>Enjoy, fellow Vidéotron users.</p>
<h3>Changelog</h3>
<ul>
<li><strong>1.3.9 - Bugfix: During the 1st day of the month, you could see a warning about reaching &#8216;infinity&#8217; at the end of the month!</strong></li>
<li>1.3.8 - Improvement: Give a warning when the entered User Key is not the right length (16 characters).</li>
<li>1.3.7 - Bugfix: date conversions were broken!</li>
<li>1.3.6 &#8211; Bugfix: Small fix for the &#8216;now&#8217; arrow in the small UI.<br />
Bugfix: finally working on 10.4 and Lion (10.7).<br />
Improvement: New version available looks better in French and on small UI.</li>
<li>1.3.5 &#8211; Bugfix: Incorrect end date calculation placed the &#8217;now&#8217; cursor at the wrong position.<br />
Bugfix: trying to make it work on 10.4.</li>
<li>1.3.4 &#8211; Improvement: try to prevent getting blocked by Videotron, for sending too many requests too fast. Also, better overall error handling.</li>
<li>1.3.3 &#8211; Bugfix: minimal UI was broken since 1.3.0. Also added surplus calculation details in Console, and changed back surplus number in green (was changed to red for no reason).</li>
<li>1.3.2 &#8211; Bugfix &amp; improvements: spinning wheel now disappears when it should. Current now appears in the preferences. New versions notifications will appear below the widget.</li>
<li>1.3.1 &#8211; Bugfix for Mac OS X 10.6 and lower (1.3.0 only worked on Lion&#8230; Sorry!)</li>
<li>1.3.0 &#8211; Bugfix &amp; Improvement: Now using the new public Videotron API, instead of data scraping the consumption web page! You&#8217;ll need your User Key. You can find it in your Videotron Customer Center, in the <a class="vt-p" href="https://www.videotron.com/client/user-management/secur/InitProfile.do?dispatch=initProfile&amp;tab=token&amp;lang=en&amp;caller=videotron-chrome.pommepause.com" target="_blank">User Key tab</a> of the Your Profile page.</li>
<li>1.2.8 &#8211; Bugfix: wrong plan would become selected when new plans became available. Improvement: the bandwidth used today is now accounted for. Improvement: better warning text when your limit is busted, including the approx. amount you&#8217;ll be charged for the extra.</li>
<li>1.2.7 &#8211; Bugfix: typo in JavaScript made the widget unusable on Lion. Fixed. (Thanks Anonymous for the pointer.)</li>
<li>1.2.6 &#8211; Bugfix: regression in 1.2.5; couldn&#8217;t save preferences!</li>
<li>1.2.5 &#8211; Bugfix: Basic (2GB) plan couldn&#8217;t be selected.</li>
<li>1.2.4 &#8211; Updated Vidéotron logo; bug fixed: accumulated daily surplus and &#8216;now&#8217; arrow were 1 day off; clarified that the last updated date was in fact &#8220;$date @ 23h59&#8243;; visual fix when new versions are available.</li>
<li>1.2.3 &#8211; Changed text in options, to clarify that the data transfer packages are &#8216;extras&#8217;, and the &#8216;Plan&#8217; option is what will define your monthly limit.</li>
<li>1.2.2 &#8211; Added option to select data transfer packages bought this month. The selected value will be reset when the billing month changes.</li>
<li>1.2.1 &#8211; Missing Business plans from 1.2.0; added an option to display upload using a different color on the graph.</li>
<li>1.2.0 &#8211; Easier configuration; new version available notification; now displaying numeric deviation from daily limit (surplus) &#8211; this was only shown using a small arrow on the graph before; added overcharge ($) you should expect on your invoice, if you&#8217;re over your limit.</li>
<li>1.1.6 &#8211; Better handling for wrong username; people entering anything else than their VLXXXXXX Vidéotron username will now get a relevant error message.</li>
<li>1.1.5 &#8211; Fetch new data less often; was previously checking for new data every 15 minutes when the Dashboard was open; changed that to once a day.</li>
<li>1.1.4 &#8211; Added small arrows on meters to show the current date. If the meter is higher than the arrow, it means you&#8217;ve transferred too much in regard to the current date versus the date you&#8217;re invoiced. Red arrow = bad; green arrow = good.</li>
<li>1.1.3 &#8211; Beta for 1.1.4</li>
<li>1.1.2 &#8211; Small visual changes: loading animated GIF, numbers formatted as <strong>0.xx</strong> instead of <strong>.xx</strong>.</li>
<li>1.1.1 &#8211; New French localization option; new minimal look option; fixed incorrect dates (all dates were one month early).</li>
<li>1.0.1 &#8211; Fixed missing percentage when using combined quota.</li>
<li>1.0 &#8211; First version.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2010/01/mac-widget-videotron-internet-usage-monitor/feed/</wfw:commentRss>
		<slash:comments>268</slash:comments>
		</item>
		<item>
		<title>Remote-controlled air conditioning using Mac OS X and Shion</title>
		<link>http://www.pommepause.com/blog/2009/07/remote-controlled-air-conditioning-using-mac-os-x-and-shion/</link>
		<comments>http://www.pommepause.com/blog/2009/07/remote-controlled-air-conditioning-using-mac-os-x-and-shion/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 21:12:19 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/home_automation_osx_shion.html#unique-entry-id-17</guid>
		<description><![CDATA[My central HVAC system has issues cooling down the 3rd floor of our house during the summer. 
To solve the problem, I started using my central HVAC system to cool the 1st &#038; 2nd floor only, and I'm using a portative air conditioning unit on the 3rd floor.
To control the AC unit, I use my PowerMac (which is always on), to which a SmartHome PowerLinc USB Controller is connected. 
I created a small PHP script which runs every minute, and determine if the AC should be on or off, and tells Shion to turn it on or off. Shion talks to the USB controller, which in turns talk to the SmartHome ApplianceLinc, which then either activate or desactivate the power outlet.]]></description>
			<content:encoded><![CDATA[<p>My central <a class="vt-p" rel="self" href="http://en.wikipedia.org/wiki/HVAC">HVAC</a> system has issues cooling down the 3rd floor of our house during the summer.<br />
Even with all 1st &amp; 2nd floor traps closed, the system, which is in the basement, has difficulties cooling down the 3rd floor.<br />
The higher the exterior temperature, the higher the difference of temperature between the 1st and 3rd floors.<br />
The average difference is somewhere between 4 and 5°C, and I measured differences as high as 10°C in the beginning of the summer.<br />
That means if I set my (1st floor) thermostat to 23°C, the 3rd floor temperature can reach 33°C. Quite uncomfortable to watch TV or work at our desks / computers.<br />
Even more so since I installed a (ceiling-mounted) HD projector to replace our old plasma screen on the 3rd floor, where our home theater is setup. That thing will start making a lot of (fan) noise as the temperature climbs (fixed by <a class="vt-p" href="/blog/2010/05/building-a-hush-box-to-quiet-a-projector/">another DIY project</a>)&#8230; And temperature can climb pretty fast at the highest point of the house!</p>
<p>To solve the problem, I started using my central HVAC system to cool the 1st &amp; 2nd floor only, and I&#8217;m using a portative air conditioning unit on the 3rd floor. It&#8217;s a 9000 BTU unit I bought a while ago (at Costco), when we lived somewhere else, and it was sitting in the  storage room since we moved. After a couple of tests to make sure it worked fine, and was powerful enough to cool the complete 3rd floor, I installed it &#8216;permanently&#8217; in the storage room, and attached it using a flexible duct to a hole I made in the storage room wall. I used semi-flexible duct to push the hot air outside. (I didn&#8217;t need to cut a hole for that since the storage room is in fact the attic, where there are ventilation holes.)</p>
<p>Here&#8217;s that setup in pictures:</p>
<p><img class="alignnone size-full wp-image-75" title="ac_shion_1" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/1.jpg" alt="ac_shion_1" width="550" height="370" /></p>
<p><img class="alignnone size-full wp-image-76" title="ac_shion_2" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/2.jpg" alt="ac_shion_2" width="550" height="465" /></p>
<p><img class="alignnone size-full wp-image-77" title="ac_shion_3" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/3.jpg" alt="ac_shion_3" width="550" height="370" /></p>
<p><img class="alignnone size-full wp-image-78" title="ac_shion_4" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/4.jpg" alt="ac_shion_4" width="550" height="370" /></p>
<p><img class="alignnone size-full wp-image-79" title="ac_shion_5" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/5.jpg" alt="ac_shion_5" width="550" height="370" /></p>
<p><img class="alignnone size-full wp-image-80" title="ac_shion_6" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/6.jpg" alt="ac_shion_6" width="550" height="370" /></p>
<p><img class="alignnone size-full wp-image-81" title="ac_shion_7" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/7.jpg" alt="ac_shion_7" width="550" height="370" /></p>
<p>To control the AC unit, I use my PowerMac (which is always on), to which a <a class="vt-p" rel="self" href="http://www.smarthome.com/2414U/PowerLinc-INSTEON-Controller-USB-Based-Home-Automation-Device/p.aspx">SmartHome PowerLinc USB Controller</a> is connected.<br />
I created a small PHP script which runs every minute, and determine if the AC should be on or off, and tells <a class="vt-p" rel="self" href="http://www.audacious-software.com/products/shion/">Shion</a> to turn it on or off. Shion talks to the USB controller, which in turns talk to the <a class="vt-p" rel="self" href="http://www.smarthome.com/2456S3/ApplianceLinc-Relay-INSTEON-Plug-in-Appliance-Control-Module-3-pin/p.aspx">SmartHome ApplianceLinc</a>, which then either activate or desactivate the power outlet. The AC unit is always on, so when the power outlet is on, the AC unit will always runs.</p>
<p>My PHP script uses many variables to decide if the AC should be on or off:</p>
<ul class="disc">
<li>Programmation: I created programs, and saved them in a database. For example, I have one program which I called &#8220;We&#8217;re using the 3rd floor when the little ones are asleep&#8221;. This program defines the following:<br />
Every day @ 07:00 &#8211; 30°C<br />
Every day @ 19:00 &#8211; 25°C<br />
Every day @ 23:00 &#8211; off<br />
Weekends @ 13:00 &#8211; 25°C<br />
Weekends @ 16:00 &#8211; 30°C<br />
Basically, I want the temperature to always be kept below 30°C (except during the night), but from 7pm to 11pm every day, and from 1pm to 4pm on the weekends, I&#8217;d like the temperature to get to 25°C. This is when we usually use the home theater, since this is when our kids are asleep, and we&#8217;re not.<br />
Another program is called &#8220;We&#8217;re not home&#8221;, which I activate when we all leave the house for a couple of days or more (vacation or something). AC is always off in that program.</li>
<li>The AC unit performance rating: I measured how fast the AC unit is capable of lowering the temperature, and use that number to start the AC early, in order to try to reach the programmed temperature on time. (My current calculated AC performance rating is 0.012°C per minute.) For example, if my program says the temperature should be 25°C at 7pm, the AC will start earlier than that, if necessary, in order to be at 25°C at 7pm. I have implemented a maximum time to start in advance; I won&#8217;t allow the AC to turn on more than 3h before a programmed event, even if that means the temperature won&#8217;t be reached in time.</li>
<li>Manual override: I can manually override any scheduled program by turning the unit on or off myself. My script will then &#8216;protect&#8217; my manual setting for 3 hours. At some point, I might change that so that it&#8217;s protected until the next programmed event, but I can&#8217;t really find a good incentive to implement that at this time.</li>
<li>Temperature thresholds: I selected thresholds to allow the temperature to vary a little above or below the programmed temperature, in order to control the number of start / stop of the AC unit. If the programmed temperature is set at 25°C, the unit will work until that temperature is reached, will then stop, and won&#8217;t start again until the temperature is 26°C. (My current thresholds are 0°C below, 1°C above.)</li>
</ul>
<p>My PHP script uses AppleScript (using the osascript command line executable) to talk to Shion. I had to run the Apache server as myself, instead of the usual nobody/www user, since this is required to be able to interact with any program that I run.</p>
<p>I made a simple iPhone webpage to display some stats, and allow me to start or stop the AC manually, or change the selected program. I made it accessible from the Internet (running on a non-standard port, and protected using an htaccess password), so that I can control the AC from anywhere.<br />
The same webpage renders quite well in any Safari, so I use the same page on all the computers at home to control the AC when I&#8217;m at home, and my iPhone is turned off.</p>
<p>Here&#8217;s a screenshot of the iPhone webpage, which looks like a native app once bookmarked on my iPhone home screen!</p>
<p><img class="alignnone size-full wp-image-82" title="ac_shion_iphone_home_auto" src="http://www.pommepause.com/blog/wp-content/uploads/2009/07/iphone_home_auto.png" alt="ac_shion_iphone_home_auto" width="508" height="741" /></p>
<p>To measure the temperature, I&#8217;m using TEMPer USB devices. I bought two <a class="vt-p" rel="self" href="http://shop.ebay.com/items/?_nkw=TEMPer+usb">from eBay</a> for a couple of dollars.<br />
I found a working <a class="vt-p" rel="self" href="http://tech.arantius.com/working-external-linux-thermometer">command line Mac (universal) executable that reads the temperature from the TEMPer device</a>, and outputs it to stdout.<br />
I read the temperature continually from the device, and save the average each minute in a database. I can graph temperature of the 1st and 3rd floors using this data, if I want to. This is what I used to measure the difference of temperatures before I started all this.</p>
<p>If you&#8217;d like to see the source of either my program.php script, from my iPhone webpage, or my database, here&#8217;s the very raw package: <a class="vt-p" href="/blog/wp-content/uploads/2009/07/automate.zip">automate.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2009/07/remote-controlled-air-conditioning-using-mac-os-x-and-shion/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Auto-start XBMC on Apple TV boot</title>
		<link>http://www.pommepause.com/blog/2009/07/auto-start-xbmc-on-apple-tv-boot/</link>
		<comments>http://www.pommepause.com/blog/2009/07/auto-start-xbmc-on-apple-tv-boot/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 12:15:02 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/xbmc_autostart_appletv.html#unique-entry-id-16</guid>
		<description><![CDATA[Here's how to have XBMC auto-start when your Apple TV boots.]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: There is now a much easier way to <a class="vt-p" href="http://forum.xbmc.org/showthread.php?t=66320#post476643">auto-start XBMC on Apple TV boot</a>.<br />
See details <a class="vt-p" href="http://forum.xbmc.org/showthread.php?t=66320#post476643">here</a>.<br />
I&#8217;ll leave the below post here for posterity&#8230;</p>
<p>Here&#8217;s how to have XBMC auto-start when your Apple TV boots.</p>
<p>Create a text file with the following content:<br />
<code> </code></p>
<p><code> </code></p>
<p><code></p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	&lt;key&gt;Label&lt;/key&gt;
	&lt;string&gt;com.teamxbmc.xbmc&lt;/string&gt;
	&lt;key&gt;OnDemand&lt;/key&gt;
	&lt;false/&gt;
	&lt;key&gt;ProgramArguments&lt;/key&gt;
	&lt;array&gt;
		&lt;string&gt;/Applications/XBMC.app/Contents/MacOS/XBMC&lt;/string&gt;
		&lt;string&gt;-fs&lt;/string&gt;
	&lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p></code></p>
<p>Save it on your Desktop, as <strong>com.teamxbmc.xbmc.plist</strong></p>
<p>Create another text file with the following content:<br />
<code> </code></p>
<p><code> </code></p>
<p><code></p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	&lt;key&gt;Label&lt;/key&gt;
	&lt;string&gt;com.teamxbmc.xbmchelper&lt;/string&gt;
	&lt;key&gt;OnDemand&lt;/key&gt;
	&lt;false/&gt;
	&lt;key&gt;ProgramArguments&lt;/key&gt;
	&lt;array&gt;
		&lt;string&gt;/Applications/MultiFinder.app/Contents/Resources/xbmchelper&lt;/string&gt;
		&lt;string&gt;-v&lt;/string&gt;
		&lt;string&gt;-u&lt;/string&gt;
	&lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p></code></p>
<p>Save it on your Desktop, as <strong>com.teamxbmc.xbmchelper.plist</strong></p>
<p>Install both files to your AppleTV using Terminal.app:<br />
<code> </code></p>
<p><code> </code></p>
<p><code></p>
<pre>scp ~/Desktop/com.teamxbmc.xbmc*.plist frontrow@your_appletv_ip_address:.
ssh frontrow@your_appletv_ip_address
sudo mv com.teamxbmc.xbmc*.plist /Library/LaunchAgents/
sudo chown root:wheel /Library/LaunchAgents/com.teamxbmc.xbmc*.plist
sudo chmod 644 /Library/LaunchAgents/com.teamxbmc.xbmc*.plist
launchctl load /Library/LaunchAgents/com.teamxbmc.xbmc.plist
launchctl load /Library/LaunchAgents/com.teamxbmc.xbmchelper.plist</pre>
<p></code><br />
That’s it. You can then delete the two files left on your Desktop.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2009/07/auto-start-xbmc-on-apple-tv-boot/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>TV Forecast widget not working? Here&#8217;s how to fix it.</title>
		<link>http://www.pommepause.com/blog/2009/03/tv-forecast-widget-not-working-heres-how-to-fix-it/</link>
		<comments>http://www.pommepause.com/blog/2009/03/tv-forecast-widget-not-working-heres-how-to-fix-it/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 04:56:53 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technical Problems]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/tv_forecast_thetvdb.html#unique-entry-id-15</guid>
		<description><![CDATA[TV Forecast is a nice widget that Matt Comi created. You tell it what TV shows you watch, and it will keep track of the upcoming episodes for those shows. 

The only down side to that widget is that it data-scrape TV.com to get its data. 
Not only is this illegal, but it also tends to break the widget every time TV.com change their layout in any way. 

Getting tired of that, I decided to open the widget’s code, and change the data source to something more stable: TheTVDB.com]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: The information below is about TV Forecast version 2.3.5. Since I wrote the post below, Matt Comi released an official fix, namely version 2.4, which now use TVRage.com as its data source. You should use TV Forecast official releases (1st link below), instead of trying to hack an old widget’s code like I did below.</p>
<p><a rel="self" href="http://www.bigbucketblog.com/">TV Forecast</a> is a nice widget that Matt Comi created. You tell it what TV shows you watch, and it will keep track of the upcoming episodes for those shows.</p>
<p><img class="alignnone size-full wp-image-84" title="tv_forecast_fixed" src="http://www.pommepause.com/blog/wp-content/uploads/2009/03/pasted-graphic.jpg" alt="tv_forecast_fixed" width="293" height="463" /></p>
<p>The only down side to that widget is that it data-scrape TV.com to get its data.<br />
Not only is this illegal, but it also tends to break the widget every time TV.com change their layout in any way.</p>
<p>Getting tired of that, I decided to open the widget’s code, and change the data source to something more stable: <a rel="self" href="http://www.thetvdb.com/">TheTVDB.com</a><br />
They provide a quite stable API to query their database, which is user-maintained.<br />
TVRage.com has something similar, but my eyes hurt each time I go on their site, so I picked TheTVDB for now!</p>
<p><strong>Update</strong>: Another good reason to pick TheTVDB over TVRage at this time: TVRage XML feeds are currently unavailable.</p>
<p><img class="alignnone size-full wp-image-86" title="tv_rage_down" src="http://www.pommepause.com/blog/wp-content/uploads/2009/03/picture-1.png" alt="tv_rage_doww" width="784" height="267" /></p>
<p>TheTVDB offer a search service, so changing the search function of the widget was easy enough.</p>
<p>Fetching the next episode information was trickier.<br />
The API doesn’t offer an easy way to do that. They only provide XML data of all the episodes of a show; this is quite a lot to download for a small widget, just to know what’s the next episode&#8230;<br />
So I created a middle-man.<br />
This data proxy queries the API for an answer, and will then cache the result for 24 hours (48 hours for not running series; 1 week for ended series), before it will refresh its information again.<br />
That way, each client running the widget can query the data proxy, which can use cached informations to return answers very fast, and in a very efficient way.</p>
<p><strong>Note that the files packaged below are still Matt Comi’s property.</strong> I do not pretend to now own them in any way. I redistribute them here to allow end users to continue using his nice widget until he has time to fix his widget himself.</p>
<p>So&#8230; want to fix your own TV Forecast widget? Here’s how:</p>
<p>- Right click <strong>~/Library/Widgets/TV Forecast.wdgt</strong> and select <strong>Show Package Contents</strong>.</p>
<p>This in how this should look before you touch anything:</p>
<p><img class="alignnone size-full wp-image-87" title="tv_forecast_fix_1" src="http://www.pommepause.com/blog/wp-content/uploads/2009/03/picture-2.png" alt="tv_forecast_fix_1" width="196" height="293" /></p>
<p>- Copy the files found in <a href="http://www.pommepause.com/blog/wp-content/uploads/2009/03/TV_Forecast_TheTVDB.zip">this archive</a> <strong>one by one</strong> into the TV Forecast.wdgt directory. <strong>Do not attempt to copy the TV folder itself found in my archive</strong>, or you’ll remove necessary files from the widget.<br />
i.e. You need to copy the files inside it, but not the folder itself.</p>
<p>There’s one new file (<strong>TvShowParser2.js</strong>) that goes in the TV folder, the rest are files I modified, so you need to overwrite the existing files with mine.</p>
<p>Here’s how it should look after copying the new files:</p>
<p><img class="alignnone size-full wp-image-88" title="tv_forecast_fix_2" src="http://www.pommepause.com/blog/wp-content/uploads/2009/03/picture-3.png" alt="tv_forecast_fix_2" width="198" height="312" /></p>
<p>- Reload (Cmd-R) the widget, or remove then re-add it to your Dashboard.</p>
<p>- Remove and re-add all TV shows in the widget’s configuration.</p>
<p>For the curious ones, here’s the <a rel="self" href="http://pastie.org/409063">diff of all my changes</a>, plus <a rel="self" href="http://dataproxy.pommepause.com/tvforecast/index.phps">the code for the data proxy script</a> used by the widget. Feel free to use that script on your own server, and edit <strong>TV/</strong><span style="font:12px 'Lucida Grande', LucidaGrande, Verdana, sans-serif; font-weight:bold; font-weight:bold; ">Functions.js</span><span style="font:12px 'Lucida Grande', LucidaGrande, Verdana, sans-serif; "> to point to your version of the script.</span> It requires PHP 5 and MySQL, among other things&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2009/03/tv-forecast-widget-not-working-heres-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Encrypt Gmail offline (Gears) data</title>
		<link>http://www.pommepause.com/blog/2009/02/encrypt-gmail-offline-gears-data/</link>
		<comments>http://www.pommepause.com/blog/2009/02/encrypt-gmail-offline-gears-data/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 23:40:34 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/encrypt_gears_mac.html#unique-entry-id-14</guid>
		<description><![CDATA[Since Gmail released the Offline feature in Labs, I guess many people have enabled it. I did, as soon as the feature was available in my account. And one of the first thing I did after enabling it, is trying to see how I could secure the data it downloads.]]></description>
			<content:encoded><![CDATA[<p><em>(Note that the following </em><strong><em>Mac</em></strong><em>-related; I only own Mac computers, so I didn’t try to find a solution to this problem on Windows.)<br />
</em><br />
Since <strong>Gmail</strong> released the <strong>Offline</strong> feature in Labs, I guess many people have enabled it. I did, as soon as the feature was available in my account. And one of the first thing I did after enabling it, is trying to see how I could <strong>secure the data it downloads</strong>.</p>
<p><strong>Why?</strong> Simply, because anyone with physical access to your computer can see your Gears database, which, if you enabled Offline mode in Gmail, now includes all your recent emails, including attachments. By encrypting the Gears database, if someone steals your computer, he won’t be able to read the Gears database, since it will be protected by a password. And no, just <strong>having auto-login disabled doesn’t protect you</strong> against this. Anyone can insert the Mac OS X install DVD, reset your password, and enter your account. This is why you either need something like <strong>FileVault</strong>, or use <strong>encrypted disk images</strong> (DMG) for your sensitive data. I use a technique similar to the one describe below to secure my important documents, like my tax e-papers, banking infos, etc.</p>
<p>I’m not using <strong>FileVault</strong>; that would have been one way to secure the Gears database, but since <a rel="self" href="http://www.pommepause.com/online_files/crash_plan.html">I’m using CrashPlan</a> for backups, and prefer to run it all the time versus only when I’m logged in (a requirement to allow CrashPlan to backup files in a FileVault-ed home directory), I looked for another way.</p>
<p>It seems it’s pretty easy: just create an encrypted DMG with the content of the Gears directory, create a symbolic link to it at the original location, and auto-mount the DMG on login.</p>
<p>Here’s an easy to follow walkthrough of the necessary steps:</p>
<p>1. Start <strong>Disk Utility</strong></p>
<p>2. <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Disk Image from Folder&#8230;</strong></p>
<p>3. Here, you need to find the Gears directory you want to secure. If you use Safari, It’s<br />
<strong>~/Library/Applications Support/Google/Google Gears for Safari</strong></p>
<p>If you use Firefox, it’s <strong>~/Library/Caches/Firefox/Profiles/something/Google Gears for Firefox</strong></p>
<p>4. Select where you want the DMG to be created. I selected the parent directory (it’s the default). Anywhere is fine.</p>
<p>At the bottom, in <strong>Image Format</strong>, select <strong>read/write</strong>. <strong>Compressed</strong> probably works too, but I doubt you’d really save space; the Gears files are probably compressed enough.</p>
<p>In <strong>Encryption</strong>, pick anything else than none. I selected <strong>128-bit</strong>. Feel free to pick <strong>256-bit</strong> if you prefer.</p>
<p>(<strong>Close your browser now</strong>, to make sure the Gears database is not modified while the DMG gets created. You can re-open it once the DMG is complete.)</p>
<p>Click Save, and select a <strong>good</strong> password.</p>
<p>If you need to enter a password to login on your computer (i.e. <strong>auto-login is disabled</strong>), choose the option to save the password in your <strong>keychain</strong>.<br />
<span style="color:#FF0000;font-weight:bold; ">Important:</span><strong> </strong>Do <strong>NOT</strong> select this option if you have auto-login enabled. If you do, all this serves nothing, as anyone who will open your computer will have access to Gears data!</p>
<p>Side-note: <em>Why is it safe to save the password in your Keychain if you have auto-login disabled?</em> Simply, because unlike your account password, the <strong>keychain password can’t be reset</strong>. That means if someone steals your computer, he wouldn’t be able to access your keychain, even after resetting the account password using a Mac OS X install DVD.<br />
Side-side-note: Yes, normally, the keychain password follows the account password. So if you change your password by providing you old password (like you usually do), the keychain password will also be changed. But this is not true when you reset your password without providing your old password, because Apple designed the keychain to be secure against such <em>attacks</em>.<br />
Enough babbling; on with the rest of the procedure.</p>
<p>5. Once the DMG is complete, mount it (double-click it).</p>
<p>6. Delete the original <strong>Google Gears for &#8230;</strong> directory.</p>
<p>7. Open <strong>Terminal</strong>, and enter the following commands (depending on what browser you use):</p>
<p>If you use Safari, execute this:<br />
<code>cd 'Library/Application Support/Google/'<br />
ln -s '/Volumes/Google Gears for Safari'</code><br />
If you use Firefox, execute this:<br />
<code>cd Library/Caches/Firefox/Profiles/*.default<br />
ln -s '/Volumes/Google Gears for Firefox'</code><br />
8. Open <strong>System Preferences</strong> &gt; <strong>Accounts</strong>.</p>
<p>Select the <strong>Login Items</strong> pane.</p>
<p><strong>Drag-and-drop</strong> the DMG from the Finder into <strong>Login Items</strong> list.</p>
<p>This will auto-mount the DMG when you login, so it’s always available.</p>
<p>And you’re done. Now, the Gears data is on an encrypted disk, which is only available with the password you provided, or with access to your keychain (which require your account password; hope it’s a good password too, and not your wife’s name!)</p>
<p><em>If you have suggestions on how to improve this, or how to do the same thing on Windows, feel free to comment below. I’ll be happy to link to other related information.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2009/02/encrypt-gmail-offline-gears-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

