<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vallery.net &#187; projects</title>
	<atom:link href="http://vallery.net/tag/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://vallery.net</link>
	<description>personal homepage of Jason Vallery</description>
	<lastBuildDate>Thu, 08 Apr 2010 22:45:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Automatically backup your Mac to Amazon S3</title>
		<link>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-amazon-s3-to-automatically-backup-your-mac</link>
		<comments>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 17:46:16 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[organize]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/</guid>
		<description><![CDATA[With the new version of OS X (Leopard) Apple has included some great functionality in Time Machine. Your Mac will automatically backup to an external drive every hour. It includes the ability to recover deleted files in a timeline. The one downside to the Time Machine approach is that the data isn&#8217;t remotely stored. A [...]]]></description>
			<content:encoded><![CDATA[<p>With the new version of OS X (Leopard) Apple has included some great functionality in Time Machine.  Your Mac will automatically backup to an external drive every hour.  It includes the ability to recover deleted files in a timeline.  The one downside to the Time Machine approach is that the data isn&#8217;t remotely stored. A couple years ago my wife and I had a house fire where most of our things were destroyed.  Fortunately the fire was extinguished before it spread to where our computers were so we didn&#8217;t lose any data.  If it had been elsewhere in the house it could have been a serious situation for us if we lost all of our digital files.</p>
<p>After the fire I have followed a manual process of backing up our files on an external drive that I store in our fire safe.  The problem with this is it requires me to actually do the work, which I often put-off.  When Amazon S3 was introduced I immediately saw the potential to use it as an automatic remote backup source.  I hadn&#8217;t invested much time in it up until now, but I just got a new computer (MacBook Air!!) and while setting it up I thought it would be a good opportunity to get my backup situation in order.</p>
<p>There are some great tools already in existence that can do most of the heavy lifting for you.  The primary tool for doing remote directory syncs is called s3sync which is a script written in Ruby.  Lucky for us OS X comes with Ruby pre-installed so there isn&#8217;t much work to get it working.</p>
<p>Here is my step-by-step guide to getting your machine setup to do automatic daily backups to Amazon.  I developed these steps on my MacBook Air running Leopard however they should work for previous versions of OS X as well.</p>
<p><strong>Step 1) </strong> First off, your going to need and Amazon Web Services account.  Head over to <a href="http://aws.amazon.com/">http://aws.amazon.com/</a> and sign-up for an account to use S3.  The prices are very cheap ($0.15/GB/Month).  Once you have your account setup you will need two things to use Amazon S3. Your Amazon access key and your secret key.  These are what s3sync will use to authenticate you to Amazon.</p>
<p><strong>Step 2) </strong> I&#8217;ve packaged together a zip file with all the files you are going to need to get this setup along with SSL. Download the file at <a href="http://images.vallery.net/s3backup.zip">http://images.vallery.net/s3backup.zip</a>. You can go to <a href="http://s3sync.net/">http://s3sync.net/</a> to see if a newer version if you like but you&#8217;ll need to figure some of this out on your own.</p>
<p><strong>Step 3) </strong> You need to create a &#8220;bucket&#8221; in amazon to store your files.  A bucket is similar to a folder, however it is globally uniquely named across all Amazon S3 users.  In order to create the bucket you are going to need one of the S3 GUI applications that exist.  I have included in the zip file the one I have used called &#8220;S3 Browser&#8221;.  You can find the latest version at <a href="http://people.no-distance.net/ol/software/s3/">http://people.no-distance.net/ol/software/s3/</a>.  Once you launch S3 browser click on &#8220;connection&#8221; then &#8220;new connection&#8221;.  You&#8217;ll need to provide the access details you got from Amazon in step 1.  Once you have connected click the &#8220;Add&#8221; button which will allow you to create a new bucket.  Because the name has to be globally unique I used &#8220;vallery-macbookair-backup&#8221; where vallery is my last name.  Keep track of this bucket name because you need it in the next step.</p>
<p><img src="http://images.vallery.net/s3browser.png" alt="s3browser.png" border="0" /></p>
<p><strong>Step 4)</strong>  Once you have the zip file I created downloaded it should automatically extract itself into your downloads folder creating a new folder called &#8220;s3backup&#8221;.  Within the s3backup folder are all the files and scripts you will need in order to get this working.  There is one key file that needs to be edited in order to make this all work which is called &#8220;backup.sh&#8221;.  Open the file &#8220;backup.sh&#8221; and replace the place holder access key,  secret key, bucket name with the ones you obtained form Amazon and step 3.</p>
<p><img src="http://images.vallery.net/backupsh.png" alt="backupsh.png" border="0" /></p>
<p><strong>Step 5)</strong>  Now that you have all the files ready to go you need to select a place to store them.  The application will run as root at the system level in order to prevent file access issues,  therefore I recommend storing the entire s3backup folder in your /Library folder.  You should copy the entire folder using finder to /Library.  There are a few other paths in &#8220;backup.sh&#8221; that will need to be updated if you choose to store the file elsewhere.</p>
<p><strong>Step 6)</strong>  You need to setup your Mac to automatically run the backup shell script on a regular interval.  There are a couple ways to do this.  Since I am Unix guy I immediately started looking at cron. I discovered however that Apple recommends you use launchd for scheduled tasks.  It is fairly complex to setup a scheduled task using launchd but thankfully someone has already created a simple GUI that will let you do it.  The application Lingon can be used for this.  I&#8217;ve included the latest version at the time of writing this in the s3backup directory but you can always obtain the latest version from <a href="http://lingon.sourceforge.net/">http://lingon.sourceforge.net/</a>.  Once you have launched Lingon you need provide some information.  Click the &#8220;New&#8221; button to start a new agent.  Choose &#8220;Users Daemons&#8221; so that the script will run as root and have access to all of the users on your Mac.  Once you have created your new daemon you need to give it a name.  I recommend something like com.vallery.s3backup where vallery is your name.  You need to give the command line action for what to execute.  Again, this assumes that you have stored the s3backup folder in /Library.  Enter:  &#8220;/bin/bash /Library/s3backup/backup.sh > /dev/null&#8221;.  Lastly you need to give it a schedule as to when to run.  I have mine setup to &#8220;At a specific date&#8221; with &#8220;Every day&#8221; selected and the time set to 4:00am.  This is great if your leave your Mac on all the time.  You might select a different option so that you can make sure your Mac isn&#8217;t in use when it is doing the backup. Click the &#8220;Save&#8221; button.  It will require you to type in your admin password and then restart your computer.</p>
<p><img src="http://images.vallery.net/lingon.png" alt="lingon.png" border="0" /></p>
<p>That is it, your system should run the first backup as schedule.  It will take a long time initially as the upload speed is limited to your internet connection.  Once the initial upload has taken place it will only upload files that are new or have changed going forward.  The script is setup to backup everything in the /Users folder.  If you would like to limit what is being backed up you can change this to something else.</p>
<p>In the unfortunate event you actually need to get data out of the s3 store there are a number of applications that you can use to do this.  Initially I have been using Panic&#8217;s Transmit however it seems to have problems with the way s3sync is storing the data.  I found another great free app called &#8220;S3 Browser&#8221; which has worked well for me.  You can also use the Firefox plugin <a href="https://addons.mozilla.org/en-US/firefox/addon/3247">S3 Fox</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Extracting emails from Gmail and Google Apps for Domains</title>
		<link>http://vallery.net/2008/01/20/extracting-emails-from-gmail-and-google-apps-for-domains/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=extracting-emails-from-gmail-and-google-apps-for-domains</link>
		<comments>http://vallery.net/2008/01/20/extracting-emails-from-gmail-and-google-apps-for-domains/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 22:09:52 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2008/01/20/extracting-emails-from-gmail-and-google-apps-for-domains/</guid>
		<description><![CDATA[First off, I&#8217;ll get the link out of the way. If you go to http://vallery.net/gmail/ you can see this application in action. Now a little bit more about it. I discovered that over the years I haven&#8217;t exactly been great about maintaining my addressbook. I&#8217;ve lost touch of many of acquaintances that I have had [...]]]></description>
			<content:encoded><![CDATA[<p>First off, I&#8217;ll get the link out of the way.  If you go to <a href="http://vallery.net/gmail/">http://vallery.net/gmail/</a>  you can see this application in action.  Now a little bit more about it.</p>
<p>I discovered that over the years I haven&#8217;t exactly been great about maintaining my addressbook. I&#8217;ve lost touch of many of acquaintances that I have had casual communication with. I realized that their email addresses where trapped in the deep bowels of my Gmail account, if only there was some way to extract them. I quickly realized that using the newly released IMAP protocol I could probe every message and then extract out the email addresses from it, and in some cases even additional data like the first and last name. I started playing around with the scripting a bit and came up with what I have now. This tool goes out to the Gmail IMAP server and downloads the message header from ever email that is stored in my Gmail account (except the SPAM folder). It pulls them into a master list, along with the first and last name if available. After all of the emails have been extracted it calculates some basic statistics including frequency of occurrence, which it users to sort them on. All of this information is then exported into CSV files that are compatible with many different applications.</p>
<p>While doing this I discovered an additional use for this data. On many of the social networking sites like Facebook and LinkedIn they will allow you to import a contact list file and find everyone that has registered for the service that you already know. This turned out to be a really killer app for this functionality. The only challenge was that they limit your ability to upload contacts to about 2,000 at one go. I added some additional functionality to my extract that &#8220;chunked&#8221; the file into several files, each with 2,000 email addresses in it. This allowed me to upload my newly discovered contacts a bit at a time, which worked very well.</p>
<p>If you would like to extract the email addresses from your Gmail or Google Apps for Domains account head over to <a href="http://vallery.net/gmail/">http://vallery.net/gmail/</a> and give it a whirl!</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2008/01/20/extracting-emails-from-gmail-and-google-apps-for-domains/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Debug your outbound POST and GET requests</title>
		<link>http://vallery.net/2007/05/17/debug-your-outbound-post-and-get-requests/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=debug-your-outbound-post-and-get-requests</link>
		<comments>http://vallery.net/2007/05/17/debug-your-outbound-post-and-get-requests/#comments</comments>
		<pubDate>Thu, 17 May 2007 19:27:13 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2007/05/17/debug-your-outbound-post-and-get-requests/</guid>
		<description><![CDATA[I work a lot with different types of web services. I find when I&#8217;m building an application that has to post data off to a remote service that it can be difficult to debug where the problems are. I can&#8217;t always see an exact copy of the HTTP request that I am sending, and therefore [...]]]></description>
			<content:encoded><![CDATA[<p>I work a lot with different types of web services.  I find when I&#8217;m building an application that has to post data off to a remote service that it can be difficult to debug where the problems are.  I can&#8217;t always see an exact copy of the HTTP request that I am sending, and therefore how the remote service sees my call.  I created a simple little app that when called will return exactly what it was sent.  You can pass in variables in a POST or GET, and it will just spit them right back at you along with whatever HTTP headers were sent by your client.</p>
<p><!---more--></p>
<p>If you point your browser over to <a href="http://vallery.net/postback/index.php">http://vallery.net/postback/index.php</a> you can see it in action.  It will report back to you exactly how your browser is identifying itself, including any cookies you might have received from my word press blog!</p>
<p>Now the next time you are writing an application and you want to debug your outbound posts, just send them over to the above URL and it will respond with exactly what it received.</p>
<p>Pretty cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2007/05/17/debug-your-outbound-post-and-get-requests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 steps to organize your digital life on OS X and Windows</title>
		<link>http://vallery.net/2007/04/10/10-steps-to-organize-your-digital-life-on-os-x-and-windows/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=10-steps-to-organize-your-digital-life-on-os-x-and-windows</link>
		<comments>http://vallery.net/2007/04/10/10-steps-to-organize-your-digital-life-on-os-x-and-windows/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 16:30:51 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Getting Things Done]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[organize]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2007/04/10/10-steps-to-organize-your-digital-life-on-os-x-and-windows/</guid>
		<description><![CDATA[In meat space my wife and I are far from organized. It&#8217;s a real problem because we are always losing important things like our car keys. Unfortunately, this how-to won&#8217;t help me solve that problem. In the digital world however, I&#8217;m extremely anal retentive and organized. Everything is in its place and easily searchable. It [...]]]></description>
			<content:encoded><![CDATA[<p>In meat space my wife and I are far from organized.  It&#8217;s a real problem because we are always losing important things like our car keys.  Unfortunately, this how-to won&#8217;t help me solve that problem.  In the digital world however, I&#8217;m extremely anal retentive and organized.  Everything is in its place and easily searchable. It allows me to be much more productive since I don&#8217;t have to waste my time trying to find things.  I&#8217;m using a Mac and OS X Tiger at home and Windows XP in my day job at work, so that even further complicates my digital lifestyle.  A lot of these tips can be platform agnostic and work under Windows and Linux as well.  These suggestions work hand in hand with an indexed search capability.  In OS X we have the built in, and fantastic, Spotlight.  On Windows XP you can download <a href="http://desktop.google.com/">Google Desktop</a>. Of course Windows Vista has search built in. On Linux, if you are using Gnome there is <a href="http://www.gnome.org/projects/tracker/"> Tracker</a>.  Also on OS X, take a look at <a href="http://quicksilver.blacktree.com/">Quicksilver</a></p>
<p>In no particular order my tips are:</p>
<p><strong>1) Directory structures: </strong> In your personal document space (Your home directory on a Mac or Linux, &#8220;My Documents&#8221; on Windows) you need to create a document hierarchy to store your files.  Depending on the amount of documents that you store, your system might include date as a component of the hierarchy so that your folders don&#8217;t become too large and unmanageable.  I first divide my home directory up with a folder for each of the categories of documents that I might have.  Word processing, spreadsheet, presentation, and notes.  Under that I have it broken down by type.  These are categories of the types of projects I might be working on. At work, this is the name of which of my clients for whom the document is relevant.   From there, I have sub-directories for each year.  2007, 2006, and so on.</p>
<p><strong>2) File names:</strong>  All of my files are named with a standard convention.  The convention is PROJECT/CLIENT_DESCRIPTION_YYYYMMDD_TYPE.EXT.  Including the document type is helpful because sometimes the file extension doesn&#8217;t always give it away, or on some machines file extensions might be hidden.  So for example if I had a Excel document for a client named Acme that contained a data extract, I would name the file ACME_DATAEXTRACT_20070410_EXCEL.xls</p>
<p><strong>3) Music:</strong>  I use iTunes to manage my music library.  Part by force, since I own 4 iPods and an Apple TV, but part because I enjoy it.  I think iTunes is a great interface for music management.  I&#8217;ve done a few extra things in iTunes that help me stay organized.  One of the most important data fields on a music track I find is &#8220;Album Artist&#8221;.  This field is a recent addition to iTunes, but it really makes finding my music easier, especially from the iPod interface.  For the music you purchase from the iTunes store, this is typically done for you already. If you&#8217;ve ripped your CDs, the CDDB database doesn&#8217;t always have this information however.  The first thing I do after I&#8217;ve ripped a new CD is go and verify if the Album Artist field has info, and that it is correct.  If not I manualy update this field based on the artist.  This is especially useful on CDs that have a large number of collaborations on them.  The second iTunes tip I have is use the rating system.  When you are listening to your music, take the few seconds to go and rate the song.  If you have a large music library, it is really handy to be able to just put on a playlist of your top rated songs when friends are over.  You don&#8217;t want them to know you have the Macarena in your library!</p>
<p><strong>4) Feeds:</strong>  I use <a href="http://www.google.com/reader/">Google Reader</a> to organize my feeds.  In Google Reader you are able to setup multiple folders that each can contain multiple feeds.  I have a folder for friends blogs, a folder for tech news, a folder for blog research, and a folder for each of my other interests.  I can quickly see where new articles are and view just the topics I&#8217;m interesting in looking at.  I also setup keyword searches on <a href="http://blogsearch.google.com/">Google Blog Search</a> and <a href="http://news.google.com/">Google News</a> and add the feed into Google Reader.  This lets me get all the information I want, in a single easy to digest location.</p>
<p><strong>5) Photos:</strong>  We take a lot of digital photos, and we like to publish them online so that family can view them at their leisure.  We have literally thousands of digital pictures that we have taken over the years.  Keeping them all organized is no easy task.  Recently I&#8217;ve begun the painstaking process of tagging all of the pictures in iPhoto.  I tag the photos based on who is in the picture, the location of the picture, and anything that is particularly unique to the picture.  Once the photos are tagged I upload them to <a href="http://vallery.net/gallery/">our gallery</a> using the <a href="http://zwily.com/iphoto/">iPhotoToGallery</a> plugin.  The gallery itself is powered by <a href="http://gallery.menalto.com/">Gallery</a>, a fantastic open source PHP based web gallery.</p>
<p><strong>6) Address book:</strong>  Now my address book organization is a bit tricky.  As I mentioned above, I live both in the Mac and the Windows universe when it comes to my day job.  At work we use Exchange and I carry around a Blackberry that is synced to Exchange.  At home, I use my Mac, and I soon hope to have an iPhone.  It&#8217;s a real challenge to keep my contacts synced between all these devices without spending too much time on it. In AddressBook 4.0 there is a handy feature that allows Exchange users to sync their Mac address book with Outlook Web Edition.  Unfortunately for me, my company is still on the very old Exchange 5.5, and so I don&#8217;t have outlook for the web yet.  While I openly admit this solution is far from perfect, it&#8217;s the best I have been able to come up with.  Currently, I use my Blackberry as the transport medium for contacts.  Exchange and my Blackberry work very well together, so I can always trust them.  The problem is getting that same information onto my Mac.  <a href="http://www.pocketmac.net/products/pmblackberry/">PocketMac</a> makes a great utility that syncs your Blackberry with iLife.  If I set this up as a one way sync (Blackberry to Mac) it works fairly reliable.  The downside is that in order to add a new contact I have to do it with either my Windows PC or my Blackberry.  I hope a better solution presents itself soon, or perhaps I might just dump my exchange dependancy all together when the iPhone arrives.</p>
<p><strong>7) Chat contacts:</strong>  Like most Mac users, I use <a href="http://www.adiumx.com/">Adium</a> for my instant messaging.  Adium is great because I can merge contacts from different networks into a single entry on my contact list and then set the network priority so I can choose which protocol to use if available.  If you have the same person listed twice in Adium under your contact list, drag the contact from the lower priority network on top of the contact for the higher priority network.  Adium will then ask you if you want to merge these contacts.<br />
Another handy feature of Adium is having contact information pulled from your Address Book.  This way their display name is listed as their real name instead of whatever catchy tag they chose to display as their alias.  The last adium tip I have is how I organize my contact list.  In Adium you can sort your contact list by status (under the view menu), and then choose to only view online contacts.  This greatly reduces the number of contacts displayed and lets me quickly see who is available.</p>
<p><strong>8 ) Email:</strong> Again, like Address Book email is a challenge in the hybrid Mac/Windows world I am in.  Thankfully my email addresses are fairly separate.  Work email stays on Exchange and personal email sits in Mail.app.  Since I have my own domain name I use the fantastic <a href="http://www.google.com/a/">Gmail for domains</a> service.  Google acts as my mail server and stores all my incoming messages. They are also kind enough to do spam filtering and provide an amazing ~16GB storage limit.  I enable pop mail on the account and then fetch all my email down to Mail.app for local viewing and management.  Once in Mail.app I use smart mailboxes to automatically sort out messages from the mailing lists I subscribe to.  In Mail.app click the cog icon in the lower left, below your list of folders.  From there, chose &#8220;New Smart Mailbox..&#8221;.  With this interface you can specify under what criteria the mail message should be moved to the folder.  For most mailing lists it is easy because typically a ID tag is prepended to the message subject.  You can also use smart folders to create for individuals who email you a lot, so you can immediately see if you have new messages from them.  That way you can give them your attention, or ignore them as the case may be.</p>
<p><strong>9) Calendar:</strong> Ok, yet again I get bitten by the Exchange vs iLife issue.  Similarly to how I manage my contacts I manage my calendar.  I use the PocketMac software to import my calendar entries from Exchange/Blackberry into iCal.  In iCal I have 2 separate calendars, work and personal.  In the work calendar I have everything that is synced from the Blackberry, in the personal calendar I have everything that falls outside of work.  This has worked out well because it allows me to stay organized but still keep my personal appointments completely private from my colleagues on our Exchange server.  The only downside to this approach is that I do not receive reminders on my Blackberry for my personal calendar appointments.  Again, hopefully the iPhone fixes this problem</p>
<p><strong>10) Bookmarks:</strong>  Now this is an area where the Windows/Mac problem is truly solved.  I use <a href="http://del.icio.us/">del.icio.us</a> to organize all my bookmarks.  I can tag them so I know what they are about and I can easily retrieve them later.  On Windows there is the new <a href="http://del.icio.us/help/firefox/extensionnew">Firefox Extension</a> and on my Mac and Safari I use <a href="http://codesorcery.net/pukka">Pukka</a> combined with a simple javascript entry in my Bookmarks bar</p>
<blockquote><p><code>javascript:document.location.href='pukka:url='+encodeURIComponent(location.href)<br />
+'&#038;title='+encodeURIComponent(document.title)+'&#038;extended='+encodeURIComponent(window.getSelection());</code>
</p></blockquote>
<p>When clicked, the above javascript sends your current URL to Pukka, which the gives you a prompt to tag it and upload it to Del.icio.us.  The end results is that I have my bookmarks well organized and tagged on all of my computers.  To access my bookmarks I just subscribe to the Del.icio.us RSS feed in Safari.</p>
<p>Can you think of any I might have missed?  Have a solution to my Windows/Mac Address Book and Calendar problems?  Drop a note in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2007/04/10/10-steps-to-organize-your-digital-life-on-os-x-and-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimizing WordPress and LAMP to survive the Digg effect</title>
		<link>http://vallery.net/2007/03/26/optimizing-wordpress-and-lamp-to-survive-the-digg-effect/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=optimizing-wordpress-and-lamp-to-survive-the-digg-effect</link>
		<comments>http://vallery.net/2007/03/26/optimizing-wordpress-and-lamp-to-survive-the-digg-effect/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 13:40:34 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2007/03/26/optimizing-wordpress-and-lamp-to-survive-the-digg-effect/</guid>
		<description><![CDATA[Anyone who has used digg for any amount of time has certainly come across a dead link. Invariably you click on the comment link hoping someone has posted a mirror of the content. You head over to duggmirror or coral cache to view the content. During the peak time right after an article hits the [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone who has used digg for any amount of time has certainly come across a dead link.  Invariably you click on the comment link hoping someone has posted a mirror of the content.  You head over to duggmirror or coral cache to view the content.  During the peak time right after an article hits the digg homepage, a given site might receive as many as 100 page loads per minute.  If this page is hosted on WordPress, or other MySQL based blog platform, combined with shared hosting, it&#8217;s a recipe for a crash.  Your site will go down in flames and you won&#8217;t have a chance of recovering until the load goes back to a lower level.</p>
<p>Recently I had an article hit the front page of Digg.  I was lucky because I had already done a number of things to optimize my server so that I survived.  My page never went down, and was very responsive for the entire duration of getting dugg.  My site is hosted on WordPress on a server that I own and manage.  The server hosts about 15 different domains, none of which are exceptionally high traffic sites.  The server isn&#8217;t anything special either.  It&#8217;s a single processor P4 3.0GHz with 512MB of memory running CentOS 4.4, Apache 2.0, PHP5, MySQL4.  I do have webalizer running on my Apache logs and I have the output of those posted at <a href="http://vallery.net/stats/">http://vallery.net/stats/</a> if you would like to see what the Digg effect can do.</p>
<p>I never exceeded more than a 0.15 <a href="http://en.wikipedia.org/wiki/Load_(computing)">load average</a> during the Digg.  Load average is a computation of how maxed out a Unix based system is.  You multiply the number of processors by 1, and this indicates the maximum load average that you can reasonably sustain.  If the load average exceeds this number, than your system is over utilized.  In my case, my max server load is 1 given that this is a single processor system.  This means I was only using 15% of my system resources during the maximum load that was generated from the Digg.</p>
<p>In order to optimize my system I have done the following things:</p>
<p>1) I&#8217;ve installed the WordPress 2.0 plugin <a href="http://mnm.uib.es/gallir/wp-cache-2/">wp-cache</a>.  This is something that every WordPress blog should have installed.  Especially on a shared hosting environment, it will dramatically increase your ability to handle high traffic.   The plugin generates the HTML for a given page and then saves it in a cache file.  When someone accesses your page, instead of fetching the content from the database it uses the already generated HTML in the cache to send to the browser.  This eliminates a number of fetches to the DB and dramatically speeds up page load times.</p>
<p>2)  Optimize Apache/MySQL to handle the expected number of database queries.  The most common error you receive when viewing a WordPress page that has been owned by the Digg effect is a database connection failed, or timeout.  When connecting to a MySQL database you can either have a persistent connection, or generate a new connection for each request.   There are a number of schools of thought as to which method is better, but generally speaking using persistent connections utilize more memory, so for me using a new connection for each request makes more sense.  A lot of the PHP blog templates including WordPress use these non-persistent connections as well.  The rub comes in the maximum number of said connections.  MySQL can be configured in your my.cnf file to say the maximum number of connections that can be created to the database.  If each instance of Apache (which in turn represents concurrent vistors to your page) has it&#8217;s own connection, then you can quickly exceed this maximum number of connections.  Apache similarly has a configuration option that dictates the maximum number of threads that can be concurrently running.  This number is specified in the httpd.conf file.  If the Apache number is larger than the MySQL number (which is the case in most default configurations) when you have more Apache threads running than MySQL is capable of handling, you get our nice &#8220;maximum number of connections&#8221; error message.</p>
<p>In /etc/my.cnf you want to set the variable &#8220;max_connections&#8221;.  I recommend something reasonably high like 250.<br />
In your httpd.conf file for Apache you want to set the variable &#8220;MaxClients&#8221;.  This should typically be the same number that you selected for MySQL.</p>
<p>3) Set reasonable Apache timeouts.  This means that no individual thread/connection can monopolize the system bringing all the other queries to its knees.  This protects you from rogue &#8220;edge&#8221; cases.</p>
<p>In your httpd.conf file set &#8220;Timeout&#8221; to a low number like 30 (measured in seconds) and &#8220;KeepAliveTimeout&#8221; to something like 3.</p>
<p>4) If your site makes it on to Digg, use real-time monitoring tools to measure your server&#8217;s health.  There are a number of command line tools available to help in this regard.  The first I would recommend is the tried and true &#8220;top&#8221; command.  This will display the processes running on your machine along with their associated memory and CPU usage.  Keep an eye and make sure things aren&#8217;t getting out of hand.  The second tool that I use is called &#8220;<a href="http://www.rhythm.cx/~steve/devel/tcptrack/">Tcptrack</a>&#8220;.  Tcptrack will need to be installed on your machine, but once it is it will give you a real time view of your incoming connections and bandwidth usage.</p>
<p>Happy Digging!</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2007/03/26/optimizing-wordpress-and-lamp-to-survive-the-digg-effect/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Scalable story promotion</title>
		<link>http://vallery.net/2007/03/26/scalable-story-promotion/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=scalable-story-promotion</link>
		<comments>http://vallery.net/2007/03/26/scalable-story-promotion/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 10:14:14 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2007/03/26/scalable-story-promotion/</guid>
		<description><![CDATA[I had some thoughts on the idea of scalable story promotion for the open source Pligg system. I thought I would share them here I&#8217;ve been thinking about the best way to handle promoting a story/article from a queued status onto the main page and I&#8217;ve had a few thoughts I wanted to share with [...]]]></description>
			<content:encoded><![CDATA[<p>I had some thoughts on the idea of scalable story promotion for the open source Pligg system.  I thought I would share them here</p>
<p>I&#8217;ve been thinking about the best way to handle promoting a story/article from a queued status onto the main page and I&#8217;ve had a few thoughts I wanted to share with everyone.</p>
<p>The current scheme for promotion is very simple. Number of votes passing a defined threshold in the config file (and the story is fresher than X days). While this will work for very low volume sites, it doesn&#8217;t exactly scale well. In a site with a large number of users, and one would assume proportionately a large number of votes, this breaks down.</p>
<p>Our ideal system would be able to quickly determine that a story is of high value and promote it to the homepage based on the frequency of votes as compared to a large sample population. Using some basic statistics we can determine if a story is an &#8220;above average performer&#8221; and promote it quickly.</p>
<p>In order to accomplish this we need to take into consideration several variables, including:</p>
<p>1) Number of stories submitted in a given time period<br />
2) The average number of votes over a given time period for all &#8220;active&#8221; stories in the queue<br />
3) The standard deviation of votes over a given time period for all &#8220;active&#8221; stories in the queue<br />
4) The target number of stories to be promoted to the home page in a given time period</p>
<p>For the purposes of explaining my ideas I am going to define the time period as one day. We need to calculate and story the answers to some of these questions on a regular basis. Ideally we create a new DB table that stores this information for us to easy lookup. This way we can also track information statistically and show trends. For my plans I plan on implementing a cron job that runs daily that calculates the required and stores them as follows.</p>
<p>1) Calculating the number of stories submitted is trivial. The SQL query I am using is:</p>
<p>select count(*) from links where link_status = &#8216;queued&#8217; and date(link_date) = &#8217;2006-04-16&#8242;;</p>
<p>2&#038;3) Calculating the average and standard deviation can be done with the following query:</p>
<p>select avg(link_votes) as &#8216;average&#8217;, stddev(link_votes) as &#8216;stdev&#8217; from links where link_status = &#8216;queued&#8217; and date(link_date) = &#8217;2006-04-16&#8242;;</p>
<p>4) This can be set in the config.php file and up to the site administrator.</p>
<p>These values will be used to &#8220;predict&#8221; the future for our new stories. Each story will have a new variable that stores a floating point number. This number is the number of standard deviations above or below the mean (average). We need an additional check running on a much more frequent interval (I plan on using every 5 minutes) to update the items in the database with their new &#8220;score&#8221; and promote them once they pass a specific threshold.</p>
<p>I plan on calculating this as follows:</p>
<p>$score = //Z score that indicated if a story is above/below the mean<br />
$numofvotes = //The number of votes that a given story has received<br />
$stddev = //Standard deviation for the given time period as calculated above<br />
$average = //Average number of votes for the given time period as calculated above<br />
$numberofstories = //The number of stories submitted in the given time period as calculated above<br />
$desirednumofstories = //Setting from config.php</p>
<p>The cut-off value determines a &#8220;score&#8221; threshold, or essentially a percentile that a story must fall into in order to be promoted. I plan on calculating this as follows:</p>
<p>$score = ($numofvotes &#8211; $average)/$stddev;<br />
or in SQL</p>
<p>select link_id, ((link_votes &#8211; $avg)/$stddev) from links where link_status = &#8216;queued&#8217; and date(link_date) = &#8217;2006-04-16&#8242;;</p>
<p>Once we have this score we need to decide if this story needs to be promoted or not. This is done by first calculating where in the rank order this story is likely to fall for the day using some basic probability statistics.</p>
<p>$rank = round($numofstories/(1+exp(-1.7*$score)),1);<br />
Now we just check and see if that rank falls above our threshold and promote the story accordingly.</p>
<p>$desiredrank = ($numberofstories &#8211; $desirednumofstories)<br />
if ($rank >= $desiredrank) then {<br />
    // Update story and set to promoted<br />
}</p>
<p>This method should work well assuming that traffic is fairly stable from day to day. Since we are using the previous days data to predict the current days volumes if a sudden traffic spike is hit it will mean that a larger number of stories will be promoted than desired. This can be mitigated on larger volume websites by decreasing the &#8220;given period of time&#8221; from a day to something shorter. Additionally this whole idea could be retooled to calculate these variables on a per category level. Some sites might have much higher traffic, and therefore votes for one category than another.</p>
<p>I&#8217;m currently working on implementing the above for a site that I plan on launching in the near future, and I would love feedback, criticism before I do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2007/03/26/scalable-story-promotion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up an automated workflow to convert files for Apple TV on OS X</title>
		<link>http://vallery.net/2007/03/23/setting-up-an-automated-workflow-to-convert-files-for-apple-tv-on-os-x/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=setting-up-an-automated-workflow-to-convert-files-for-apple-tv-on-os-x</link>
		<comments>http://vallery.net/2007/03/23/setting-up-an-automated-workflow-to-convert-files-for-apple-tv-on-os-x/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 14:45:13 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://vallery.net/2007/03/23/setting-up-an-automated-workflow-to-convert-files-for-apple-tv-on-os-x/</guid>
		<description><![CDATA[With the arrival of my Apple TV yesterday I needed a solution to get my Xvix/WMV/Divx files converted and imported into iTunes so that I can watch them. I already have Quicktime Pro, which with the recent release added the ability to &#8220;Export to Apple TV&#8221;. Since I have a lot of files, and no [...]]]></description>
			<content:encoded><![CDATA[<p>With the arrival of my Apple TV yesterday I needed a solution to get my Xvix/WMV/Divx files converted and imported into iTunes so that I can watch them.  I already have Quicktime Pro, which with the recent release added the ability to &#8220;Export to Apple TV&#8221;.  Since I have a lot of files, and no desire to sit around and convert these one at a time, it seemed like a perfect job for automator.  I figured someone out there at some point had to have done something similar so I did a bit of google searching and found the required automator actions.  Using the actions I found combined with the sample workflow they have already created for you, it is trivial to set-up a workflow that will convert to the Apple TV format and then import the file into your iTunes library.  With a slight modification you can set it up a plug-in and attach it to a folder action.  Now I have a simple drop folder on my desktop that launches quicktime pro and converts the file to an Apple TV viewable format, imports the file into iTunes, and cleans up after itself.</p>
<p>Here is a simple step-by-step guide to walk you through what I did:</p>
<p>1) Install xvid, divx, and wmv codecs.</p>
<p>These can be found here:</p>
<p><a href="http://www.divxmovies.com/codec/">Divx</a><br />
<a href="http://www.xvidmovies.com/mac/">Xvid</a><br />
<a href="http://www.flip4mac.com/wmv.htm">WMV</a></p>
<p>2) Install the automator actions for compressing and importing into iTunes.</p>
<p><a href="http://www.apple.com/downloads/macosx/automator/quicktimecompressionactionsandworkflow.html">Download Quick Time Compression Actions and Workflow</a></p>
<p>3) Once installed you will have a directory on your desktop called &#8220;QuickTime Compression Workflow resources&#8221;.  In this folder you will find a sample automator workflow called &#8220;Convert videos and add to iTunes&#8221;.  Open this workflow in automator.</p>
<p>4) Delete the first step of the workflow which is &#8220;Ask for Finder Items&#8221;.  Instead of being prompted for which items to convert, we want to setup a folder action that will automatically convert the files dropped in our folder.</p>
<p>5) Add a new first step to the workflow called &#8220;Get Selected Finder Items&#8221;.  This action can be found under the &#8220;Finder&#8221; application.</p>
<p>6) Under the &#8220;Compress QuickTime Using Most Recent Settings&#8221; step change &#8220;Choose directory for converted files&#8221; to the desktop (or any other temporary folder you want to use).</p>
<p>7) Create a new folder on your desktop.  This will be your drop folder, so call it something relevant.  I called mine &#8220;Convert to AppleTV&#8221;.</p>
<p>8 ) Back in automator, click on file and choose &#8220;Save as plug-in&#8221;, choose &#8220;Folder Actions&#8221; from the &#8220;plug-in for&#8221; drop down.  Give the plug-in the same name as your folder.  Select your newly created folder for the &#8220;Attached to folder&#8221; option.  Click save.</p>
<p>9) Since the script will convert whatever file you drop in your conversion folder using the last settings you used in QuickTime you&#8217;ll need to launch QuickTime with a test file and then choose &#8220;Export&#8221; from the file menu.  Assuming you have the most recent version of QuickTime Pro you should have an option &#8220;Export Movie to Apple TV&#8221;.</p>
<p>10) That&#8217;s it!!! Now just close out of everything and drop your files into your new folder and watch as they are converted and imported to iTunes.  It works great to leave your Mac on and then drop a bunch of files in the folder before you go to bed.  When you get to your PC in the morning everything should be all ready to go.</p>
<p>To find out more about folder actions, check this page out:</p>
<p><a href="http://www.apple.com/applescript/folderactions/">Folder Actions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2007/03/23/setting-up-an-automated-workflow-to-convert-files-for-apple-tv-on-os-x/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
	</channel>
</rss>
