<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Christopher Camps</title><generator>Tumblr (3.0; @chriscamps)</generator><link>http://tumblr.christophercamps.com/</link><item><title>iPad HTML5 Video mime problem</title><description>&lt;p&gt;I know. You have been beating your keyboard against your desk for hours getting that html5 video embed test working in MobileSafari on the iPad. You must have melted a small glacier re-encoding with every combination of container, encoding, and bitrate!&lt;/p&gt;

&lt;p&gt;You checked and double checked your video tag. (You made sure to close the &lt;code&gt;&lt;/video&gt;&lt;/code&gt; and &lt;code&gt;&lt;/source&gt;&lt;/code&gt; tags right? Of course you did. You’re a professional after all.)&lt;/p&gt;

&lt;p&gt;I know what the problem is. But I’m not going to tell you. Ok, ok, I’ll tell you, but only because I like you and I don’t want you to get fired.&lt;/p&gt;

&lt;h1&gt;Surprise! It’s your web server’s &lt;code&gt;Content-Type&lt;/code&gt; header!&lt;/h1&gt;

&lt;p&gt;For some weird reason, browsers will disregard the mime type you explicitly wrote in the &lt;code&gt;&lt;source type="video/mp4"/&gt;&lt;/code&gt; tag, and instead choose to trust the mime type coming from the server. For example, older IIS servers treat .mp4 files as &lt;code&gt;application/octet-stream&lt;/code&gt; which seems ok to me, but simply did not fly with iPad.&lt;/p&gt;

&lt;p&gt;Now how do you change your web server’s mime map? That’s between you and Google, buddy.&lt;/p&gt;</description><link>http://tumblr.christophercamps.com/post/727124335</link><guid>http://tumblr.christophercamps.com/post/727124335</guid><pubDate>Tue, 22 Jun 2010 17:19:04 -0700</pubDate><category>html5</category><category>iPad</category></item><item><title>Turn your mac into a Pandora alarm clock</title><description>&lt;p&gt;Here’s a tutorial for anyone wanting to turn their fancy new $2000 Mac into a $19.99 clock radio.&lt;/p&gt;

&lt;p&gt;We’re going to use AppleScript, iCal, and the awesome &lt;a title="pandoraboy" target="_blank" href="http://code.google.com/p/pandoraboy/"&gt;PandoraBoy&lt;/a&gt; to get everything working. I thought this would be clunky at first but it’s actually really nice and flexible if you break things up the way I’m about to show you.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;!--&lt;img src="http://media.tumblr.com/tumblr_l22b2zVi4j1qbvvyf.png" /&gt;--&gt;

&lt;p&gt;Open up your AppleScript Editor and create the following three files:&lt;/p&gt;

&lt;h3&gt;Mute.scpt&lt;/h3&gt;

&lt;pre&gt;&lt;code class="applescript"&gt;set volume with output muted
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This does exactly what you think it does, mutes the mac.&lt;/p&gt;

&lt;h3&gt;Unmute.scpt&lt;/h3&gt;

&lt;pre&gt;&lt;code class="applescript"&gt;set volume without output muted
set volume 1.3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can change the 1.3 to anything between 0 and 7. Play some music and click the run button in AppleScript Editor to fine tune this.&lt;/p&gt;

&lt;h3&gt;PlayPandora.scpt&lt;/h3&gt;

&lt;pre&gt;&lt;code class="applescript"&gt;tell application "PandoraBoy"
	activate

	repeat 10 times
		try
			set current station to station 1
			exit repeat
		on error
			delay 10
		end try
	end repeat

	if player state is not "playing" then
		playpause
	end if

end tell
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This one is a bit more complicated. First we tell PandoraBoy.app to start if it’s not already running. The problem is that it take a while to initialize, and it’s unresponsive to scripts during that time. Basically we attempt to change the station, and if it fails we wait 10 seconds and try again, x10. You can change the station number to whatever station you want (1, 2, 3, etc).&lt;/p&gt;

&lt;h3&gt;iCal&lt;/h3&gt;

&lt;p&gt;After you’ve created, tested, and saved these scripts somewhere, open up iCal to make the magic happen.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_l22b6fTdIC1qbvvyf.png"/&gt;&lt;/p&gt;

&lt;h3&gt;How to attach your script to an event in iCal&lt;/h3&gt;

&lt;img style="float:right" src="http://media.tumblr.com/tumblr_l2d6zqTARE1qbvvyf.png"/&gt;&lt;p&gt;It’s really pretty easy once you have the scripts written. Just create an event anywhere, and double click it to change its properties. Click on &lt;b&gt;alarm&lt;/b&gt; and pick &lt;b&gt;Run Script&lt;/b&gt;. Choose &lt;b&gt;Other…&lt;/b&gt; and go find where you saved the script. Then change it to &lt;b&gt;0 minutes before&lt;/b&gt;. That’s it, when that time comes around, the script you chose will run.&lt;/p&gt;

&lt;p&gt;The nice thing about this now is that you can just drag that event around anywhere you want. You can duplicate it. You can make it repeat every day or just on weekdays. The script will still run.&lt;/p&gt;

&lt;p&gt;As a baseline, start with two events every day, Mute.scpt when you go to sleep, and Unmute.scpt right before you wake up.&lt;/p&gt;

&lt;p&gt;Create a third event to run PlayPandora.scpt only on weekdays, or only days you have work or school. It’s flexible!&lt;/p&gt;

&lt;p&gt;It’s great to not get woken up by an alarm on your day off, or to be able to quickly delete the alarm on upcoming holidays.&lt;/p&gt;

&lt;p&gt;Not to mention waking up to awesome music!&lt;/p&gt;

&lt;h3&gt;Notes&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This will not work if you put your mac to sleep at night. I know, it’s annoying. You can force your computer to wake on a schedule by going to &lt;b&gt;System Preferences &gt; Energy Saver &gt; Schedule…&lt;/b&gt; I just turn off the display with &lt;code&gt;&lt;b&gt;control+shift+eject&lt;/b&gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pandora will stop playing music after 1 hour and ask you if you’re still listening.&lt;/li&gt;
&lt;li&gt;If your internet connection happens to be down, you won’t get any music.&lt;/li&gt;
&lt;li&gt;You &lt;i&gt;will&lt;/i&gt; forget to unplug your headphones one day and miss your appointment. I take absolutely no responsibility for this!&lt;/li&gt;
&lt;li&gt;You will still have to make your own coffee.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Have fun!&lt;/p&gt;</description><link>http://tumblr.christophercamps.com/post/595538127</link><guid>http://tumblr.christophercamps.com/post/595538127</guid><pubDate>Thu, 13 May 2010 09:11:00 -0700</pubDate><category>pandora</category><category>applescript</category><category>tutorials</category><category>mac</category></item><item><title>How to kill an unresponsive ssh session</title><description>&lt;a href="http://www.laszlo.nu/post/553591402/how-to-kill-an-unresponsive-ssh-session"&gt;How to kill an unresponsive ssh session&lt;/a&gt;: &lt;p&gt;I love stumbling on clean solutions to little annoyances I deal with regularly. Anyone who uses ssh on a regular basis definitely knows how this story goes.&lt;/p&gt;

&lt;p&gt;You have all your terminal windows/tabs arranged exactly how you like them. Then BOOM, one of your ssh sessions hangs, making that entire window unusable. &lt;code&gt;&lt;CTRL&gt;-C&lt;/code&gt; you say? Hah hah, I laugh ironically at your feeble term-fu. You have to either wait for the ssh process to properly die, or kill it manually from another session.&lt;/p&gt;

&lt;h2&gt;&lt;code&gt;&lt;RETURN&gt;~.&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;No more! Just hit &lt;code&gt;&lt;RETURN&gt;~.&lt;/code&gt; and ssh dies faster than Samuel Jackson in an underwater shark research facility.&lt;/p&gt;

&lt;p&gt;Thanks Laszlo!&lt;/p&gt;</description><link>http://tumblr.christophercamps.com/post/555405272</link><guid>http://tumblr.christophercamps.com/post/555405272</guid><pubDate>Wed, 28 Apr 2010 00:28:00 -0700</pubDate><category>terminal</category><category>tips</category></item><item><title>How to avoid accidentally zooming in Firefox with the mouse wheel</title><description>&lt;p&gt;I got an &lt;a href="http://www.amazon.com/gp/product/B002TLTGM6?ie=UTF8&amp;tag=chriscamps-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B002TLTGM6"&gt;Apple Magic Mouse&lt;/a&gt;&lt;img src="http://www.assoc-amazon.comx/e/ir?t=chriscamps-20&amp;l=as2&amp;o=1&amp;a=B002TLTGM6" border="0" height="1" width="1"/&gt; recently and overall it’s quite nice. The momentum scrolling is an important evolution.&lt;/p&gt;

&lt;p&gt;The momentum sometimes has side effects in apps that are not expecting it though. Firefox is one of these apps.&lt;/p&gt;

&lt;p&gt;I tend to browse with many tabs open, and I like to switch between open tabs with control+tab and control+shift+tab (on mac).&lt;/p&gt;

&lt;p&gt;The problem occurs when you flick your finger to scroll down a site and then immediately switch to another open tab with control+tab. By default, Firefox is set to “zoom” the site you’re on with control+mousewheel. Because of the momentum, Firefox still sees the mousewheel event when you press down control, and therefore starts zooming one or both of your tabs in catastrophic ways.&lt;/p&gt;

&lt;p&gt;You can easily reset the zooming of a site by just hitting command-0 (zero), but it’s still annoying, and it happens more often than you would think.&lt;/p&gt;

&lt;p&gt;Here’s how to disable the control+mousewheel zoom once and for all:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a new tab and enter about:config into the address bar. &lt;/li&gt;
&lt;li&gt;Enter “mousewheel” in the filter textbox &lt;/li&gt;
&lt;li&gt;Look for any &lt;code&gt;&lt;a href="http://kb.mozillazine.org/About:config_entries#Mousewheel."&gt;mousewheel.&lt;/a&gt;withXXXXXkey.action&lt;/code&gt; that has a value of 3 (3=zoom) &lt;/li&gt;
&lt;li&gt;Double click the 3 and change it to 0 (0=no action) &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That’s it! No more inadvertent zooming. You can always set it back to default by right clicking the line you changed in about:config and choosing “reset.”&lt;/p&gt;

&lt;p&gt;Don’t live with tiny annoyances, they add up.&lt;/p&gt;</description><link>http://tumblr.christophercamps.com/post/577747957</link><guid>http://tumblr.christophercamps.com/post/577747957</guid><pubDate>Wed, 10 Mar 2010 20:22:00 -0800</pubDate><category>tips</category><category>Mac</category></item><item><title>How To Keep Your Data Forever</title><description>&lt;p&gt;We’ve all sustained painful data losses at some point or another.  After a number of years, you start to realize that you’re tired of getting sucker punched, and that you have the skill and knowledge to solve the problem once and for all.  I’m going to outline here a relatively simple strategy to keep a set of data alive for the rest of your life.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;p&gt;This article is meant to give broad strokes on the strategy.  I’m going to gloss over things that may seem non-trivial, only because they are all well documented elsewhere.  Nothing a little googling on your part won’t solve, and it will help keep the information here somewhat platform independent.  I will get into more specific technical details about my implementations in later posts.&lt;/p&gt;
&lt;h3&gt;Step 1 - Buy 3 identical drives&lt;/h3&gt;
&lt;p&gt;Hard drives. Regular cheap hard drives. The key here is upgradability. Moore’s   Law will help us later.&lt;/p&gt;
&lt;p&gt;Buy 3 of the largest, cheapest drives you can afford.  They really don’t have to be identical, just the same size.  Usually when you find a good deal on a large drive it’s best to just jump on it and buy three.  When I’m ready to buy, I check the Fry’s ad every week at the &lt;a title="LA Times" href="http://latimes.p2ionline.com/shoppingchannel/rop/"&gt;LA Times&lt;/a&gt; “newspaper ads” site (EDIT: Apparently the LA Times site doesn’t have the Fry’s ad anymore, try the &lt;a href="http://ads.myoc.com/rop/web/ocr/subcategory.php?id=22"&gt;OC Register&lt;/a&gt;).  Prices on stuff like this go up and down, so take a 2-3 week average so you’re sure you’re getting the current best price.&lt;/p&gt;
&lt;p&gt;Unless you have special needs, technology doesn’t matter here, just go for the largest and least expensive drives that will work with your hardware.&lt;/p&gt;
&lt;h3&gt;Step 2 - Set up your main computer&lt;/h3&gt;
&lt;p&gt;You’re going to put 2 of the drives you just bought into your main computer, nightsync’ed.  Don’t use RAID.  I know many of you will be tempted to, but it’s a waste of time and effort.  I ran a RAID 1 system for a long time until I realized how dumb it was.  You have to assimilate and understand the fact that user error accounts for a large percentage of data loss cases.  It doesn’t matter how careful you are.  RAID 1 cannot protect you there.  Save yourself from yourself, don’t use raid for backups.&lt;/p&gt;
&lt;p&gt;I’ll save the specifics of my nightsync config for another post, just try to find the best (simplest) synchronizing/backup app for your platform and you should be fine.  Make sure it creates a perfect mirror of your data, and make sure it happens automatically every night.&lt;/p&gt;
&lt;p&gt;Now that you have the two drives in your main machine working and synchronizing properly, you can already let a wave of satisfaction wash over you.  You are now safe from probably 99% of data loss situations.  Think about it.  The only things that can threaten your files now are physical disasters (like a fire, or large amounts of beer), and theft.&lt;/p&gt;
&lt;h3&gt;Step 3 - Set up the offsite machine&lt;/h3&gt;
&lt;p&gt;This is where it gets a bit tricky.  You need a machine somewhere else you can connect to.  Drop that third drive into an old pc you have lying around (old cheap pentium 2’s are perfect for this), set up a weekly backup to it over ssh and put it at a friend’s house, or your parents’ house.  Everyone’s situation will be different here, but the important thing is to have your data not only on 2+ disks, but also in two different locations.  Since this is an additional level of redundancy, you can do the syncs less often, but they &lt;strong&gt;must&lt;/strong&gt; happen automatically.&lt;/p&gt;
&lt;p&gt;There are several small wrinkles to work out with this approach, but none of them are really prohibitive, and you’ll have fun flexing some technical muscle.  You have to punch a hole in your friend’s router for the ssh transfers.  You also have to work some kind of dyndns magic if they’re on a dynamic ip.  Depending on your level of trust with your backup partner, you may also want to look into some &lt;a title="encrypted filesystem" href="http://en.wikipedia.org/wiki/Encrypted_filesystem"&gt;encrypted filesystem&lt;/a&gt; options.&lt;/p&gt;
&lt;p&gt;You can take your time with this step.  Get it set up and watch it all working locally for a few weeks before you drop the second machine at the offsite location.&lt;/p&gt;
&lt;h3&gt;Step 4 - The infinite loop, your data becomes alive&lt;/h3&gt;
&lt;p&gt;Fast forward 2 years, you’ve run out of space on your main drive. Guess what? Your friend &lt;a title="Gordon Moore" href="http://en.wikipedia.org/wiki/Gordon_Moore"&gt;Gordon Moore&lt;/a&gt; has your back and hard disks are twice as large and have become abundantly cheap.  You are probably even thinking of buying a new machine.&lt;/p&gt;
&lt;p&gt;Remember that old machine you set up at your friend’s house?  Run a final sync to it and then take its drive out and put it in your safety deposit box, or your safe at home, or wherever.  Keep it safe.  It marks an era of your life.  You may never ever plug it in again, but you’ll feel good knowing you can if you have to.&lt;/p&gt;
&lt;p&gt;Now for the cool part.  You only have to buy 2 drives this time.  Make sure they are exactly twice as large as your previous drives.  These will replace the drives in your main machine, as the main drive and nightsync drive.  What do you do with the old drives?  Well, we have to offer an apology to our old friend, much maligned earlier in the article: RAID.&lt;/p&gt;
&lt;p&gt;We’re going to use arguably the most ridiculous RAID configuration, JBOD, or Just a Bunch Of Disks, to arrange the two old drives into 1 logical drive in our now drive-less offsite backup machine.  This will let us backup twice the amount of data as before, because the disks’ capacities are simply concatenated together to form a drive twice as large.  We don’t need any kind of speed or efficiency here either so software RAID is perfectly fine.&lt;/p&gt;
&lt;p&gt;Optionally if you are buying a new machine at this point you may just want to replace your offsite machine with the old main machine to avoid transplanting the old disks.&lt;/p&gt;
&lt;p&gt;Copy all your old data to your new drives before you start working again and the cycle is complete.  Repeat this step every time you run out of drive space and you will never again have to worry about losing data.  EVER.&lt;/p&gt;
&lt;h3&gt;Additional insights&lt;/h3&gt;
&lt;p&gt;It used to bother me to think that I had to buy two drives instead of just one every time I wanted to upgrade.  At first it seemed like such a waste of money.  But when you think about how much more security that extra $100 or $200 buys you, it kinda boggles the mind.  Recently Google released an analysis of drives that said that the average failure rate of drives over 2 years was about 8%.  That means that if you keep a single drive in your machine for 2 years, you have a 1 in 12 chance of losing all your data from drive failure.  That’s scary stuff to me.  You drop a second drive in there and run a nightly sync and that risk literally goes away.  Fall on a bad drive?  Replace it under warranty (or not) and you’ve dodged point-blank bullet.  I can’t think of a better or easier way to protect yourself from the worst thing that can happen to your computer.&lt;/p&gt;
&lt;p&gt;Laptop users are a bit out of luck on that front, because you can’t physically put a second drive in to run your nightly syncs.  The best thing to do if you use a laptop as your main machine is to build a cheap file server at home to act as the “main machine” from this article, and nightsync your laptop to it with ssh.  That applies to multi-machine setups too.  Have them all backup to a local file server which then runs the sync to the offsite machine.  You will need bigger disks, but the result will be near optimal.&lt;/p&gt;
&lt;p&gt;Online backup services like &lt;a title="Amazon s3" href="http://aws.amazon.com/s3"&gt;Amazon s3&lt;/a&gt; are also an option for the offsite component of the strategy, but I prefer the method outlined here because it scales transparently as the data set gets larger.  If you crunch the numbers based on a meager 200GB data set with weekly syncs, the online services just become too expensive.  Also it feels good to have final control over all your data.  Big companies make mistakes just like the rest of us.&lt;/p&gt;
&lt;p&gt;There is another, less obvious benefit to keeping your data forever.  You’ll start to notice subtle changes in your directory structures.  You’ll start arranging data more elegantly, refined from years of experience with it, combined with the knowledge that it will never be erased unless you want it to be.  You’ll start to eliminate clutter naturally, instead of starting over every time you get a new machine.  Your project folders will take on a new meaning in your mind, no longer becoming forgotten cruft from dead ideas, but evidence of work done, points of reference for your future.  You’ll think of it like carving your work into stone instead of writing in pencil on post-it notes.&lt;/p&gt;
&lt;p&gt;Lastly, whatever you do, remember to keep things simple for yourself and have fun learning along the way.&lt;/p&gt;</description><link>http://tumblr.christophercamps.com/post/577729430</link><guid>http://tumblr.christophercamps.com/post/577729430</guid><pubDate>Sat, 31 Mar 2007 20:13:00 -0700</pubDate><category>Backups</category><category>Tutorials</category></item></channel></rss>
