<?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>Tue, 13 Jul 2010 21:13:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>0</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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=4.4" /></div><div>Rating: 4.4/<strong>5</strong> (19 votes cast)</div><br />]]></description>
			<content:encoded><![CDATA[<p><em>Do you want to skip all this text and just get the widget?</em></p>
<p><em> </em><em>Then click </em><em><a class="vt-p" rel="self" href="#videotronwidgetdownload">here</a></em><em>.</em></p>
<hr />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><a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2010/01/screenshot.png"><img class="alignnone size-full wp-image-170" title="screenshot" src="http://www.pommepause.com/blog/wp-content/uploads/2010/01/screenshot.png" alt="" width="400" height="180" /></a></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 username (something that looks like vlxxxxxx), and the internet access type (Basic, High-Speed, Extreme, Extreme Plus, Ultimate). Optionally, if you bought extra data transfer packages for the current month, you&#8217;ll be able to enter those too. Data transfer packages will be reset when the billing month changes.</p>
<p>Note: I had to data-scrape an HTML page to fetch the information from Vidéotron website, and decided it was much easier to do that in PHP, and keep it on my own web server, than to do it in JavaScript and have to release a new version of my widget each time Vidéotron would change their web page.<br />
So if you install this, and see an outgoing connection to dataproxy.pommepause.com, that&#8217;s normal.<br />
(BTW, I posted the source of the PHP script this widget is using <a class="vt-p" rel="self" href="http://dataproxy.pommepause.com/videotron_usage.phps">here</a>.)</p>
<p>Enjoy, fellow Vidéotron users.</p>
<h3><strong><a name="videotronwidgetdownload"></a>Downloads</strong></h3>
<p>You can download the latest version of the Vidéotron Internet Usage Monitor widget for Mac OS X <a class="vt-p" href="http://www.pommepause.com/blog/wp-content/uploads/2010/01/Videotron-Internet-Usage-Monitor.wdgt-126.zip">here</a>.</p>
<h3>Changelog</h3>
<ul>
<li><strong>1.2.6 &#8211; Bugfix: regression in 1.2.5; couldn&#8217;t save preferences!</strong></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=4.4" /></div><div>Rating: 4.4/<strong>5</strong> (19 votes cast)</div><br />]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2010/01/mac-widget-videotron-internet-usage-monitor/feed/</wfw:commentRss>
		<slash:comments>103</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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>3</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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=4.0" /></div><div>Rating: 4.0/<strong>5</strong> (1 vote cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=4.0" /></div><div>Rating: 4.0/<strong>5</strong> (1 vote cast)</div><br />]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2009/07/auto-start-xbmc-on-apple-tv-boot/feed/</wfw:commentRss>
		<slash:comments>6</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<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></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.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (3 votes cast)</div><br />]]></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>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (3 votes cast)</div><br />]]></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>
		<item>
		<title>Clavier Mac canadien français sous Windows XP (Parallels, VMWare, Bootcamp&#8230;)</title>
		<link>http://www.pommepause.com/blog/2007/10/clavier-mac-canadien-franais-sous-windows-xp-parallels-vmware-bootcamp/</link>
		<comments>http://www.pommepause.com/blog/2007/10/clavier-mac-canadien-franais-sous-windows-xp-parallels-vmware-bootcamp/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 01:12:08 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/windows_xp_fr_ca_mac_keyboard_layout.html#unique-entry-id-12</guid>
		<description><![CDATA[Installer Windows XP sur un Mac, que ça soit dans Parallels Desktop, WMWare Fusion ou avec Bootcamp, c'est parfois bien pratique. Ce qui n'est pas pratique par contre, c'est d'essayer d'utiliser un clavier Mac canadien français dans Windows! Plusieurs touches sont différentes, dont les accents, plusieurs Shift-chiffres, etc.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote cast)</div><br />]]></description>
			<content:encoded><![CDATA[<p><em><br />
(I usually write in english in here, but this one will be in French. It&#8217;s about a Windows XP keyboard layout for Canadian French Mac keyboards. So, move along, english-only-speaking-people!)<br />
</em><br />
Installer Windows XP sur un Mac, que ça soit dans Parallels Desktop, WMWare Fusion ou avec Bootcamp, c&#8217;est parfois bien pratique. Ce qui n&#8217;est pas pratique par contre, c&#8217;est d&#8217;essayer d&#8217;utiliser un clavier Mac canadien français dans Windows! Plusieurs touches sont différentes, dont les accents, plusieurs Shift-chiffres, etc.</p>
<p>La solution: installer un <em>layout</em> de clavier &#8216;Mac&#8217; dans Windows XP.</p>
<p>Et comment en fait ça ? Simple: on télécharge <a href="http://www.pommepause.com/blog/wp-content/uploads/2007/10/Windows-XP-fr_CA_Mac-Keyboard.zip">ceci</a>, et on l&#8217;installe (en utilisant <em>setup.exe</em>). C&#8217;est tout. <img src='http://www.pommepause.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Pour les curieux: ce layout de clavier pour Windows XP a été créé grâce au logiciel <em>Microsoft Keyboard Layour Creator</em>, disponible sur microsoft.com. Le fichier ci-dessus contient aussi les fichiers nécessaires pour modifier le <em>layout</em> avec à ce logiciel.</p>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote cast)</div><br />]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2007/10/clavier-mac-canadien-franais-sous-windows-xp-parallels-vmware-bootcamp/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to fix non-working Folder Action on an external hard disk</title>
		<link>http://www.pommepause.com/blog/2007/06/how-to-fix-non-working-folder-action-on-an-external-hard-disk/</link>
		<comments>http://www.pommepause.com/blog/2007/06/how-to-fix-non-working-folder-action-on-an-external-hard-disk/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 04:00:00 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Technical Problems]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/fa_external_hdd_fix.html#unique-entry-id-1</guid>
		<description><![CDATA[I had a problem with Folder Actions: they always stopped working after a while! Quite annoying.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:15px; font-weight:bold; "><br />
</span>I had a problem with <a title="Folder Actions" rel="self" href="http://www.apple.com/applescript/folderactions/">Folder Actions</a>: they always stopped working after a while! Quite annoying. After some digging on Google, I found one post on <a rel="self" href="http://www.macosxhints.com">MacOSXHints</a> forums where a user mentioned that a FA attached to a folder on an external HDD would always stop working after un-mounting / re-mounting the hard disk; exactly what was happening to me! So I started fiddling with AppleScript, and found a way to detach then re-attach a FA associated with a folder. Next, to automatize the execution of this fix, I needed a way to execute it when my external HDD was mounted. Another FA to the rescue, this one attached to the /Volumes folder. Each time a new folder would appear in /Volumes (like my USB drive for example), my FA script would be executed, and it would detach then re-attach the original FA script.</p>
<p><code> </code></p>
<p><code></p>
<pre>on adding folder items to target_folder after receiving added_items
    set volumeName to "USBDrive1" -- This is the display name of your external HDD volume; any of them if you have more than one.
    repeat with added_item in added_items
        if the displayed name of (info for added_item) is equal to volumeName then
            volumeMounted()
            exit repeat
        end if
    end repeat
    quit application "System Events"
end adding folder items to

on volumeMounted()
    tell application "System Events"
        -- Detach Folder Action
        try
            delete folder action "TV Shows" -- This should match the name of the folder you'll attach the FA to; i.e. to attach a FA to "USBDrive1:Music:TV Shows", use "TV Shows" here.
        end try

        -- Re-Attach Folder Action
        attach action to folder "USBDrive1:Music:TV Shows" using "Mac Mini HD:Users:me:Library:Scripts:Folder Action Scripts:Import TV shows into iTunes.scpt" -- First parameter is the folder you want to attach to, the second is the scpt file you want to execute as a FA for that folder.
    end tell
end volumeMounted</pre>
<p></code><br />
To use this script: Attach this FA script to the /Volumes folder and it should fix this problem.<br />
To attach a FA to /Volumes, hit <strong>Cmd-Shift-G</strong> after clicking the + in the folder column of <em>Folder Actions Setup.app</em>, and enter &#8220;/Volumes&#8221; then click Go, then Open.</p>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2007/06/how-to-fix-non-working-folder-action-on-an-external-hard-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blowfish encryption plugin for Colloquy</title>
		<link>http://www.pommepause.com/blog/2007/06/blowfish-encryption-plugin-for-colloquy/</link>
		<comments>http://www.pommepause.com/blog/2007/06/blowfish-encryption-plugin-for-colloquy/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 04:00:00 +0000</pubDate>
		<dc:creator>Guillaume Boudreau</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.pommepause.com/online_files/colloquy_blowfish.html#unique-entry-id-3</guid>
		<description><![CDATA[Lately, IRC channels where I hang started using Blowfish encryption for all messages sent to the channel. mIRC and eggdrop support Blowfish pretty easily, but there was nothing for Colloquy (the IRC client I use - Mac OS X only) to encrypt &#038; decrypt Blowfish encrypted messages.

So I started looking for a way to encrypt &#038; decrypt Blowfish messages using a Colloquy plugin.<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:15px; font-weight:bold; "><br />
</span><em>Do you want to skip all this text and just get the Colloquy Blowfish Plugin?<br />
Then click </em><em><a rel="self" href="#colloblowdownload">here</a></em><em>.<br />
</em><br />
Lately, IRC channels where I hang started using Blowfish encryption for all messages sent to the channel. mIRC and eggdrop support Blowfish pretty easily, but there was nothing for <a rel="self" href="http://www.colloquy.info/">Colloquy</a> (the IRC client I use &#8211; Mac OS X only) to encrypt &amp; decrypt Blowfish encrypted messages.</p>
<p>So I started looking for a way to encrypt &amp; decrypt Blowfish messages using a Colloquy plugin. Colloquy allows all sort of plugins: AppleScript, Python, Obj-C, etc. I tried to use the Python template plugin, but it wouldn&#8217;t even load on Colloquy, spitting some error on load. So I downloaded existing plugins to see how they worked. Most of them seems to use the AppleScript API, and it seems easy enough for my purpose.</p>
<p>Now I needed code to encrypt &amp; decrypt Blowfish messages. Google suggested a Java class that allowed easy encryption &amp; decryption. Adding a simple main method in it, I was able to encrypt &amp; decrypt messages via the command line by passing the key &amp; message as arguments. While this worked just fine, launching the JVM each time I received a message or I sent a message was quite resource-consuming, even with my dual G5.</p>
<p>So I started looking for C or C++ code that would do the same thing. After trying many implementation, I decided to try to compile the <a rel="self" href="http://www.eggheads.org/cgi-bin/viewcvs.cgi/eggdrop1.7/src/mod/blowfish.mod/blowfish.c?rev=1.3&amp;content-type=text/vnd.viewcvs-markup">eggdrop Blowfish module</a> by itself. I had to change a couple of things to make the blowfish.c file compile alone, but I made it. I also added a new main function to be able to use the encrypt &amp; decrypt functions from the command-line, which worked just fine, and was much faster than the previous Java implementation I used.</p>
<p>Note to Java haters: The Java implementation I used was slower because I had to start the JVM each time I wanted to encrypt or decrypt a message. If I had the JVM already running, and a service that would listen for encrypt &amp; decrypt commands on a socket or something, it would very probably have been almost as fast as the C implementation I currently use. I just wanted to go with the more minimalist approach I could find, so I opted for the C program.</p>
<p>So now, I was receiving encrypted messages in Colloquy, my AppleScript plugin was called for each message, and I was able to change the received message into it&#8217;s unencrypted form by calling my Blowfish command-line program. Sent messages followed a similar path: Colloquy &gt; AppleScript plugin &gt; command-line encryption &gt; IRC server.</p>
<p>The only problem I had now was special characters. Bold, underline &amp; colors IRC characters were not correctly handled by the AppleScript plugin. So I took the HTML-ized version of the message to be sent and translated all the HTML tags I found into IRC characters. For received message, I did the reverse: I translated IRC characters into HTML tags and passed that new string to Colloquy for display.</p>
<p>Limitations: For sent messages, I only translate specific colors into standard IRC colors; I used the quick picks at the bottom of the &#8220;Show Colors&#8221; panel in Colloquy. So the colors that will be sent correctly when encrypted are: #FF0000 (red), #44B958 (green), #0013FF (blue), and #EBB51B (orange). All others colors will be replaced with black when sent.<br />
Received message don&#8217;t have this limitation, so colors in received messages should pretty much always look OK.<br />
Also, my plugin doesn&#8217;t support background colors, so messages containing those might look weird when decrypted.</p>
<p>That&#8217;s it. I now have working Blowfish in my Colloquy, and so can you.</p>
<p><a name="colloblowdownload"></a>You can download the latest version of the Colloquy Blowfish Plugin (version 04) for <a rel="self" href="http://www.pommepause.com//index_assets/Colloquy%20Blowfish%20Plugin%20for%20PowerPC%2004.zip">PowerPC</a> or <a rel="self" href="http://www.pommepause.com//index_assets/Colloquy%20Blowfish%20Plugin%20for%20Intel%2004.zip">Intel</a>.<br />
Changelog:<br />
Version 02 fixes a small problem with messages containing colors &gt; 9 (IRC color codes 10 to 15). Those messages would not be shown in Colloquy because of this problem.<br />
Version 03 allows to send or receive unencrypted messages in normally encrypted channel or private messages for messages that start with +p.<br />
Version 04 fixes a problem with % in sent messages, and adds support for multiple channels using just one plugin.</p>
<br /><div><img src="http://www.pommepause.com/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br />]]></content:encoded>
			<wfw:commentRss>http://www.pommepause.com/blog/2007/06/blowfish-encryption-plugin-for-colloquy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
