<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>4DC5</title>
	<atom:link href="http://4dc5.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://4dc5.com</link>
	<description></description>
	<lastBuildDate>Mon, 13 May 2013 12:45:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='4dc5.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>4DC5</title>
		<link>http://4dc5.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://4dc5.com/osd.xml" title="4DC5" />
	<atom:link rel='hub' href='http://4dc5.com/?pushpress=hub'/>
		<item>
		<title>Compiling C console applications for Android (on Mac OS X)</title>
		<link>http://4dc5.com/2013/02/10/compiling-c-console-applications-for-android-on-mac-os-x/</link>
		<comments>http://4dc5.com/2013/02/10/compiling-c-console-applications-for-android-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 10 Feb 2013 10:56:18 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=508</guid>
		<description><![CDATA[I wanted to build some C applications on my Mac, to run directly on the console in Android. It&#8217;s possible to do this using the ARM toolchain, but it can be a bit hard to work out how to do &#8230; <a href="http://4dc5.com/2013/02/10/compiling-c-console-applications-for-android-on-mac-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=508&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I wanted to build some C applications on my Mac, to run directly on the console in Android. It&#8217;s possible to do this using the <a class="zem_slink" title="ARM architecture" href="http://en.wikipedia.org/wiki/ARM_architecture" target="_blank" rel="wikipedia">ARM</a> toolchain, but it can be a bit hard to work out how to do it. Having got it working, I&#8217;ve written down a simple process that should allow you to get up and running very quickly.<span id="more-508"></span> (Thanks to <a href="http://www.pocketmagic.net/2010/11/android-c-native-development-using-the-ndk-under-windows/#.URd3JlrUBFk">Radu Motisan</a> for his 2010 article targeting Windows. It&#8217;s out of date now, and for a different OS, but it gave me most of the clues I needed to get it working.)</p>
<p>1. Install the <a href="http://developer.android.com/sdk/index.html">Android SDK for Mac OS X</a>. (I put mine in ~/android-sdk.)</p>
<p>2. Install the <a href="http://developer.android.com/tools/sdk/ndk/index.html">Android NDK for Mac OS X</a>. (I put mine in ~/android-ndk-r8d.)</p>
<p>3. Set up your $PATH. In ~/.bash_profile, add these lines:</p>
<pre class="brush: bash; title: ; notranslate">
NDK_ROOT=~/android-ndk-r8d
SDK_ROOT=~/android-sdk
export PATH=$PATH:$SDK_ROOT/sdk/platform-tools
export PATH=$PATH:$NDK_ROOT
export PATH=$PATH:$NDK_ROOT/prebuilt/darwin-x86/bin
export PATH=$PATH:$NDK_ROOT/build/tools
</pre>
<p>4. Create a new executable script called ndk-comp. Put it in $NDK_ROOT.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh

ANDROIDSDK='android-14'

PROGDIR=`dirname $0`
PROGDIR=`cd $PROGDIR &amp;&amp; pwd`

ARMEABIGCC=$PROGDIR/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc
ARMEABILIB=$PROGDIR/platforms/$ANDROIDSDK/arch-arm/usr/lib
ARMEABIINC=$PROGDIR/platforms/$ANDROIDSDK/arch-arm/usr/include
ARMEABICRT=$PROGDIR/platforms/$ANDROIDSDK/arch-arm/usr/lib/crtbegin_dynamic.o

LINKER=/system/bin/linker

echo &quot;GCC:&quot;$ARMEABIGCC &quot;LIB:&quot;$ARMEABILIB &quot;LINKER&quot;:$LINKER &quot;PARAMS:&quot;$@

$ARMEABIGCC $@ -Wl,-rpath-link=$ARMEABILIB,-dynamic-linker=$LINKER -L$ARMEABILIB $ARMEABICRT -I$ARMEABIINC -nostdlib -lc
</pre>
<p>That&#8217;s it!</p>
<p>Now to test it. In a working directory, create a simple C program test.c :</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;

int main()
{
printf(&quot;Hello world!\n&quot;);
return 0;
}
</pre>
<p>Run this command to build it:</p>
<pre class="brush: bash; title: ; notranslate">
ndk-comp -o test test.c
</pre>
<p>Now connect your Android device, and push the executable to a suitable location (I&#8217;m using /data/local/tmp here):</p>
<pre class="brush: bash; title: ; notranslate">
adb push test /data/local/tmp
</pre>
<p>Now run it:</p>
<pre class="brush: bash; title: ; notranslate">
$ adb shell
# cd /data/local/tmp
# ./test
</pre>
<p>And you should see:</p>
<pre class="brush: bash; title: ; notranslate">
Hello world!
[1] + Stopped (signal) ./test
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/508/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=508&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2013/02/10/compiling-c-console-applications-for-android-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>
	</item>
		<item>
		<title>Mac OS X mute startup sound</title>
		<link>http://4dc5.com/2013/02/03/mac-os-x-mute-startup-sound/</link>
		<comments>http://4dc5.com/2013/02/03/mac-os-x-mute-startup-sound/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 09:23:51 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[mac boot sound mute applescript]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=489</guid>
		<description><![CDATA[I&#8217;ve been looking for a way to mute the startup sound on my MacBook Air. A lot of people claim that Apple deliberately make this sound unmutable as it acts as a diagnostic check on boot, similar to the beeps &#8230; <a href="http://4dc5.com/2013/02/03/mac-os-x-mute-startup-sound/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=489&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been looking for a way to mute the startup sound on my MacBook Air. A lot of people claim that Apple deliberately make this sound unmutable as it acts as a diagnostic check on boot, similar to the beeps on a PC. However, this doesn&#8217;t really make sense, because the sound will not play if at the time of the last shutdown the volume had been muted. So it can&#8217;t be relied upon as a diagnostic. (&#8220;Either this Mac is broken, or you had the sound muted when you shut down. I can&#8217;t tell which.&#8221;)</p>
<p>Some people also say that if you&#8217;re going to be using your MacBook in a place where you need to be quiet, then you should ensure that you&#8217;ve muted the sound before you shut down. But this doesn&#8217;t make sense either, because you don&#8217;t always know when you shut down that the next place you&#8217;ll be turning it on is a quiet place.</p>
<p>Anyway, I found a method on the <a href="http://macscripter.net/viewtopic.php?pid=114655#p114655">MacScripter forum</a> which solves the problem quite nicely by muting the sound automatically upon logout. AppleScript is a technology that I&#8217;ve not really used much before, so I&#8217;m not aware of all the things that can be done with it. Looking through some sample scripts, it does seem to be a powerful tool for automating Mac tasks (and it&#8217;s been around a very long time, so there are lots of examples to play with).</p>
<p>Of course, this method only works if the logout process executes. It won&#8217;t be able to mute the sound if Mac OS crashes! But it will catch the overwhelming majority of cases.</p>
<p>Here&#8217;s how to mute the boot sound. (I&#8217;ve only retained the &#8220;logout&#8221; part of the solution, as that&#8217;s the only bit that I care about.)</p>
<p>Create a plain text file with the following as the logout script:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
/usr/bin/osascript -e 'set volume with output muted'
</pre>
<p>Save the script as /usr/local/bin/logoutscript .</p>
<p>In Terminal, run the following command:</p>
<pre class="brush: bash; title: ; notranslate">
sudo chmod a+x /usr/local/bin/logoutscript
sudo defaults write com.apple.loginwindow LogoutHook /usr/local/bin/logoutscript
</pre>
<p>If you want to remove these changes later, do this:</p>
<pre class="brush: bash; title: ; notranslate">
sudo defaults delete com.apple.loginwindow LogoutHook
sudo rm /usr/local/bin/logoutscript
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/489/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/489/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=489&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2013/02/03/mac-os-x-mute-startup-sound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>
	</item>
		<item>
		<title>Stop MacOS X Lion Office reopening old documents</title>
		<link>http://4dc5.com/2012/06/24/stop-macos-x-lion-office-reopening-old-documents/</link>
		<comments>http://4dc5.com/2012/06/24/stop-macos-x-lion-office-reopening-old-documents/#comments</comments>
		<pubDate>Sun, 24 Jun 2012 07:52:36 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=471</guid>
		<description><![CDATA[UPDATE: This doesn&#8217;t seem to work any more. I now just have the setting &#8220;Close windows when quitting an application&#8221; set in System Preferences &#8211; General. Original post: On Mac OS X Lion, Microsoft Word reopens previously edited documents when &#8230; <a href="http://4dc5.com/2012/06/24/stop-macos-x-lion-office-reopening-old-documents/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=471&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>UPDATE</strong>: This doesn&#8217;t seem to work any more. I now just have the setting &#8220;Close windows when quitting an application&#8221; set in System Preferences &#8211; General.</p>
<p><a href="http://4dc5.files.wordpress.com/2012/06/screen-shot-2013-02-03-at-10-32-11.png"><img class="aligncenter size-medium wp-image-493" alt="System Preferences" src="http://4dc5.files.wordpress.com/2012/06/screen-shot-2013-02-03-at-10-32-11.png?w=300&#038;h=241" width="300" height="241" /></a></p>
<p><strong>Original post:</strong></p>
<p>On Mac OS X Lion, Microsoft Word reopens previously edited documents when you start it up. This can be very annoying.</p>
<p>To stop it, run this:</p>
<pre class="brush: bash; title: ; notranslate">defaults write com.microsoft.Word NSQuitAlwaysKeepsWindows -bool false</pre>
<p>You can substitute different applications for com.microsoft.Word. You can find the names in ~/Library/Saved Application State.</p>
<p>If you want to fix all the main Office apps (and Preview) in one go, run this script:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

function runit
{
defaults write $1 NSQuitAlwaysKeepsWindows -bool false
}

runit com.microsoft.Word
runit com.microsoft.Excel
runit com.microsoft.Powerpoint
runit com.apple.Preview
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=471&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/06/24/stop-macos-x-lion-office-reopening-old-documents/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/06/screen-shot-2013-02-03-at-10-32-11.png?w=300" medium="image">
			<media:title type="html">System Preferences</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up VNC on Raspberry Pi for Mac access</title>
		<link>http://4dc5.com/2012/06/12/setting-up-vnc-on-raspberry-pi-for-mac-access/</link>
		<comments>http://4dc5.com/2012/06/12/setting-up-vnc-on-raspberry-pi-for-mac-access/#comments</comments>
		<pubDate>Tue, 12 Jun 2012 21:42:27 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=452</guid>
		<description><![CDATA[I wanted to set up VNC on my Raspberry Pi so I could use it via a remote desktop on my MacBook Air. There are lots of instructions scattered in various places around the web, but now I&#8217;ve put together &#8230; <a href="http://4dc5.com/2012/06/12/setting-up-vnc-on-raspberry-pi-for-mac-access/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=452&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://4dc5.files.wordpress.com/2012/06/pivnc.png"><img class="alignright size-medium wp-image-461" title="Mac VNC access to Raspberry Pi" alt="" src="http://4dc5.files.wordpress.com/2012/06/pivnc.png?w=300&#038;h=225" width="300" height="225" /></a>I wanted to set up VNC on my Raspberry Pi so I could use it via a remote desktop on my MacBook Air. There are lots of instructions scattered in various places around the web, but now I&#8217;ve put together a comprehensive set of things to do, I thought it might be useful to share it in one place.<span id="more-452"></span></p>
<p><strong>Set up file sharing and autodiscovery</strong></p>
<p>[Source: <a href="http://gettingstartedwithraspberrypi.tumblr.com/post/24398167109/file-sharing-with-afp-and-auto-discovery-with-bonjour">Getting Started With Raspberry Pi</a>]</p>
<p>On the Pi:</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install netatalk
</pre>
<p>Now from the Mac, open Finder, and hit ⌘K. Enter afp://192.168.0.22 (using the IP address of your Pi).</p>
<p>On the Pi:</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install avahi-daemon
sudo update-rc.d avahi-daemon defaults
</pre>
<p>Now create a file /etc/avahi/services/afpd.service (as root):</p>
<pre class="brush: bash; title: ; notranslate">
sudo vim /etc/avahi/services/afpd.service
</pre>
<p>and add this content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; standalone='no'?&gt;&lt;!--*-nxml-*--&gt;
&lt;!DOCTYPE service-group SYSTEM &quot;avahi-service.dtd&quot;&gt;
&lt;service-group&gt;
   &lt;name replace-wildcards=&quot;yes&quot;&gt;%h&lt;/name&gt;
   &lt;service&gt;
      &lt;type&gt;_afpovertcp._tcp&lt;/type&gt;
      &lt;port&gt;548&lt;/port&gt;
   &lt;/service&gt;
&lt;/service-group&gt;
</pre>
<p>Then run this command:</p>
<pre class="brush: bash; title: ; notranslate">
sudo /etc/init.d/avahi-daemon restart
</pre>
<p>You should now be able to see the Pi in the Finder sidebar.</p>
<p><strong>Setting up vncserver</strong></p>
<p>[Source: <a href="http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&amp;t=7395">Raspberry Pi forum</a>]</p>
<p>On the Pi:</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install tightvncserver
vncserver
</pre>
<p>Enter an eight character password.</p>
<p>Now do:</p>
<pre class="brush: bash; title: ; notranslate">
cd /etc/init.d
sudo vim tightvncserver
</pre>
<p>Add the following content to the file:</p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/bash
# /etc/init.d/tightvncserver
#

# Carry out specific functions when asked to by the system
case &quot;$1&quot; in
start)
    su pi -c '/usr/bin/vncserver -geometry 1440x900'
    echo &quot;Starting VNC server &quot;
    ;;
stop)
    pkill vncserver
    echo &quot;VNC Server has been stopped (didn't double check though)&quot;
    ;;
*)
    echo &quot;Usage: /etc/init.d/blah {start|stop}&quot;
    exit 1
    ;;
esac

exit 0
</pre>
<p>(Change the geometry setting if your monitor is a different size.)</p>
<p>Now do:</p>
<pre class="brush: bash; title: ; notranslate">
sudo chmod +x tightvncserver
sudo pkill Xtightvnc
</pre>
<p>Check the VNC server is not running:</p>
<pre class="brush: bash; title: ; notranslate">
ps aux | grep vnc
</pre>
<p>Then do:</p>
<pre class="brush: bash; title: ; notranslate">
sudo /etc/init.d/tightvncserver start
cd /etc/init.d
sudo update-rc.d tightvncserver defaults
</pre>
<p><strong>Finding your VNC server using Bonjour</strong></p>
<p>[Source: <a href="http://gettingstartedwithraspberrypi.tumblr.com/post/24400361937/finding-your-vnc-server-using-bonjour">Getting Started With Raspberry Pi</a>]</p>
<p>Create the avahi rfb service file:</p>
<pre class="brush: bash; title: ; notranslate">
sudo vim /etc/avahi/services/rfb.service
</pre>
<p>and add this content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; standalone='no'?&gt;
&lt;!DOCTYPE service-group SYSTEM &quot;avahi-service.dtd&quot;&gt;
&lt;service-group&gt;
  &lt;name replace-wildcards=&quot;yes&quot;&gt;%h&lt;/name&gt;
  &lt;service&gt;
    &lt;type&gt;_rfb._tcp&lt;/type&gt;
    &lt;port&gt;5901&lt;/port&gt;
  &lt;/service&gt;
&lt;/service-group&gt;
</pre>
<p>Then run:</p>
<pre class="brush: bash; title: ; notranslate">
sudo /etc/init.d/avahi-daemon restart
</pre>
<p>Now you should be able to see the Screen Share option for the Pi in your Finder sidebar.</p>
<p>If you&#8217;re also running an X session directly on the Pi (i.e. not through VNC), consider disabling the screensaver. You might forget that this X session is running if you&#8217;re not looking at the monitor (or if the monitor is turned off), and you&#8217;ll wonder what&#8217;s eating all the CPU suddenly after ten minutes. (Yes, this happened to me!)</p>
<p><strong>UPDATE:</strong></p>
<p>Tom A <a href="http://4dc5.com/2012/06/12/setting-up-vnc-on-raspberry-pi-for-mac-access/#comment-250">commented below</a> with an improved version of the startup script. Rather than leave it hidden in the comments, I decided to bring it up into the article. I haven&#8217;t tested the script, but I present it here for information.</p>
<p><em>Hi Pat,</em><br />
<em>Thanks so much for pulling this together. It saved me a lot of time getting this to work. In the spirit of adding to the solution, I can provide the following: I’ve tested this and found it to work on OSX 10.5.8, 10.6.8, 10.7.5, and 10.8.3. And I bashed your startup script against Andrew Berry’s generalized one to come up with the following version that does not pester you when you update-rc.d or perform various apt functions. This fixes what Ray was was asking about back in June of last year.</em></p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $remotefs $syslog
# Required-Stop: $remotefs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC server at boot time
# Description: Start VNC Server at boot time
### END INIT INFO

# The Username:Group that will run VNC
export USER=”pi”
#${RUNAS}

# The display that VNC will use
DISPLAY=”1″

# Color depth (between 8 and 32)
DEPTH=”16″

# The Desktop geometry to use.
#GEOMETRY=”x”
#GEOMETRY=”800×600″
#GEOMETRY=”1440×900″
#GEOMETRY=”1280×1024″
GEOMETRY=”1920×1080″

# The name that the VNC Desktop will have.
NAME=”my-vnc-server”

OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”

. /lib/lsb/init-functions

case “$1″ in
start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
;;

stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;

restart)
$0 stop
$0 start
;;
esac

exit 0
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/452/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=452&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/06/12/setting-up-vnc-on-raspberry-pi-for-mac-access/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/06/pivnc.png?w=300" medium="image">
			<media:title type="html">Mac VNC access to Raspberry Pi</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash script to copy Raspberry Pi disk image to SD card</title>
		<link>http://4dc5.com/2012/06/05/bash-script-to-copy-raspberry-pi-disk-image-to-sd-card/</link>
		<comments>http://4dc5.com/2012/06/05/bash-script-to-copy-raspberry-pi-disk-image-to-sd-card/#comments</comments>
		<pubDate>Tue, 05 Jun 2012 14:04:25 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=413</guid>
		<description><![CDATA[When you&#8217;ve downloaded a disk image for your Raspberry Pi, you need to copy it to your SD card. You can follow the simple instructions, but if you have to do this a lot it&#8217;s easier just to have a &#8230; <a href="http://4dc5.com/2012/06/05/bash-script-to-copy-raspberry-pi-disk-image-to-sd-card/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=413&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://commons.wikipedia.org/wiki/File:SanDisk_SD_Card_8GB.jpg" target="_blank"><img class="zemanta-img-inserted zemanta-img-configured " title="English: Image of the front and back of an 8GB..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/SanDisk_SD_Card_8GB.jpg/300px-SanDisk_SD_Card_8GB.jpg" alt="English: Image of the front and back of an 8GB..." width="161" height="107" align="right" /></a>When you&#8217;ve downloaded a <a href="http://www.raspberrypi.org/downloads">disk image for your Raspberry Pi</a>, you need to copy it to your SD card. You can follow the <a href="http://elinux.org/RPi_Easy_SD_Card_Setup">simple instructions</a>, but if you have to do this a lot it&#8217;s easier just to have a script that does it for you.</p>
<p>I wrote this script for use on my MacBook Air. It takes the disk image file as a parameter, e.g.</p>
<pre class="brush: bash; title: ; notranslate">./copytocard debian6-19-04-2012.img</pre>
<p><strong>NOTE: The disk devices could be different on your computer. This script could wipe out the wrong disk if the wrong device numbers are used. I&#8217;m providing the script for convenience; please ensure you check it carefully before using it on your own computer.</strong> Take a look at the <a href="http://elinux.org/RPi_Easy_SD_Card_Setup">simple instructions</a> so you can check which device numbers you need.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
[[ $# -eq 0 ]] &amp;&amp; echo &quot;I need an image file&quot; &amp;&amp; exit 1
IMG=$1
echo -n &quot;Waiting for card&quot;
df -h | grep disk2s1
RES=$?
while [[ $RES -gt 0 ]] ;
do
  echo -n .
  sleep 1
  df -h | grep disk2s1 &gt; /dev/null
  RES=$?
done
echo
echo &quot;Disk found&quot;
echo &quot;Unmounting...&quot;
diskutil unmount /dev/disk2s1
echo &quot;Copying (please wait)...&quot;
dd bs=1m if=$1 of=/dev/rdisk2
echo &quot;Ejecting...&quot;
diskutil eject /dev/rdisk2
echo &quot;Done. Remove card.&quot;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/413/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=413&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/06/05/bash-script-to-copy-raspberry-pi-disk-image-to-sd-card/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/SanDisk_SD_Card_8GB.jpg/300px-SanDisk_SD_Card_8GB.jpg" medium="image">
			<media:title type="html">English: Image of the front and back of an 8GB...</media:title>
		</media:content>
	</item>
		<item>
		<title>Mac OS X + FileVault 2 + Safe Boot&#8230; Don&#8217;t!</title>
		<link>http://4dc5.com/2012/06/01/mac-os-x-filevault-2-safe-boot-dont/</link>
		<comments>http://4dc5.com/2012/06/01/mac-os-x-filevault-2-safe-boot-dont/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 06:06:33 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=369</guid>
		<description><![CDATA[A word of warning&#8230; If you use FileVault 2 (full disk encryption) on your Mac, you might be tempted at some point to perform a Safe Boot by setting the boot flag: Don&#8217;t! What will actually happen is that the &#8230; <a href="http://4dc5.com/2012/06/01/mac-os-x-filevault-2-safe-boot-dont/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=369&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://4dc5.files.wordpress.com/2012/06/filevault.png"><img class="alignright size-full wp-image-401" title="FileVault" src="http://4dc5.files.wordpress.com/2012/06/filevault.png?w=640" alt=""   /></a>A word of warning&#8230;</p>
<p>If you use <a href="http://support.apple.com/kb/HT4790">FileVault 2</a> (<a class="zem_slink" title="Disk encryption" href="http://en.wikipedia.org/wiki/Disk_encryption" rel="wikipedia" target="_blank">full disk encryption</a>) on your Mac, you might be tempted at some point to perform a <a href="http://support.apple.com/kb/HT1455">Safe Boot</a> by setting the boot flag:</p>
<pre class="brush: bash; title: ; notranslate">sudo nvram boot-args=&quot;-x&quot;</pre>
<p><strong>Don&#8217;t!</strong></p>
<p>What will actually happen is that the Mac will enter an endless cycle of rebooting every time you enter your password to unlock the disk.</p>
<p>If you have done this, then the way to get out of it is to <a href="http://support.apple.com/kb/HT1379">reset your PRAM</a> like this:</p>
<p>Do a reboot, and immediately hit <strong></strong>⌥ <strong>⌘ </strong>P R together (Option + Command + P + R)<strong></strong>, and hold them down until the Mac reboots again. Now it should boot up normally.</p>
<p>If you need to perform a Safe Boot, Apple say that you should <a href="http://support.apple.com/kb/TS4235">disable FileVault 2 first</a>. (I have not tried this.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=369&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/06/01/mac-os-x-filevault-2-safe-boot-dont/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/06/filevault.png" medium="image">
			<media:title type="html">FileVault</media:title>
		</media:content>
	</item>
		<item>
		<title>Raspberry Pi</title>
		<link>http://4dc5.com/2012/05/13/raspberry-pi/</link>
		<comments>http://4dc5.com/2012/05/13/raspberry-pi/#comments</comments>
		<pubDate>Sun, 13 May 2012 08:15:33 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=361</guid>
		<description><![CDATA[I finally got hold of my first Raspberry Pi. This morning I&#8217;ve burned a Debian &#8220;squeeze&#8221; distro to the SD card, and performed an initial boot just to check that it&#8217;s working. The next step is to set up a &#8230; <a href="http://4dc5.com/2012/05/13/raspberry-pi/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=361&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://4dc5.files.wordpress.com/2012/05/raspi.png"><img class="alignright size-thumbnail wp-image-362" title="Raspberry Pi logo" src="http://4dc5.files.wordpress.com/2012/05/raspi.png?w=150&#038;h=133" alt="" width="150" height="133" /></a>I finally got hold of my first <a href="http://www.raspberrypi.org/">Raspberry Pi</a>.</p>
<p>This morning I&#8217;ve burned a <a href="http://www.raspberrypi.org/downloads">Debian &#8220;squeeze&#8221; distro</a> to the SD card, and performed an initial boot just to check that it&#8217;s working. The next step is to set up a proper development environment for experimentation. I have some ideas for projects, but most of them require some extra hardware that I don&#8217;t have to hand right now.</p>
<p style="text-align:center;"><a href="http://4dc5.files.wordpress.com/2012/05/raspberrypi.png"><img class=" wp-image-363 aligncenter" title="Raspberry Pi" src="http://4dc5.files.wordpress.com/2012/05/raspberrypi.png?w=300&#038;h=225" alt="" width="300" height="225" /></a><a href="http://4dc5.files.wordpress.com/2012/05/raspberrypibooting.png"><img class="size-medium wp-image-364 aligncenter" title="Raspberry Pi booting" src="http://4dc5.files.wordpress.com/2012/05/raspberrypibooting.png?w=300&#038;h=225" alt="" width="300" height="225" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=361&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/05/13/raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/05/raspi.png?w=150" medium="image">
			<media:title type="html">Raspberry Pi logo</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/05/raspberrypi.png?w=300" medium="image">
			<media:title type="html">Raspberry Pi</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/05/raspberrypibooting.png?w=300" medium="image">
			<media:title type="html">Raspberry Pi booting</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux VM keymaps in Mac OS</title>
		<link>http://4dc5.com/2012/05/07/linux-vm-keymaps-in-mac-os/</link>
		<comments>http://4dc5.com/2012/05/07/linux-vm-keymaps-in-mac-os/#comments</comments>
		<pubDate>Mon, 07 May 2012 10:02:03 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=353</guid>
		<description><![CDATA[Linux VMs installed on Mac OS X do not pick up the correct key mappings for some of the keys. You need to use the following xmodmap commands to correct them:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=353&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Linux VMs installed on Mac OS X do not pick up the correct key mappings for some of the keys. You need to use the following xmodmap commands to correct them:</p>
<pre class="brush: bash; title: ; notranslate">
xmodmap -e &quot;keycode 94=grave asciitilde grave asciitilde dead_grave dead_horn&quot;
xmodmap -e &quot;keycode 49=section plusminus section plusminus section plusminus&quot;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=353&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/05/07/linux-vm-keymaps-in-mac-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>
	</item>
		<item>
		<title>Blog Posts</title>
		<link>http://4dc5.com/2012/04/22/blog-posts/</link>
		<comments>http://4dc5.com/2012/04/22/blog-posts/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 16:22:55 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=346</guid>
		<description><![CDATA[I haven&#8217;t had much time lately for updating the blog. So if you&#8217;re interested, please find some that I&#8217;ve written for IPL. Subjects covered range from the use of neutrinos in financial trading, to social network analysis and smartphones. Pat &#8230; <a href="http://4dc5.com/2012/04/22/blog-posts/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=346&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://4dc5.files.wordpress.com/2012/04/xx2050.jpg"><img class="alignright size-full wp-image-347" title="xx2050" src="http://4dc5.files.wordpress.com/2012/04/xx2050.jpg?w=640" alt=""   /></a>I haven&#8217;t had much time lately for updating the blog. So if you&#8217;re interested, please find some that I&#8217;ve written for <a href="http://www.ipl.com/">IPL</a>.</p>
<p>Subjects covered range from the use of neutrinos in financial trading, to social network analysis and smartphones.</p>
<p><a href="http://blog.ipl.com/author/pat.galea/">Pat Galea&#8217;s IPL blog posts</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=346&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2012/04/22/blog-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://4dc5.files.wordpress.com/2012/04/xx2050.jpg" medium="image">
			<media:title type="html">xx2050</media:title>
		</media:content>
	</item>
		<item>
		<title>Summer Garden Party at Bletchley Park</title>
		<link>http://4dc5.com/2011/07/16/summer-garden-party-at-bletchley-park/</link>
		<comments>http://4dc5.com/2011/07/16/summer-garden-party-at-bletchley-park/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 07:12:17 +0000</pubDate>
		<dc:creator>Pat Galea</dc:creator>
				<category><![CDATA[Bletchley Park]]></category>

		<guid isPermaLink="false">http://4dc5.com/?p=327</guid>
		<description><![CDATA[I&#8217;ll be attending the Summer Garden Party at Bletchley Park on 2011-08-04, raising funds for the restoration of Block C to create a new visitors&#8217; centre. The event is being supported by Google. More information is available at Dr Black&#8217;s &#8230; <a href="http://4dc5.com/2011/07/16/summer-garden-party-at-bletchley-park/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=327&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="alignright" title="Bletchley Park" src="http://miltonkeynes.com/images/stories/keyne-eye/bletchley-park/bletchley-park-logo.png" alt="" width="250" height="57" />I&#8217;ll be attending the <a href="http://drblack.posterous.com/summer-garden-party-at-bletchley-park">Summer Garden Party at Bletchley Park</a> on 2011-08-04, raising funds for the restoration of Block C to create a new visitors&#8217; centre.</p>
<p>The event is being supported by <a href="http://google.com">Google</a>. More information is available at <a href="http://drblack.posterous.com/summer-garden-party-at-bletchley-park">Dr Black&#8217;s site</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4dc5.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4dc5.wordpress.com/327/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4dc5.com&#038;blog=15638046&#038;post=327&#038;subd=4dc5&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4dc5.com/2011/07/16/summer-garden-party-at-bletchley-park/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2c82e601d6a0f9d57d53c450b398c826?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dudegalea</media:title>
		</media:content>

		<media:content url="http://miltonkeynes.com/images/stories/keyne-eye/bletchley-park/bletchley-park-logo.png" medium="image">
			<media:title type="html">Bletchley Park</media:title>
		</media:content>
	</item>
	</channel>
</rss>
