<?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>cloud goes social &#187; Code</title>
	<atom:link href="http://www.cloudgoessocial.net/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cloudgoessocial.net</link>
	<description>computer, travel, movies, music, cuisine and more</description>
	<lastBuildDate>Mon, 21 Mar 2011 21:58:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>ImageMagick, Xcode4, iOS4.3</title>
		<link>http://www.cloudgoessocial.net/2011/03/21/im-xcode4-ios4-3/</link>
		<comments>http://www.cloudgoessocial.net/2011/03/21/im-xcode4-ios4-3/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 21:31:04 +0000</pubDate>
		<dc:creator>Cloud</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[ios4.3]]></category>
		<category><![CDATA[xcode4]]></category>

		<guid isPermaLink="false">http://www.cloudgoessocial.net/?p=380</guid>
		<description><![CDATA[Hi all! Just a small update on the ImageMagick front! First of all, a reminder. All my ImageMagick related efforts (compiler script + test project) can be found over at github. The latest ImageMagick, at the time of writing is version 6.6.8-5. I&#8217;ve bumped the versions of the delegate libraries, as well: jpeg: 8-c png: [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>Just a small update on the ImageMagick front! First of all, a reminder. All my ImageMagick related efforts (compiler script + test project) can be found over at <a href="https://github.com/marforic/imagemagick_lib_iphone">github</a>.</p>
<p>The latest <a href="http://www.imagemagick.org/">ImageMagick</a>, at the time of writing is version 6.6.8-5. I&#8217;ve bumped the versions of the delegate libraries, as well:</p>
<ul>
<li><strong>jpeg</strong>: 8-c</li>
<li><strong>png</strong>: 1.4.5</li>
<li><strong>tiff</strong>: 3.9.4</li>
</ul>
<p>Finally I&#8217;ve got my hands on the latest Xcode4 and on the latest iOS4.3 SDK. I&#8217;ve updated the IM_Test Xcode project on the <a href="https://github.com/marforic/imagemagick_lib_iphone">same git repository</a> of the compiler script :)</p>
<p>You can always grab the pre-compiled versions from <a href="ftp://ftp.imagemagick.org/pub/ImageMagick/iPhone/">ImageMagick&#8217;s FTP stite</a></p>
<p>I hope everyone is happy about the update, if you are let me know what you&#8217;re up to with ImageMagick on the iPhone and if you feel like don&#8217;t hesitate in donating (link on the right), as you can see this blog runs ads-free and any bit helps!</p>
<p>Cheers!</p>
<p>~C</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudgoessocial.net/2011/03/21/im-xcode4-ios4-3/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>Android kernel compilation, detailed instructions</title>
		<link>http://www.cloudgoessocial.net/2010/12/16/android-kernel-compilation-detailed-instructions/</link>
		<comments>http://www.cloudgoessocial.net/2010/12/16/android-kernel-compilation-detailed-instructions/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 15:36:22 +0000</pubDate>
		<dc:creator>Cloud</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips & howtos]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[cyanogenmod]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[magic]]></category>
		<category><![CDATA[nexusone]]></category>
		<category><![CDATA[rooting]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.cloudgoessocial.net/?p=358</guid>
		<description><![CDATA[Disclaimer I am not responsible if anything goes bad. Ever. In particular if your devices will be unusable after following this tutorial! Mine didn&#8217;t :) Introduction I&#8217;ve recently been involved in making some changes to the Linux kernel. Not any Linux kernel but the Android Linux Kernel. I&#8217;ll share what I believe is a pretty [...]]]></description>
			<content:encoded><![CDATA[<h2>Disclaimer</h2>
<p>I am not responsible if anything goes bad. Ever. In particular if your devices will be unusable after following this tutorial! Mine didn&#8217;t :)</p>
<h2>Introduction</h2>
<p>I&#8217;ve recently been involved in making some changes to the Linux kernel. Not any Linux kernel but the Android Linux Kernel. I&#8217;ll share what I believe is a pretty good workflow for everyone interested in playing with it both on a NexusOne (with the stock OS, i.e. WITHOUT <a href="http://www.cyanogenmod.com/">CyanogenMod</a>) and on a HTC Magic (with CyanogenMod installed). They are quite similar scenarios, and many others have been writing about it. I always had to change a few things from others descriptions and therefore here I report what I found to be a working solution for the latest patched updated versions. This is an aggregation work of others spread all around the interwebs. I like things accessible in one place :)</p>
<p>Throughout this &#8220;tutorial&#8221; I will be assuming that you are working on a Linux environment (i.e. Ubuntu). Furthermore I work on a 32-bit system, if you are not in this situation try it out, but further changes might be needed.</p>
<h2>Preliminary Settings</h2>
<p>Let&#8217;s start with having all the necessary software which we will need later installed and operative. If you are already an Android and/or a Kernel developer you most probably have this already done. Skip this section.</p>
<ol>
<li><b>adb</b> is needed. Install the latest <a href="http://developer.android.com/sdk/index.html">Android SDK</a> &#8211; I personally install it in
<pre>~/Bin/android-sdk-linux_x86</pre>
<p> Remember to add the <b>tools/</b> directory to your <b>$PATH</b> variable.</li>
<li><b>ndk</b> is needed. Install the latest <a href="">Android NDK</a> &#8211; I personally install it in
<pre>~/Bin/android-ndk-VERSION</pre>
<p> For example the latest is version <b>r5</b> and the directory will be:
<pre>~/Bin/android-ndk-r5</pre>
<p>. Remember then to add the <b>toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin</b> directory that is present inside the ndk to your <b>$PATH</b> variable.</li>
<li><b>fastboot</b> is needed. <a href="http://www.cloudgoessocial.net/android_tuts/fastboot.zip">Grab it</a> and download it inside your <b>sdk/tools</b> directory or anywhere that is in your <b>$PATH</b></li>
<li>Software is needed. Install it.
<pre class="brush: plain; title: ; notranslate">
apt-get install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
</pre>
<p>If you are on a 64-bit machine also install:</p>
<pre class="brush: plain; title: ; notranslate">
apt-get install ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
</pre>
</li>
</ol>
<p>In the end your <b>~/.bash_profile</b>, <b>~/.bash_rc</b>, &#8230; would look along the lines of:</p>
<pre class="brush: plain; title: ; notranslate">
export PATH=&quot;~/Bin/android-sdk-linux_x86/tools:~/Bin/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin:${PATH}&quot;
</pre>
<p>Now let&#8217;s dwell into the interesting things. First of all have your directory structure well planned ahead. Or you will end up losing a lot of time just remembering what is what.</p>
<pre class="brush: plain; title: ; notranslate">
mkdir ~/android
mkdir ~/android/bootimg_builder
cd ~/android
</pre>
<p>Now we clone the <b>git</b> repositories for the Google kernel and for the CyanogenMod kernel. We will have two directories with the sources for the two kernels: <b>cm-kernel</b> and <b>google-kernel</b></p>
<pre class="brush: plain; title: ; notranslate">
git clone git://github.com/CyanogenMod/cm-kernel.git cm-kernel
git clone git://android.git.kernel.org/kernel/msm.git google-kernel
</pre>
<p>This is where I will first go into explaining the procedure for the HTC Magic with CyanogenMod installed and afterwards I will explain how to make it work for the NexusOne.</p>
<h2>HTC Magic with CyanogenMod</h2>
<p>Let&#8217;s start by switching to our own branch, in case we want to modify anything and keep track of the changes without polluting the master branch. The latest CyanogenMod (6.1) uses the kernel version 2.6.35, we keep on using that.</p>
<pre class="brush: plain; title: ; notranslate">
cd cm-kernel
git checkout -b personal_branch origin/android-msm-2.6.35-froyo-stable
</pre>
<p>Now we need to pull the configuration file off from the device, have it plugged to the PC through the USB port.</p>
<pre class="brush: plain; title: ; notranslate">
adb pull /proc/config.gz config.gz
gunzip config.gz &amp;&amp; mv config .config
</pre>
<p>Now we update the .config that will be used while compiling the kernel.</p>
<pre class="brush: plain; title: ; notranslate">
ARCH=arm CROSS_COMPILE=arm-eabi- make oldconfig
ARCH=arm CROSS_COMPILE=arm-eabi- make menuconfig
</pre>
<p>The last command will open up an interactive menu. Change what you want (i.e. nothing if you don&#8217;t require particular stuff&#8230;) and then get to Exit (and select Yes if you changed something, if you didn&#8217;t you won&#8217;t be prompted).</p>
<p>It is time to actually compile the kernel.</p>
<pre class="brush: plain; title: ; notranslate">
ARCH=arm CROSS_COMPILE=arm-eabi- make
</pre>
<p>The first time this will be a long procedure, the resulting file will be stored in
<pre>arch/arm/boot/zImage</pre>
<p> and you can test it on your device directly by going into <b>fastboot</b> mode (hold the <b>BACK</b> button while powering up the device). Then issue this command:</p>
<pre class="brush: plain; title: ; notranslate">
fastboot boot arch/arm/boot/zImage
</pre>
<p>The phone should boot up normally and you can confirm that it&#8217;s running your kernel by going into Settings-About-Scroll down to the Kernel section. Note that if you reboot the phone it will go back to using the pre-installed kernel. More on <b>flashing</b> the kernel later on.</p>
<h2>NexusOne with standard Android OS</h2>
<p>First we need to unlock the NexusOne to accept new roms to be installed, have it in <b>fastboot</b> mode by holding the TRACKBALL down while booting up and issue this command</p>
<pre class="brush: plain; title: ; notranslate">
fastboot oem unlock
</pre>
<p>Note that this <b>will void your warranty!</b></p>
<p>We also need the NexusOne to be rooted: rooting goes beyond the scope of this tutorial. Have your phone rooted in any way that you want (i.e. by using the <a href="http://forum.xda-developers.com/showthread.php?t=803682">SuperOneClick tool</a> (it requires a Windows machine or luck with a Linux one).</p>
<p>This one is much more interesting! And while being very similar it also has some differences. First of all from our <b>~/android/</b> directory let&#8217;s move to the <b>google-kernel</b> directory and again create our own branch to work on.</p>
<pre class="brush: plain; title: ; notranslate">
cd ~/android/google-kernel
git checkout -b personal_branch origin/android-msm-2.6.32
</pre>
<p>Note that in this case we&#8217;re using the kernel version 2.6.32 which is the one that&#8217;s installed by default on the NexusOne. The latest 2.6.35 should work but I haven&#8217;t really tested.</p>
<p>Next we create the usual <b>.config</b> file</p>
<pre class="brush: plain; title: ; notranslate">
ARCH=arm CROSS_COMPILE=arm-eabi- make mahimahi_defconfig
ARCH=arm CROSS_COMPILE=arm-eabi- make menuconfig
</pre>
<p>Hit <b>Exit</b> and save if prompted (you shouldn&#8217;t!)</p>
<p>We now manually modify the <b>.config</b> file with your favorite text editor open the file and search for these strings</p>
<pre class="brush: plain; title: ; notranslate">
nano .config
uncomment CONFIG_USB_ANDROID_ACM=y (add the =y part and remove what's there)
comment CONFIG_MSM_SERIAL_DEBUGGER
comment CONFIG_MSM_FIQ_SUPPORT
</pre>
<p>We&#8217;re ready to compile the kernel</p>
<pre class="brush: plain; title: ; notranslate">
ARCH=arm CROSS_COMPILE=arm-eabi- make
</pre>
<p>This will take some time, the resulting product will be stored in <b>arch/arm/boot/zImage</b> and you can test it on your device directly by going into <b>fastboot</b> mode (hold the <b>TRACKBALL</b> down while powering up the device). Then issue this command:</p>
<pre class="brush: plain; title: ; notranslate">
fastboot boot arch/arm/boot/zImage
</pre>
<p>The phone should boot up normally and you can confirm that it&#8217;s running your kernel by going into Settings-About-Scroll down to the Kernel section. Note that if you reboot the phone it will go back to using the pre-installed kernel. More on <b>flashing</b> the kernel later on.</p>
<h2>NexusOne enable my WiFi, please</h2>
<p>The WiFi kernel module that is on the NexusOne is not compiled to work with this kernel that we are using therefore WiFi won&#8217;t work. There&#8217;s a work around but it requires you to have <b>root</b> privileges on your device. Rooting goes beyond the scope of this tutorial. Have your phone rooted in any way that you want (i.e. by using the <a href="http://forum.xda-developers.com/showthread.php?t=803682">SuperOneClick tool</a> (it requires a Windows machine or luck with a Linux one).</p>
<p>First  you copy the compiled kernel module to the phone <b>/sdcard</b></p>
<pre class="brush: plain; title: ; notranslate">
cd ~/android/google-kernel
adb push drivers/net/wireless/bcm4329/bcm4329.ko /sdcard/
</pre>
<p>Then you need to make the phone <b>/system</b> partition writable, back up the old module and install the new one</p>
<pre class="brush: plain; title: ; notranslate">
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/lib/modules/
cat ./bcm4329.ko &gt; ./bcm4329.ko-orig
cat /sdcard/bcm4329.ko &gt; ./bcm4329.ko
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
</pre>
<p>At this point your WiFi should be working again! :)</p>
<h2>On flashing for awesome later use</h2>
<p>Now that you tested that your compiled/(modified) kernel is actually working you may want to have it installed also after rebooting the phone. To achieve this you need to <b>flash</b> it to the phone internal storage. It is advisable that first you backup everything using a recovery tool (Amon RA 2.0.0 for the NexusOne works great with the <b>nandbackup</b> tool).</p>
<p>First grab <a href="http://www.cloudgoessocial.net/android_tuts/bootimg_builder.zip">two utilities</a> that will be needed for this step and unzip them into the <b>~/android/bootimg_builder</b> directory that we have created previously.</p>
<p>Throughout this part of the tutorial I will give commands for both the Magic and the NexusOne, please use only the ones that are useful for your case.</p>
<p>We first need to grab the <b>boot.img</b> file from the running device, have the device running and connected to the PC via USB then issue the command</p>
<pre class="brush: plain; title: ; notranslate">
cd ~/android/bootimg_builder
adb shell
cat /dev/mtd/mtd2 &gt; /sdcard/mtd2.img
exit
adb pull /sdcard/mtd2.img ./nexus-boot.img
</pre>
<p>OR for the MAGIC</p>
<pre class="brush: plain; title: ; notranslate">
adb pull /sdcard/mtd2.img ./magic-boot.img
</pre>
<p>We now extract the <b>boot.img-kernel</b> and <b>ramdisk</b> by using the supplied perl script</p>
<pre class="brush: plain; title: ; notranslate">
./split_bootimg.pl nexus-boot.img
</pre>
<p>OR for the MAGIC</p>
<pre class="brush: plain; title: ; notranslate">
./split_bootimg.pl magic-boot.img
</pre>
<p>The output of this command will be along the lines of:</p>
<pre class="brush: plain; title: ; notranslate">
Page size: 2048 (0x00000800)
Kernel size: 2226104 (0x0021f7b8)
Ramdisk size: 164628 (0x00028314)
Second size: 0 (0x00000000)
Board name:
Command line: no_console_suspend=1 msmsdcc_sdioirq=1 wire.search_count=5
Writing nexus-boot.img-kernel ... complete.
Writing nexus-boot.img-ramdisk.gz ... complete.
</pre>
<p>We now need to copy the compiled kernel to our working directory discarding the one extracted previously</p>
<pre class="brush: plain; title: ; notranslate">
cd ~/android/bootimg_builder
cp ../google-kernel/arch/arm/boot/zImage ./nexus-boot.img-kernel
OR for the MAGIC
cp ../cm-kernel/arch/arm/boot/zImage ./magic-boot.img-kernel
</pre>
<p>Now we combine everything into just one <b>boot.img</b> that we can then flash to the device</p>
<pre class="brush: plain; title: ; notranslate">
./mkbootimg --kernel nexus-boot.img-kernel --ramdisk nexus-boot.img-ramdisk.gz -o boot.img --cmdline 'no_console_suspend=1 msmsdcc_sdioirq=1 wire.search_count=5' --base 0x20000000
</pre>
<p>OR for the MAGIC</p>
<pre class="brush: plain; title: ; notranslate">
./mkbootimg --kernel magic-boot.img-kernel --ramdisk magic-boot.img-ramdisk.gz -o boot.img --cmdline 'no_console_suspend=1 console=null'
</pre>
<p>At this point we&#8217;re ready to flash the new image to the device, have it in <b>fastboot</b> mode (TRACKBALL on the NexusOne, BACK on the Magick while booting up) and issue the command</p>
<pre class="brush: plain; title: ; notranslate">
fastboot flash boot boot.img
fastboot reboot
</pre>
<p>If everything has gone well enjoy your new kernel installed definitively on your device. You did make a <b>nandbackup</b> before in case you want to go back, right? Well, I told you to :D</p>
<h2>Conclusion and Acknowledgments</h2>
<p>Hope you enjoyed this full tutorial on everything needed to compile, test and install a kernel on a NexusOne or on a Magic with CyanogenMod installed. I would like to thank you all that have done the hard work of writing tutorials on how to do so before [<a href="http://atechyblog.blogspot.com/2010/08/enabling-serial-port-on-nexus-one.html">here</a>|<a href="http://credentiality2.blogspot.com/2010/08/nexus-one-htc-passion-compile-and-flash.html">here</a>], the guys that maintain CyanogenMod [<a href="http://www.cyanogenmod.com/">here</a>|<a href="http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source">here</a>] and those who wrote the perl script to extract the two images from the <b>boot.img</b> file [<a href="http://www.enck.org/">here</a>]. Mine has been just a work of aggregation. But I wanted to have everything working and described in a single post.</p>
<p>Cheers.</p>
<p>~C</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudgoessocial.net/2010/12/16/android-kernel-compilation-detailed-instructions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reader Notifier Reloaded</title>
		<link>http://www.cloudgoessocial.net/2010/05/27/reader-notifier-reloaded/</link>
		<comments>http://www.cloudgoessocial.net/2010/05/27/reader-notifier-reloaded/#comments</comments>
		<pubDate>Thu, 27 May 2010 11:44:29 +0000</pubDate>
		<dc:creator>Cloud</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[rand]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Reader Notifier]]></category>

		<guid isPermaLink="false">http://www.cloudgoessocial.net/?p=328</guid>
		<description><![CDATA[Hi, I&#8217;m using Google Reader, as an aggregator for all the feeds that I want to follow. Great! So I don&#8217;t have to keep those 6 tabs open in my favorite browser, right? Well, kind of. The problem resides in the fact that then I would still have my mail and calendar open. And google [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m using <a href="http://www.google.com/reader/">Google Reader</a>, as an aggregator for all the feeds that I want to follow. Great! So I don&#8217;t have to keep those 6 tabs open in my favorite browser, right? Well, kind of. The problem resides in the fact that then I would still have my mail and calendar open. And google reader. And &#8230;</p>
<p>Mike and me have been looking around for a solution to this and stumbled across <a href="http://github.com/canbuffi/readernotifier">Reader Notifier</a>. It&#8217;s a small MacOSX application that resides in the Menu bar and notifies you when new items are available.</p>
<p>Since the code was publicly available we decided to have a look at it&#8230; Well, after coding for a while for iPhone and Mac applications we could tell immediately that we could have improved the code and possibly the application functionalities. Now <a href="http://github.com/godenzim/readernotifier">Reader Notifier Reloaded</a> is born. We keep the code open, so that everyone can just fork it, modify it, have a look at it, &#8230;</p>
<p><a href="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/readernotifierreloaded.png" rel="lightbox[328]"><img src="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/readernotifierreloaded-300x198.png" alt="" title="Reader Notifier Reloaded" width="300" height="198" class="aligncenter size-medium wp-image-329" /></a></p>
<p>Currently Reader Notifier Reloaded lets you:</p>
<ul>
<li>Be notified through Growl about new unread items</li>
<li>Mark all your feeds as read</li>
<li>Read the feed directly through the menu application</li>
<li>Star an item</li>
<li>Automatic updates</li>
</ul>
<p>And all of this with a much more structured code than the original and without any memory leaks (well, there were many and we managed to remove them all, hopefully).</p>
<p>A stable version is <a href="http://github.com/downloads/godenzim/readernotifier/Reader%20Notifier%20Reloaded_2.0.zip">downloadable from github</a></p>
<p>If you have feature requests, find bugs or just want to get involved with the project, drop us a note either here or on github.</p>
<p>-Mike and Claudio</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudgoessocial.net/2010/05/27/reader-notifier-reloaded/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Sparkle script in XCode</title>
		<link>http://www.cloudgoessocial.net/2010/05/27/sparkle-script-in-xcode/</link>
		<comments>http://www.cloudgoessocial.net/2010/05/27/sparkle-script-in-xcode/#comments</comments>
		<pubDate>Thu, 27 May 2010 11:06:15 +0000</pubDate>
		<dc:creator>Cloud</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tips & howtos]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[sparkle]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.cloudgoessocial.net/?p=321</guid>
		<description><![CDATA[So, for a project that I&#8217;m working on (Reader Notifier Reloaded, more about it in a following post), I&#8217;ve been using Sparkle. It is a great tool for providing updates to the users. Since Sparkle is using public/private key cryptography in order to sign the updates and guarantee their authenticity there is some &#8220;fiddling&#8221; one [...]]]></description>
			<content:encoded><![CDATA[<p>So,<br />
for a project that I&#8217;m working on (<a href="http://github.com/godenzim/readernotifier">Reader Notifier Reloaded</a>, more about it in a following post), I&#8217;ve been using <a href="http://sparkle.andymatuschak.org/">Sparkle</a>. It is a great tool for providing updates to the users.</p>
<p>Since Sparkle is using public/private key cryptography in order to sign the updates and guarantee their authenticity there is some &#8220;fiddling&#8221; one has to do in order to push out an update. Marc Liyanage provides us with <a href="http://www.entropy.ch/blog/Developer/2008/09/22/Sparkle-Appcast-Automation-in-Xcode.html">a great way</a> to do all the signing, packaging and xml generation for updates.</p>
<p>I&#8217;ve been using his technique and just adapted the shell script to make it work on my Snow Leopard 10.6.3 without the need of the libxml perl library.</p>
<p>In particular I&#8217;ve changed the SIGNATURE part to:</p>
<pre class="brush: bash; title: ; notranslate">
SIGNATURE=$(
	myvar=$(security find-generic-password -g -s &quot;Sparkle Private Key&quot; 2&gt;&amp;1 1&gt;/dev/null | sed 's/.*-----BEGIN DSA PRIVATE KEY-----\&#92;&#48;12\(.*\)\&#92;&#48;12-----END DSA PRIVATE KEY-----.*/-----BEGIN DSA PRIVATE KEY-----\
\1\
-----END DSA PRIVATE KEY-----/g' | sed 's/\&#92;&#48;12/\
/g')

echo &quot;$myvar&quot; &gt; tmp.tmp

openssl dgst -sha1 -binary &lt; &quot;$ARCHIVE_FILENAME&quot; \
| openssl dgst -dss1 -sign tmp.tmp \
| openssl enc -base64

rm tmp.tmp
)
</pre>
<p>So, here&#8217;s the script I&#8217;m using, if anyone wants it!</p>
<pre class="brush: bash; title: ; notranslate">
set -o errexit

if [[ $BUILD_STYLE != &quot;Deploy&quot; ]]; then
	echo Distribution target requires &quot;'Deploy'&quot; build style
	exit
fi

VERSION=$(defaults read &quot;$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Info&quot; CFBundleVersion)
DOWNLOAD_BASE_URL=&quot;http://www.example.com/some_product&quot;
RELEASENOTES_URL=&quot;http://www.example.com/some_product/$VERSION.html&quot;

ARCHIVE_FILENAME=&quot;${PRODUCT_NAME}_$VERSION.zip&quot;
DOWNLOAD_URL=&quot;$DOWNLOAD_BASE_URL/$ARCHIVE_FILENAME&quot;
KEYCHAIN_PRIVKEY_NAME=&quot;Sparkle Private Key&quot;

WD=$PWD
cd &quot;$BUILT_PRODUCTS_DIR&quot;
rm -f &quot;$PRODUCT_NAME&quot;*.zip
ditto -ck --keepParent &quot;$PRODUCT_NAME.app&quot; &quot;$ARCHIVE_FILENAME&quot;

SIZE=$(stat -f %z &quot;$ARCHIVE_FILENAME&quot;)
PUBDATE=$(LC_TIME=en_US date +&quot;%a, %d %b %G %T %z&quot;)
SIGNATURE=$(
	myvar=$(security find-generic-password -g -s &quot;Sparkle Private Key&quot; 2&gt;&amp;1 1&gt;/dev/null | sed 's/.*-----BEGIN DSA PRIVATE KEY-----\&#92;&#48;12\(.*\)\&#92;&#48;12-----END DSA PRIVATE KEY-----.*/-----BEGIN DSA PRIVATE KEY-----\
\1\
-----END DSA PRIVATE KEY-----/g' | sed 's/\&#92;&#48;12/\
/g')

echo &quot;$myvar&quot; &gt; tmp.tmp

openssl dgst -sha1 -binary &lt; &quot;$ARCHIVE_FILENAME&quot; \
| openssl dgst -dss1 -sign tmp.tmp \
| openssl enc -base64

rm tmp.tmp
)

[ $SIGNATURE ] || { echo Unable to load signing private key with name &quot;'$KEYCHAIN_PRIVKEY_NAME'&quot; from keychain; false; }

cat &gt; $VERSION.xml &lt;&lt;EOF
&lt;item&gt;
	&lt;title&gt;Version $VERSION&lt;/title&gt;
	&lt;sparkle:releaseNotesLink&gt;$RELEASENOTES_URL&lt;/sparkle:releaseNotesLink&gt;
	&lt;pubDate&gt;$PUBDATE&lt;/pubDate&gt;
	&lt;enclosure
		url=&quot;$DOWNLOAD_URL&quot;
		sparkle:version=&quot;$VERSION&quot;
		type=&quot;application/octet-stream&quot;
		length=&quot;$SIZE&quot;
		sparkle:dsaSignature=&quot;$SIGNATURE&quot;
	/&gt;
&lt;/item&gt;
EOF
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudgoessocial.net/2010/05/27/sparkle-script-in-xcode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhoneManagers</title>
		<link>http://www.cloudgoessocial.net/2010/05/17/iphonemanagers/</link>
		<comments>http://www.cloudgoessocial.net/2010/05/17/iphonemanagers/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:30:37 +0000</pubDate>
		<dc:creator>Cloud</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://www.cloudgoessocial.net/?p=312</guid>
		<description><![CDATA[Mike and I are glad to announce to all you iPhone developers a library that we&#8217;ve been building together that enables very fast and easy development of network-related iPhone applications. In particular in the library you will find: Network Manager &#8211; easy way to deal with parallel asynchronous network requests Image Manager &#8211; easy way [...]]]></description>
			<content:encoded><![CDATA[<p>Mike and I are glad to announce to all you iPhone developers a library that we&#8217;ve been building together that enables very fast and easy development of network-related iPhone applications.</p>
<p>In particular in the library you will find:</p>
<ul>
<li><strong>Network Manager</strong> &#8211; easy way to deal with parallel asynchronous network requests</li>
<li><strong>Image Manager</strong> &#8211; easy way to download and cache images on the iPhone</li>
<li><strong>SystemMessage Manager</strong> &#8211; unified way to display HUD messages across the application, both auto-disappearing or not</li>
</ul>
<p>If you are interested you can grab the source and compile it for your project, it will create a standard static library that you can include in your projects. Header files have relevant comments that will make your life easier when dealing with the library.</p>
<p>For any feedback don&#8217;t hesitate to write over here or at the <a href="http://github.com/godenzim/iPhoneManagers">github</a> page.</p>
<p>Enough talking, <a href="http://github.com/godenzim/iPhoneManagers">just try it out</a>! And here&#8217;s two images of the SystemMessageManager displaying its HUD windows:</p>
<p><a href="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/screen1.png" rel="lightbox[312]"><img src="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/screen1-199x300.png" alt="" title="Activity HUD" width="199" height="300" class="alignleft size-medium wp-image-315" /></a><br />
<a href="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/screen2.png" rel="lightbox[312]"><img src="http://www.cloudgoessocial.net/wp-content/uploads/2010/05/screen2-199x300.png" alt="" title="HUD message" width="199" height="300" class="aligncenter size-medium wp-image-316" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudgoessocial.net/2010/05/17/iphonemanagers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

