<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Co-founder of Cactuslab. Developer of Charles Proxy, Camera+, Birdbrain and Flickruppa.</description><title>Karl von Randow</title><generator>Tumblr (3.0; @karlvr)</generator><link>http://blog.xk72.com/</link><item><title>Fix missing eth0 after changing network cards</title><description>&lt;p&gt;After changing hard drives out of one server machine into another and booting, the network interface didn’t come up correctly. eth0 didn’t exist and gave an error when I tried to start it manually using ifup eth0. At first I suspected that the correct driver module wasn’t installed because the OS had been installed on another system with a different NIC; so I verified that the correct module was installed.&lt;/p&gt;
&lt;p&gt;What in fact had happened is that udev has a feature where it remembers NICs by their MAC address and remembers which device name they’ve been assigned. So the hard drive (and the OS it contains) were running in a machine with another NIC that had been assigned to eth0, so when booted inside the new machine it assigned the new NIC to eth1. Unexpected!&lt;/p&gt;
&lt;p&gt;This would often be pretty fantastic. Many years ago when I upgraded from a 2.4 to a 2.6 kernel I had an issue where the order of network devices changed - eth0 and eth1 had swapped. This caused some frustration when remote administering the upgrade from another country on Christmas day.&lt;/p&gt;
&lt;p&gt;So you can either take what you’ve been given and change your network interface configuration to use eth1. Which wouldn’t be stupid. Or you can modify the udev rules to forget the original NIC and therefore assign eth0 to your new NIC on reboot…&lt;/p&gt;
&lt;p&gt;Edit the /etc/udev/rules.d/70-persistent-net.rules file. At or near the bottom will be lines beginning SUBSYSTEM, which declares the MAC address and the assigned device name. Comment out or delete lines for NICs you no longer have. Then either comment out or delete your current NIC (otherwise it will stay with eth1 after reboot) or simply change the device name it has been assigned to eth0. Then reboot.&lt;/p&gt;
&lt;p&gt;I had to discover this in a time critical situation - thank goodness for Google and for &lt;a href="http://www.serenux.com/2009/11/howto-fix-a-missing-eth0-adapter-after-moving-ubuntu-server-from-one-box-to-another/"&gt;this post&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.xk72.com/post/16358868588</link><guid>http://blog.xk72.com/post/16358868588</guid><pubDate>Tue, 24 Jan 2012 08:11:48 +1300</pubDate><category>linux</category><category>ubuntu</category></item><item><title>Restore the Linux console messages on boot</title><description>&lt;p&gt;When I installed Ubuntu Lucid on a physical server for the first time I was unnerved by seeing a startup progress indicator when I’m used to seeing all the console messages scrolling by. If something is taking a long time, I want to see what it is. I know you can switch to VT-7, but I want them back on the main screen where they’re easy to see (and easy for someone else to see if I’m calling on the phone in an emergency).&lt;/p&gt;
&lt;p&gt;It’s of course a simple configuration change.&lt;/p&gt;
&lt;p&gt;Edit /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT. For the progress indicator it’s set to “quiet splash”. For the console messages just change that to “”. &lt;a href="http://askubuntu.com/questions/248/how-can-i-show-or-hide-boot-messages-when-ubuntu-starts"&gt;Source&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.xk72.com/post/16302434280</link><guid>http://blog.xk72.com/post/16302434280</guid><pubDate>Tue, 24 Jan 2012 07:59:12 +1300</pubDate><category>ubuntu</category><category>linux</category></item><item><title>Installing 32 bit PostgreSQL on 64 bit Linux</title><description>&lt;p&gt;During an emergency server upgrade last week I was faced with a problem. I’d installed 64 bit Linux to replace a 32 bit Linux box, copied across the PostgreSQL data directory, then installed the identical version of PostgreSQL, but 64 bit. It turns out that the data file format is incompatible between 32 and 64 bit PostgreSQL.&lt;/p&gt;
&lt;p&gt;PostgreSQL is my favourite RDBMS, but it’s worth noting that MySQL had no such problem and automatically updated the data files. Thanks MySQL!&lt;/p&gt;
&lt;p&gt;The 32 bit server install was dead, so I couldn’t do a dump from the 32 bit system. I needed to install 32 bit PostgreSQL on my 64 bit box.&lt;/p&gt;
&lt;p&gt;First you need to install &lt;span class="comment-copy"&gt; ia32-libs using apt-get install. This gets you the base libraries necessary to run 32 bit apps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="comment-copy"&gt;Then you need to manually download the 32 bit .deb files for PostgreSQL. You’ll find them under /ubuntu/pool/main/p/ in your local Ubuntu archive. Try doing an install of PostgreSQL as per normal to see which packages are required. The postgresql-common packages are architecture independent so you can install those using apt-get.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="comment-copy"&gt;After you’ve downloaded the .deb files you must install them using dpkg -i —force-architecture &lt;debs&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="comment-copy"&gt;After doing this I was able to start PostgreSQL. It said it failed during startup! But it did actually start. I wasn’t able to use psql, as the libreadline library wasn’t 32 bit, but I was able to use pg_dump, which was the critical bit.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="comment-copy"&gt;Once I’d dumped the databases I quickly uninstalled the 32 bit PostgreSQL, moved the data directory and installed the 64 bit version and sat through the lengthy reload.&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;</description><link>http://blog.xk72.com/post/16304648626</link><guid>http://blog.xk72.com/post/16304648626</guid><pubDate>Tue, 24 Jan 2012 07:58:52 +1300</pubDate><category>postgresql</category><category>linux</category><category>ubuntu</category></item><item><title>Charles 3.6.5 released</title><description>&lt;p&gt;&lt;a href="http://www.charlesproxy.com/download/"&gt;Charles 3.6.5&lt;/a&gt; was released earlier today. It’s primarily a bug fix release.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;For Java 1.7 a number of incompatibilities were fixed including a delay during startup and hung network connections.&lt;/li&gt;
&lt;li&gt;Fixes for a networking regression in 3.6.4 - an improvement to the networking caused an irregular Connection reset (or similar) error to occur when browsing.&lt;/li&gt;
&lt;li&gt;SSL behaviour improved including better error messages in the browser and fixing a regression in 3.6.4 that caused empty requests to appear.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The next version of Charles will be 3.7 and will include more advanced timing of DNS lookups, TCP connections and SSL handshakes, as well as improved kept-alive connection reporting so you can see when new HTTP connections are established. The &lt;a href="http://www.charlesproxy.com/download/beta/"&gt;first beta of 3.7&lt;/a&gt; is available today. &lt;/p&gt;</description><link>http://blog.xk72.com/post/13912410073</link><guid>http://blog.xk72.com/post/13912410073</guid><pubDate>Thu, 08 Dec 2011 19:28:00 +1300</pubDate><category>charles</category></item><item><title>Recovering lost Git commits</title><description>&lt;p&gt;If you rollback to a previous commit you can lose the later commits if they’re not referenced by another branch. I just rolled back and lost a commit that I hadn’t pushed to the remote.&lt;/p&gt;
&lt;p&gt;Easy fix.&lt;/p&gt;
&lt;pre&gt;git reflog&lt;/pre&gt;
&lt;p&gt;This will show you recent commits, and should include the commit that you’ve just lost. You can then merge it back in.&lt;/p&gt;</description><link>http://blog.xk72.com/post/13866787745</link><guid>http://blog.xk72.com/post/13866787745</guid><pubDate>Wed, 07 Dec 2011 21:32:35 +1300</pubDate><category>git</category></item><item><title>Migrating from SVN to Git</title><description>&lt;p&gt;I’ve migrated several projects from SVN to Git in the last couple of weeks. In doing so I’ve worked out a little process that has seen me right in preserving all of the history. This process relies on the git-svn tool, which you may need to install as a separate package.&lt;/p&gt;
&lt;p&gt;1) Create an authors.txt file. This is a file that maps the SVN usernames to the more verbose Git author names. I suggest starting with an empty file and adding to as errors crop up due to missing authors during the import. Alternatively you may be more organised.&lt;/p&gt;
&lt;p&gt;Your authors.txt file will look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;username = Full Name &lt;email@example.com&gt;&lt;br/&gt;username2 = Full Name &lt;email@example.com&gt;&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;2) Import the SVN repository into a new Git repository. Note that this command references the authors.txt file you created in step 1, it includes the username (if any) you require to access the SVN repository, the URL to the repository and the directory to create the new Git repository in. This also assumes that you use a standard trunk, branches, tags layout (if not, omit the -s), and that your URL will be the root of the repository (ie. the directory containing trunk). At any stage consider typing “git svn help” to get assistance.&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;&lt;span&gt;git svn -s --authors-file=authors.txt --prefix=svn/ --username=&lt;em&gt;svn_username&lt;/em&gt; \&lt;br/&gt;clone &lt;em&gt;https://url/path/to/svn/repo/ directory-for-git-repo&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;This process will take a while. It will fail with an error if it encounters a username that isn’t in your authors.txt file. Add the author and then re-run the command; it will continue from where it left off.&lt;/p&gt;
&lt;p&gt;Once it’s complete, consider running it again just in case. My first attempt said it was finished and it wasn’t.&lt;/p&gt;
&lt;p&gt;You now have a working Git repository. The SVN repository is hooked up as a remote and all of its branches and tags are prefixed with svn/, which makes them easy to find. The next step is to turn the SVN branches and tags into local Git branches and tags to complete the import.&lt;/p&gt;
&lt;p&gt;3) Make local branches for each remote SVN branch. When we do the import we specify that all of the SVN branches go into the prefix svn/. I wrote a brief shell script to perform this step; all it does is to list the remote svn branches (omitting the tags and trunk), and then checkout each one-at-a-time to a local branch.&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;cd &lt;em&gt;directory-for-git-repo&lt;/em&gt;&lt;br/&gt;for i in `git branch -r --no-color | grep 'svn/' | grep -v 'svn/tags/' | grep -v 'svn/trunk' `&lt;br/&gt;do echo $i&lt;br/&gt;    git checkout -b `echo $i | sed -e 's|svn/||'` $i&lt;br/&gt;done&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;4) Make local tags for each remote SVN tag. SVN tags are imported as remote branches, so as for the branches, we run a short script to create local Git tags for each SVN tag.&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;for i in `git branch -r --no-color | grep 'svn/tags/' | sed -e 's|svn/tags/||'`&lt;br/&gt;do echo $i&lt;br/&gt;    git checkout -b tag_branch svn/tags/$i&lt;br/&gt;    git checkout master&lt;br/&gt;    git tag `echo $i | sed -e 's|svn/||'` tag_branch&lt;br/&gt;    git branch -D tag_branch&lt;br/&gt;done&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;5) Make the master branch from the SVN trunk. I found that my master branch was a superset of every other branch after the git svn import, so in this step we rename the existing master branch, create a new one, and then delete the old one.&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;git branch -m master oldmaster&lt;br/&gt;git checkout -b master svn/trunk&lt;br/&gt;git branch -D oldmaster&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;And that completes my import process. The next step is probably to clone the repository, or possibly to push it to its new host. Cloning gets rid of all of the git svn configuration and remote branches and leaves you with a clean Git repository.&lt;/p&gt;</description><link>http://blog.xk72.com/post/13541204862</link><guid>http://blog.xk72.com/post/13541204862</guid><pubDate>Wed, 30 Nov 2011 23:13:00 +1300</pubDate><category>git</category></item><item><title>EGit fails to import an existing Git working copy</title><description>&lt;p&gt;I used another Git tool to clone my git repository into my development directory, which is also my workspace directory in Eclipse. I then wanted to add this working copy as a project in Eclipse; it has a .project file as it’s already an Eclipse project (previously in an SVN repository).&lt;/p&gt;
&lt;p&gt;Using the File &gt; Import menu option and choosing Projects from Git, I was able to add my Git repository (which is inside the working copy), but when I go through to import existing projects it fails with an error:&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;Invalid project description.&lt;br/&gt;/Users/karlvr/Development/projectname overlaps the location of another project: 'project name'&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;This turns out to be because importing projects from Git wants to make a new working copy in your workspace, much like with SVN where the wording was more obvious to me “Checkout Projects from SVN”&lt;/p&gt;
&lt;p&gt;What I actually wanted to do, and what worked, was to import the project as an existing project and then activate it with Git. To do this, choose File &gt; Import, then Existing Projects into Workspace. Choose your project directory, probably already located in your workspace, and import it. Right-click on the imported project in the Project Explorer and choose Team &gt; Share Project. Choose Git as the repository type, then in the Configure Git Repository dialog choose “Use or create repository in parent folder of project”. EGit will find the .git folder at the root of your project and your project will now be in Eclipse and setup for EGit.&lt;/p&gt;</description><link>http://blog.xk72.com/post/13540784315</link><guid>http://blog.xk72.com/post/13540784315</guid><pubDate>Wed, 30 Nov 2011 22:44:38 +1300</pubDate><category>Eclipse</category><category>git</category></item><item><title>Optimising images / Optimizing images</title><description>&lt;p&gt;Tomato tomato. If you’re putting images into an application, especially a mobile application, or on the web, or anywhere, it’s a good idea to optimise them before you deploy. In an iOS application the larger your application is the longer it takes to download and install. If you go over the magic 20MB limit, users aren’t even allowed to download it over 3G; they have to seek out a WiFi network. This doesn’t feel like it would be good for sales.&lt;/p&gt;
&lt;p&gt;Xcode runs &lt;a href="http://pmt.sourceforge.net/pngcrush/" target="_blank"&gt;pngcrush&lt;/a&gt; on your PNG files, which does an okay job. It doesn’t touch the JPGs, and overall it turns out you can do better.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="http://imageoptim.pornel.net/" target="_blank"&gt;ImageOptim&lt;/a&gt;. A free Mac OS X app (unfortunately not available via the Mac App Store due to licensing) that combines a series of command-line image optimisation tools; runs them all and chooses the best optimisation for each image. It also finds images recursively in folders, so I dragged and dropped the root Images folder to do a whole application.&lt;/p&gt;
&lt;p&gt;The optimisations are lossless, so it doesn’t downgrade the quality of your images (this is something you should also experiment with separately, especially JPEG quality). The tools remove metadata and other information that you don’t need; they can also recompress or optimise the compression to gain a few more bytes.&lt;/p&gt;
&lt;p&gt;There’s one extra optimisation tool that ImageOptim can use but isn’t bundled: PNGOUT. There are instructions for downloading PNGOUT on the ImageOptim webpage. I recommend getting it and configuring the path to it in the ImageOptim preferences; it often got the best results on my PNGs.&lt;/p&gt;
&lt;p&gt;Thanks to Corwin Derkatch for putting me on to ImageOptim.&lt;/p&gt;</description><link>http://blog.xk72.com/post/13314004519</link><guid>http://blog.xk72.com/post/13314004519</guid><pubDate>Sat, 26 Nov 2011 10:30:00 +1300</pubDate><category>iOS</category><category>Mac OS X</category></item><item><title>The coolest thing ever</title><description>&lt;p&gt;It’s fair to say that when you enter the office, it is criminal not to have a short intro theme blasted out on the stereo for all to enjoy. What an entrance. It sets the tone. It sets the mood. And the ladies love it.&lt;/p&gt;
&lt;p&gt;Fortunately, thanks to a confluence of technology, we blew this case wide open last week at Cactuslab. We now have the DHCP server running a script when known devices join the network which plays personalised MP3 files via the Airport Express to the office stereo at ear-popping volume. When you walk into the office with your WiFi device in your pocket… boom.&lt;/p&gt;
&lt;p&gt;The first piece of the puzzle is integrating with the DHCP server. I run our office’s DHCP server on a Linux server, and it turns out to be quite easy to &lt;a href="http://jpmens.net/2011/07/06/execute-a-script-when-isc-dhcp-hands-out-a-new-lease/" target="_blank"&gt;execute a script when the DHCP server hands out a new lease&lt;/a&gt;. The DHCP server executes a shell script, which takes as an argument the hardware address of the new device.&lt;/p&gt;
&lt;pre&gt;on commit {
    set clip = binary-to-ascii(10, 8, ".", leased-address);
    set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
    execute("/usr/local/sbin/dhcpevent", "commit", clip, clhw);
}
&lt;/pre&gt;
&lt;p&gt;The script looks for an MP3 file matching the hardware address in a folder on the file server. If an MP3 is found the script attempts to play it on the office stereo using &lt;a href="http://raop-play.sourceforge.net/" target="_blank"&gt;raop_play&lt;/a&gt;, which connects to the Airport Express via AirPlay. Bob’s your uncle.&lt;/p&gt;
&lt;pre&gt;#!/bin/sh

HARDWARE=`echo "$3" | sed -e 's/:/-/g'`
INTROSDIR=/data/cactuslab/share/intros
AIRPORT_EXPRESS="10.1.10.135"

INTRO="$INTROSDIR/$HARDWARE.mp3"
if [ -f $INTRO ]; then
	raop_play $AIRPORT_EXPRESS $INTRO &amp;
fi
&lt;/pre&gt;
&lt;p&gt;There are a few problems with this setup. Most annoyingly, if someone is already playing something on the stereo then your intro can’t play. We’re resolving this issue by adding a second, dedicated, Airport Express. The two Airport Expresses will run through a mixer. I think we’ll set the mix on the intros Express slightly higher, you know, so you can really feel it. I’ll update on the success of this later.&lt;/p&gt;
&lt;p&gt;The biggest problem, however, is that it takes a while for your iPhone to jump onto the WiFi network. So sometimes it’s less of an intro and more of a reminder that you’ve already arrived. It’s still pretty cool. I have a feeling there’s a déjà vu issue when a device rejoins the network… but that could be changed with some more clever scripting.&lt;/p&gt;
&lt;p&gt;I recommend keeping the intros to about 15 seconds and adding a fade-out to the end of the MP3.&lt;/p&gt;
&lt;p&gt;Keep it classy, and please let me know if you attempt this!&lt;/p&gt;</description><link>http://blog.xk72.com/post/13313246225</link><guid>http://blog.xk72.com/post/13313246225</guid><pubDate>Sat, 26 Nov 2011 10:13:08 +1300</pubDate><category>Cactuslab</category></item><item><title>Charles 3.6.4</title><description>&lt;p&gt;Charles 3.6.4 was released this week. It includes a number of bug fixes which are outlined in the &lt;a href="http://www.charlesproxy.com/documentation/version-history/" target="_blank"&gt;version history&lt;/a&gt;. If you had trouble with Charles sometimes starting with a blank window, or freezing while using breakpoints, this might be the bug fix release for you. If you are interested in the HAR import/export capabilities, this is definitely the release for you.&lt;/p&gt;
&lt;p&gt;I also want to draw attention to the PCAP import. You can capture traffic in a tool, such as Wireshark, and then save that traffic in a .pcap file and then import it into Charles. Charles analyses the HTTP traffic and pieces it back together as if Charles had been there to intercept it. This can be an option for capturing and analysing traffic in Charles when you can’t get an application to directly use Charles. Aside from bug fixes, Charles 3.6.4 also improves the PCAP import - ensuring that keep-alive requests and imported and putting things in the right order.&lt;/p&gt;
&lt;p&gt;The other thing I want to highlight is Linux support. Charles has supported Linux since very early on in its life, but it’s never done a particularly good job at installing and running nicely as part of a Linux desktop. This is no doubt my fault as the vast majority of my Linux boxes are command-line only. Charles 3.6.4 features an improved start script for Linux, bigger icons, and most excitingly an APT package for Debian-based Linux distributions. I’ve particularly tested it on Ubuntu: the package installs Charles into your applications menus, and the package makes the process of getting new versions of Charles much easier. If you’re a Linux user who can’t use APT packages, get in touch and we’ll see if we can make other package types!&lt;/p&gt;
&lt;p&gt;The next release of Charles is going to include more bug fixes and minor enhancements; I’m particularly focussing on fixing a few issues around Java 1.7 so if you’re having trouble with 1.7 please get in touch and try the &lt;a href="http://www.charlesproxy.com/beta/" target="_blank"&gt;latest beta&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.xk72.com/post/12876268499</link><guid>http://blog.xk72.com/post/12876268499</guid><pubDate>Wed, 16 Nov 2011 22:21:00 +1300</pubDate><category>charles</category></item><item><title>Charles 3.6.4 and HAR (HTTP Archive)</title><description>&lt;p&gt;Charles 3.6.4 is another minor update to the 3.6 release; it features a large number of bug fixes, including several improvements to the HAR import/export implementation. We introduced HAR import/export to Charles 3.6 and it has just gotten better (or really, in the case of the bugs, less broken). Thanks to everyone who has corresponded with me about particular issues (especially Alex Selivanov).&lt;/p&gt;
&lt;p&gt;HAR is an archive format for HTTP requests and responses for interoperability between software packages. Adding HAR support to Charles makes it possible to capture requests in another application and import them into Charles for analysis, or to capture in Charles and export.&lt;/p&gt;
&lt;p&gt;I’m on the lookout for interesting analysis applications that import HAR files… drop me an email if you have any you use.&lt;/p&gt;</description><link>http://blog.xk72.com/post/12876125698</link><guid>http://blog.xk72.com/post/12876125698</guid><pubDate>Wed, 16 Nov 2011 22:12:05 +1300</pubDate><category>charles</category></item><item><title>Fix a sticky iPhone home button</title><description>&lt;p&gt;I’ve had a sticky home button on my old iPhone 4 for many months. It wouldn’t consistently double-tap to bring up the multitasking menu, and it caused me to develop a deadly pincer-grip that made my new 4S squeal.&lt;/p&gt;
&lt;p&gt;Yesterday, by chance, I saw my friend Tim Haines tweet about taking his wife’s iPhone into an Apple Store, where the genius went mad on the home button with an alcohol wipe. This afternoon I went to the chemist and purchased four alcohol wipes (skin cleansing alcohol wipes) that come in little paper sachets. I took one, and wiped as hard as I could on and around the home button, being sure to press it hard and long, rolling around on the button, letting the alcohol from the wipe seep into the cracks. Continue for 30 seconds.&lt;/p&gt;
&lt;p&gt;Happily, it seems to have worked. I can now double-tap the home button consistently, and at NZ$0.20 a wipe I think it’s a no-brainer.&lt;/p&gt;</description><link>http://blog.xk72.com/post/12765375849</link><guid>http://blog.xk72.com/post/12765375849</guid><pubDate>Mon, 14 Nov 2011 13:47:00 +1300</pubDate><category>iPhone</category><category>iOS</category></item><item><title>High bandwidth high latency performance tuning</title><description>&lt;p&gt;We recently upgraded our office Internet connection to 20Mbps fibre. Interestingly, for local traffic we were seeing excellent speeds, but international connections were disappointing (1 - 3 Mbps).&lt;/p&gt;
&lt;p&gt;In NZ we have quite a high ping to the US (where we’re primarily connecting to), and this requires a high TCP window size to be able to have sufficient data in the pipe to take advantage of the full capacity.&lt;/p&gt;
&lt;p&gt;Our office has both Mac OS X machines and Windows 7 machines. I’ve been unable to solve the issue on the Windows 7 machines, they are currently capped at 1 Mbps.&lt;/p&gt;
&lt;p&gt;For Mac OS X machines it’s easy to change the appropriate parameters temporarily.&lt;/p&gt;
&lt;p&gt;First your need to calculate the appropriate value for your TCP window. Take your network speed in Mbps (eg. 20Mbps) and your typical round-trip-time in seconds (eg. 0.3s) and multiply them then divide by 8 (eg. 20,000,000 * 0.3 / 8) to get a reasonable TCP buffer size. For my example this is 750,000 which is substantially more than the default 65,536.&lt;/p&gt;
&lt;p&gt;Try this in the Terminal (substituting your TCP window size from the calculations above):&lt;/p&gt;
&lt;pre&gt;sudo sysctl -w net.inet.tcp.sendspace=750000
sudo sysctl -w net.inet.tcp.recvspace=750000&lt;/pre&gt;
&lt;p&gt;Test it to see if you can notice a difference. We could particularly see the difference in uploads. Then to permanently enable it, edit (or create) /etc/sysctl.conf (you’ll need to sudo this) and append:&lt;/p&gt;
&lt;pre&gt;net.inet.tcp.sendspace=750000&lt;br/&gt;net.inet.tcp.recvspace=750000&lt;/pre&gt;
&lt;p&gt;Thanks to Layton Duncan for confirming this was possible on Mac OS X when I was losing faith on Windows 7.&lt;/p&gt;
&lt;p&gt;I’m still looking for how to solve this issue on Windows 7. Suggestions welcome.&lt;/p&gt;
&lt;p&gt;For reference reading:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.psc.edu/networking/projects/tcptune/"&gt;&lt;a href="http://www.psc.edu/networking/projects/tcptune/"&gt;http://www.psc.edu/networking/projects/tcptune/&lt;/a&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.speedguide.net/"&gt;&lt;a href="http://www.speedguide.net/"&gt;http://www.speedguide.net/&lt;/a&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For bandwidth testing I used iperf on Linux, Windows and Mac OS X (jperf).&lt;/p&gt;</description><link>http://blog.xk72.com/post/12755223533</link><guid>http://blog.xk72.com/post/12755223533</guid><pubDate>Mon, 14 Nov 2011 10:29:00 +1300</pubDate><category>networking</category></item><item><title>iOS 5: turn off multiple message reminders</title><description>&lt;p&gt;When I hear my phone beep I read the message on the lock screen and then put it back in my pocket. I don’t need it to beep again. After upgrading to iOS 5 it’s a bit harder to find where to turn the multiple message reminders off.&lt;/p&gt;
&lt;p&gt;To turn off multiple message reminders (iMessage) on iOS 5 open the Settings app. Choose Notifications. Scroll down and choose Messages. Scroll down and choose the Repeat Alert setting. Change this according to your attention level.&lt;/p&gt;</description><link>http://blog.xk72.com/post/12656151788</link><guid>http://blog.xk72.com/post/12656151788</guid><pubDate>Sat, 12 Nov 2011 10:35:18 +1300</pubDate><category>iPhone</category><category>iOS</category></item><item><title>New blog</title><description>&lt;p&gt;I’ve consolidated my old blog and my oldest blog into one new blog. I may post more often. I’ll definitely, maybe, post Charles Proxy release notes. I’ll sometimes post tips and tricks so that I can find them again.&lt;/p&gt;</description><link>http://blog.xk72.com/post/12100861132</link><guid>http://blog.xk72.com/post/12100861132</guid><pubDate>Sun, 30 Oct 2011 15:52:00 +1300</pubDate></item><item><title>Debugging Core Data SQL on iOS</title><description>&lt;p&gt;You can pass a launch argument to your application from Xcode to enable debugging of SQL statements and Core Data timing to the console log.&lt;/p&gt;
&lt;p&gt;In Xcode 4, edit your Schemes. Go to the Run phase, Arguments tab, and in the Arguments Passed On Launch area add:&lt;br/&gt; -com.apple.CoreData.SQLDebug 1&lt;/p&gt;
&lt;p&gt;You can tick this on and off as you like so you don’t have to delete it and won’t have to remember it!&lt;/p&gt;</description><link>http://blog.xk72.com/post/12099568852</link><guid>http://blog.xk72.com/post/12099568852</guid><pubDate>Wed, 27 Jul 2011 14:16:00 +1200</pubDate><category>iOS</category></item><item><title>Italy</title><description>&lt;a href="http://www.blurb.com/books/2147830"&gt;Italy&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://joshuabrown.tumblr.com/post/5144688803/italy"&gt;joshuabrown&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Check out the book I just published of my recent trip out to Italy. Every photo was shot on the iPhone 4 using Camera+. Get it here http://campl.us/&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.xk72.com/post/12099569384</link><guid>http://blog.xk72.com/post/12099569384</guid><pubDate>Wed, 04 May 2011 11:26:00 +1200</pubDate><category>Camera+</category></item><item><title>PostgreSQL sizes of tables</title><description>&lt;p&gt;select tablename, pg_size_pretty(pg_relation_size(tablename)) as data, pg_size_pretty(pg_total_relation_size(tablename)) as total from (select tablename from pg_tables where schemaname = current_schema()) as foo order by pg_total_relation_size(tablename) desc;&lt;/p&gt;</description><link>http://blog.xk72.com/post/12099569725</link><guid>http://blog.xk72.com/post/12099569725</guid><pubDate>Tue, 08 Mar 2011 12:38:00 +1300</pubDate><category>PostgreSQL</category></item><item><title>Flickruppa • iPhoto export to Flickr. Simplified.</title><description>&lt;a href="http://flickruppa.com/"&gt;Flickruppa • iPhoto export to Flickr. Simplified.&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://www.dontcom.com/post/1517986602/flickruppa-o-iphoto-export-to-flickr-simplified"&gt;darren131&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you use iPhoto 8+ and Flickr then you should check out this awesome plugin.  Allows for simple export from iPhoto to Flickr (including EXIF, background uploading, GPS location, videos, sets, etc, etc, etc…) Brought to you by the same madman who built &lt;a href="http://www.charlesproxy.com/"&gt;Charles&lt;/a&gt;, &lt;a href="http://birdbrainapp.com/"&gt;Birdbrain&lt;/a&gt;, &lt;a href="http://mobilefotosapp.com/"&gt;Mobile Fotos&lt;/a&gt;, etc&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.xk72.com/post/12099570047</link><guid>http://blog.xk72.com/post/12099570047</guid><pubDate>Wed, 10 Nov 2010 14:52:00 +1300</pubDate><category>flickruppa</category></item><item><title>Simulate memory warnings on the iPhone</title><description>&lt;p&gt;When debugging on the simulator you can simulate a memory warning in your code by using the &lt;strong&gt;Simulate Memory Warning&lt;/strong&gt; option in the &lt;strong&gt;Hardware&lt;/strong&gt; menu. But on the device it isn’t so easy, but it’s really important to have thoroughly tested your application in the presence of memory warnings.&lt;/p&gt;
&lt;p&gt;What I do is add some code to my App Delegate to periodically send a memory warning automatically. Usually every 5 seconds, or quicker.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- (BOOL)application:(UIApplication *)pApplication didFinishLaunchingWithOptions:(NSDictionary *)pLaunchOptions {
...
    [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(simulateMemoryWarning) userInfo:nil repeats:YES];
...
}

- (void)simulateMemoryWarning {
    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object:[UIApplication sharedApplication] userInfo:nil];
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I suggest surrounding the timer scheduling with an #if DEBUG or similar (assuming you have DEBUG=1 configured in your debug builds) so you don’t accidentally leave this in for a release build!&lt;/p&gt;</description><link>http://blog.xk72.com/post/12099570811</link><guid>http://blog.xk72.com/post/12099570811</guid><pubDate>Sun, 07 Nov 2010 11:46:00 +1300</pubDate><category>iOS</category></item></channel></rss>

