<?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>ZBlog &#187; mac</title>
	<atom:link href="http://blog.zarate.tv/category/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.zarate.tv</link>
	<description>Using the law to keep justice away</description>
	<lastBuildDate>Wed, 08 Sep 2010 17:04:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dual booting between Snow Leopard and Ubuntu 10.04</title>
		<link>http://blog.zarate.tv/2010/08/24/dual-booting-between-snow-leopard-and-ubuntu-10-04/</link>
		<comments>http://blog.zarate.tv/2010/08/24/dual-booting-between-snow-leopard-and-ubuntu-10-04/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 11:50:33 +0000</pubDate>
		<dc:creator>Zarate</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.zarate.tv/?p=1641</guid>
		<description><![CDATA[There are a million tutos out there about dual booting, but I just did it today and found it easier than everything I could find and definitely simpler than the last time I had to do it:
* Boot OSX and run the Disk Utility tool. Create a new partition using the free space in your [...]]]></description>
			<content:encoded><![CDATA[<p>There are a million tutos out there about dual booting, but I just did it today and found it easier than everything I could find and definitely simpler than the last time I had to do it:</p>
<p>* Boot OSX and run the Disk Utility tool. Create a new partition using the free space in your HD. Don&#8217;t format it, just leave it as free space.<br />
* Download and install <a href="http://refit.sourceforge.net/">rEFIt</a>. Once you&#8217;ve done that, you can setup Linux as the default OS by editing refit.conf and uncommenting #legacyfirst.<br />
* Insert Ubuntu&#8217;s CD and restart.<br />
* Hold the ALT key while booting up so you are offered all boot options. Select Ubuntu&#8217;s CD and install.<br />
* DONE.</p>
<p>No need for Bootcamp or anything, it&#8217;s as simple as that.</p>
<p>Just a note about how I&#8217;m installing Ubuntu these days. Read sometime ago somewhere (sorry, no link) about being able to reinstall Ubuntu without losing your data. It goes like this. When installing Ubuntu, choose manual partitions. You need to create 3 of them, in this order:</p>
<p>* System partition: pick up the space you want, but 15 &#8211; 20gb should be enough since it&#8217;s going to be for the system only. Select &#8220;/&#8221; as the mounting point.<br />
* SWAP: select it on the combo and pick up at least the size of your RAM.<br />
* Everything else, for the home partition. Select &#8220;/home&#8221; as the mounting point.<br />
* DONE.</p>
<p>Now, next time you want to reinstall Ubuntu, if you follow the same partition scheme, you will boot up to the new system and all your data will be there. And with &#8220;all the data&#8221; I mean <em>all</em> the data: bookmarks, browser history, files, subversion sites and credentials&#8230;. Since in the Linux world all user data is (or should be) stored in your home directory, and you don&#8217;t touch that one when reinstalling, you boot up to a new system with your old data in place. I call that a &#8220;dirty&#8221; installation as opposed to a &#8220;clean&#8221; installation when I back up all the files and completely wipe out the hard disk.</p>
<p>As per Ubuntu on the MacBookPro, it&#8217;s going fairly well. Haven&#8217;t touched the console for the installation. Just used the proprietary hardware drivers manager (System > Administration > Hardware drivers) for the WiFi and the graphic card. Have to say that after trying the NVIDIA closed drivers I&#8217;m sticking with the default ones, seem to do the job for me. Only if you want the F keys to work as normal human beings would expect, you go through <a href="https://help.ubuntu.com/community/AppleKeyboard#Ubuntu%209.04%20and%20Newer">this</a> (using the .conf file method).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zarate.tv/2010/08/24/dual-booting-between-snow-leopard-and-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Flash apps 24/7</title>
		<link>http://blog.zarate.tv/2010/05/03/running-flash-apps-247/</link>
		<comments>http://blog.zarate.tv/2010/05/03/running-flash-apps-247/#comments</comments>
		<pubDate>Mon, 03 May 2010 14:40:03 +0000</pubDate>
		<dc:creator>Zarate</dc:creator>
				<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.zarate.tv/?p=1546</guid>
		<description><![CDATA[[UPDATE: I presented this alongside with Matt Pollitt at the London Flash Platform User Group, thanks to everyone that came down to the talk.  So sorry that I couldn't stay for longer, but had a train to catch. If you have any doubts or want to say something, just leave a comment and I'll [...]]]></description>
			<content:encoded><![CDATA[<p>[<em>UPDATE: I presented this alongside with <a href="http://www.mattpollitt.co.uk/">Matt Pollitt</a> at the <a href="http://www.lfpug.com/27th-may-2010-27052010/">London Flash Platform User Group</a>, thanks to everyone that came down to the talk.  So sorry that I couldn't stay for longer, but had a train to catch. If you have any doubts or want to say something, just leave a comment and I'll get in touch. <a href="http://www.lfpug.com/developing-flash-apps-to-run-247/">Video is now available</a>, go check it out if you missed it.</em>]</p>
<p>We are developing at <a href="http://ustwo.co.uk/">ustwo</a> a very interesting internal little project that needs to run 24/7. By default developers should always be very careful with memory leaks and hogging resources, but with an AIR/Flash app running non-stop every detail counts.</p>
<p>To top it up, the app must handle images, SWFs (AS2, AS3) and videos <strong>without going through developers</strong>. That means marketing can contact one of the designers, ask s/he to produce someething and put it to display without developer approval. Oh, and all assets are in the network, not in the machine. Scary. </p>
<p>Preliminary tests show we are doing OK, we&#8217;ve been running the app non-stop for 4 days without a crash or needing it to reboot. The player takes and releases memory when it needs to, transitions and animations look as smooth as the first day, etc.</p>
<p>Check out below some of our thoughts.</p>
<p><strong>FAIL, FAIL, FAIL</strong></p>
<p>Shit will happen, so be ready to fail. Assets won&#8217;t load, video will have the wrong codec, image will be 80mb, network will be down&#8230;.</p>
<p>That&#8217;s Google&#8217;s approach to servers. Instead of having a big fat multimillion dollar server, they have a farm of 100 mini-servers and they *know* one or two *will* crash everyday. They&#8217;ve build their systems to cope with failure and fail gracefully.</p>
<p>Also embed some default content for when everything else fails. </p>
<p><strong>RELEASE, RELEASE, RELEASE</strong></p>
<p>You must release resources. Explicitly remove every single listener you add, use FP 10 unloadAndStop and if you are in AIR don&#8217;t hold references to File objects (more about this in another post).</p>
<p>If you are a good dev, the Flash player will behave most of the times&#8230; </p>
<p><strong>MONITOR, MONITOR, MONITOR</strong></p>
<p>&#8230;but sometimes it won&#8217;t. Or something you didn&#8217;t even think was possible will happen in-your-face. You can&#8217;t prevent <strong>all</strong> errors, but you can react when they happen.</p>
<p>At the beginning we were trusting our own app to be its own watchdog, but then we got a nasty crash and obviously the watchdog failed as well. So we&#8217;ve created a <a href="http://blog.zarate.tv/2010/02/08/build-tools-with-haxe/">little haXe/Neko app</a> called &#8220;<em>the helper</em>&#8221; that is automatically called every minute and that checks the state of our app.</p>
<p>At the moment, the helper is being automatically launched using <a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html#//apple_ref/doc/man/5/launchd.plist">launchd</a> (fancy cron job for OS X), but that has very interesting side effects (again, more on another post).</p>
<p>The helper checks if our app is running using something like:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ps</span> <span class="re5">-x</span> <span class="re5">-o</span> <span class="kw2">comm</span></div>
</li>
</ol>
</div>
</div>
<p>And parsing the result for a relevant match. If the app is not running, it starts it again using:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">open <span class="sy0">/</span>path<span class="sy0">/</span>to<span class="sy0">/</span>our<span class="sy0">/</span>app</div>
</li>
</ol>
</div>
</div>
<p>Since we are using AIR 2 beta, we could implement a more refined communication system using the new <a href="http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html">Native Process API</a>, but for the time being checking if the app is running &#8220;<em>the hard way</em>&#8221; is enough.</p>
<p><strong>UPDATE, UPDATE, UPDATE</strong></p>
<p>Find a good mechanism to auto-update your app. Most 24/7 apps are unattended apps and they might well be in a different room / building / city / country. But even if you are just a few steps away, you still want to be able to remotely deploy a new version.</p>
<p>We decided to implement our own update system based on GIT commits instead of relying on AIR&#8217;s update framework.</p>
<p><strong>LOG, LOG, LOG</strong></p>
<p>Log as much as you can. You&#8217;ll be happy you did when you need to find out why your app crashed. Believe me, in this case more is more, even if you face huge log files. If you are a little bit consistent you can always build automatic parsing tools for your logs or just run a simple grep to find error traces.</p>
<p>BTW, we settled for a log file per day to avoid massive log files.  </p>
<p><strong>WARN, WARN, WARN</strong></p>
<p>As I said before, most of these apps run unattended, so you want to be notified as soon as possible when there&#8217;s an error. You can:</p>
<p>* Use a private Twitter account that people subscribe to.<br />
* Send an email. You can do that from Flash using for example <a href="http://www.bytearray.org/?p=27">SMTP Mailer</a> and a local SMTP server.</p>
<p>Whatever you do, don&#8217;t rely on one method only, specially Twitter, in case is down when the app needs it.</p>
<p><strong>REMOTE, REMOTE, REMOTE</strong></p>
<p>You either enable VNC, SSH or both. If you can&#8217;t, then be prepared for walking / driving / taking the bus a lot.</p>
<p>&#8211;</p>
<p>I&#8217;ll leave the details of running your apps using launchd and the peculiar way in which AIR holds &#8220;hard&#8221; references to files for another posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zarate.tv/2010/05/03/running-flash-apps-247/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make your console fly with Parallel Processing</title>
		<link>http://blog.zarate.tv/2010/01/21/make-your-console-fly-with-parallel-processing/</link>
		<comments>http://blog.zarate.tv/2010/01/21/make-your-console-fly-with-parallel-processing/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 09:12:51 +0000</pubDate>
		<dc:creator>Zarate</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.zarate.tv/?p=1431</guid>
		<description><![CDATA[I reckon this is kind of a niche thing, but interesting nonetheless. 
Our current project at ustwo™ is a PureMVC-multicore application. Sounds really fancy, but it&#8217;s only a SWF loading SWFs.
To compile those SWFs we have some scripts using Ant, MTASC, SWFMill, Rhino and other tools. Updating from SVN and compiling 18 modules was taking [...]]]></description>
			<content:encoded><![CDATA[<p>I reckon this is kind of a niche thing, but interesting nonetheless. </p>
<p>Our current project at ustwo™ is a PureMVC-multicore application. Sounds really fancy, but it&#8217;s only a SWF loading SWFs.</p>
<p>To compile those SWFs we have some scripts using Ant, MTASC, SWFMill, Rhino and other tools. Updating from SVN and compiling 18 modules was taking around 90-100 seconds (that&#8217;s updating and compiling the whole project, you can compile single modules much faster).</p>
<p>Keep in mind that our compilation process is a little bit more than calling MTASC. We are running some pre-processing, generating exclude files and some other trickery to gain extra performance (we target mobile devices).</p>
<p>Anyway. Got a hint from one of our developers so I did some research to find a way to speed up compilation time. Since most of us have now dual-core machines we should be able to parallelize some of the work, right? Indeed we can.</p>
<p>Finding <a href="http://code.google.com/p/ppss/">PPSS</a> was quite easy but understanding how it to works was a little bit more complicated. I&#8217;m not going to bore you to death with the nitty-gritty, so this is the flow that adapted better to us:</p>
<p>* In bash parse the list of module folders and create a txt file containing the path to a script passing to it the path of the module as a parameter. One line per module:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="sy0">/</span>path<span class="sy0">/</span>to<span class="sy0">/</span>script.sh path<span class="sy0">/</span>to<span class="sy0">/</span>module0</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>path<span class="sy0">/</span>to<span class="sy0">/</span>script.sh path<span class="sy0">/</span>to<span class="sy0">/</span>module1</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">/</span>path<span class="sy0">/</span>to<span class="sy0">/</span>script.sh path<span class="sy0">/</span>to<span class="sy0">/</span>module2</div>
</li>
<li class="li1">
<div class="de1">&#8230;</div>
</li>
</ol>
</div>
</div>
<p>* Feed that txt file to PPSS like this:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1">ppss <span class="re5">-f</span> moduleList.txt <span class="re5">-c</span> <span class="st_h">&#8216;bash $ITEM&#8217;</span></div>
</li>
</ol>
</div>
</div>
<p>That&#8217;s where the magic happens.  PPSS parallelizes each call to the compilation script using both CPUs. When you run it you can see they go all the way up to 80-90% usage, which is kind of the point.</p>
<p>We took some metrics and found a 40% speed improvement, sometimes even more. If you are a compulsive compiler like yours truly, this saves you quite some time.</p>
<p>Going from the serial approach to the parallel approach wasn&#8217;t straight forward. Mostly because I had to split the main script into several scripts and that caused some issues due to my bash programming limitations. This is what I learnt:</p>
<p>* If you execute a script from another, the child doesn&#8217;t have access to the variables defined by the parent unless you export them&#8230;<br />
* &#8230; but arrays don&#8217;t get exported.<br />
* Also, you can&#8217;t &#8220;escalate&#8221; exported vars from children to parents. The trick only goes from parent to children (security, I guess).</p>
<p>Anyway. Some more command line black magic under my belt, which is great. The console is a very, very powerful tool that can simplify and standardize daily tasks, which is a must when you are on a team of 10 devs. Not that it is the nicest programming language (actually, it&#8217;s pretty ugly), but its ubiquity makes learning it worthwhile.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zarate.tv/2010/01/21/make-your-console-fly-with-parallel-processing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VirtualBox VM launcher in OSX</title>
		<link>http://blog.zarate.tv/2009/11/20/virtualbox-vm-launcher-in-osx/</link>
		<comments>http://blog.zarate.tv/2009/11/20/virtualbox-vm-launcher-in-osx/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:48:48 +0000</pubDate>
		<dc:creator>Zarate</dc:creator>
				<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.zarate.tv/?p=1387</guid>
		<description><![CDATA[I think Linux/Ubuntu is yet again more easy to use than OSX, but I don&#8217;t even feel like bitching today. Here it goes:
++ Open Script Editor and type this updating the name of the VM you want to launch:




do shell script &#34;/Applications/VirtualBox.App/Contents/MacOS/VBoxManage startvm your_vm_name&#34;




++ Save as Application Bundle and check Run Only.
Off you go.
Thanks.
]]></description>
			<content:encoded><![CDATA[<p>I think Linux/Ubuntu is <a href="http://blog.zarate.tv/2008/11/11/incredibly-annoying-macs-take-1/">yet</a> <a href="http://blog.zarate.tv/2009/11/09/show-hidden-files-in-osx/">again</a> more easy to use than OSX, but I don&#8217;t even feel like bitching today. Here it goes:</p>
<p>++ Open Script Editor and type this updating the name of the VM you want to launch:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">do</span> shell script <span class="st0">&quot;/Applications/VirtualBox.App/Contents/MacOS/VBoxManage startvm your_vm_name&quot;</span></div>
</li>
</ol>
</div>
</div>
<p>++ Save as <em>Application Bundle</em> and check <em>Run Only</em>.</p>
<p>Off you go.</p>
<p><a href="http://forum.scummvm.org/viewtopic.php?t=4993">Thanks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zarate.tv/2009/11/20/virtualbox-vm-launcher-in-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux and Mac security bubble</title>
		<link>http://blog.zarate.tv/2008/10/22/linux-and-mac-security-bubble/</link>
		<comments>http://blog.zarate.tv/2008/10/22/linux-and-mac-security-bubble/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 14:31:01 +0000</pubDate>
		<dc:creator>Zarate</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.zarate.tv/?p=203</guid>
		<description><![CDATA[Mr Kaspersky (co-founder of the antivirus) thinks that in the very near future the bad guys making crapware are going to end up with the security bubble Linux and Mac users have these days. I partially agree.
I think he and many others are right to think that targeting Windows is the most effective way of [...]]]></description>
			<content:encoded><![CDATA[<p>Mr <a href="http://en.wikipedia.org/wiki/Eugene_Kaspersky">Kaspersky</a> (co-founder of the antivirus) thinks that in the very near future <a href="http://www.itworld.com/security/56382/kaspersky-mac-linux-bsd-open-attack">the bad guys making crapware are going to end up with the security bubble Linux and Mac users have these days</a>. I partially agree.</p>
<p>I think he and many others are right to think that targeting Windows is the most effective way of spreading a virus because it&#8217;s present on most computers out there. But the more Linux and Macs grow, the bigger the reward will be for whoever cracks them down. Same old story as with Firefox.</p>
<p>But what the article doesn&#8217;t say is that out of the 3 one is Open Source. And that&#8217;s a big deal to me. Finding bugs in Open Source projects is indeed veeeeery easy. You can either go to their <a href="http://code.google.com/p/hippohx/issues/list">bug tracking system</a>, check out the <a href="http://hippohx.com/download/changelog">change log</a> or simply diff the latest version with the previous one. Piece of cake. Now you know what security bugs they&#8217;ve fixed so the only thing remaining is finding out previous version already installed and you are good to crack.</p>
<p>So, what you think it&#8217;s more secure, Firefox that makes all this information publicly available or IE with its <a href="http://en.wikipedia.org/wiki/Security_through_obscurity">security through obscurity</a>? I have no doubt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zarate.tv/2008/10/22/linux-and-mac-security-bubble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
