2010
07/31

If you have used the iPhone facebook app for very long then you have probably noticed that the app runs quite a bit slower now compared to just after you first installed it, especially posting. The slow-down issue can be fixed by uninstalling the facebook app then reinstalling. That is easy enough but who wants to uninstall and reinstall all the time? This fix is only temporary.

The issue is caused by the app caching all facebook posts, photos and other data, indefinitely. The data is never deleted and each cache file is checked/updated every time the app attempts to post. That doesn’t seem very efficient but, based on my observations, that appears to be exactly what is going on every time the facebook app runs/posts.  Besides waiting for facebook to “fix” their app, there is an alternative, if you don’t mind doing a little one-time setup work as described below.

Note: The following instructions assume you are using an iPhone that has been jail-broken and you have SSH and terminal access to the iPhone.

To permanently resolve the facebook app slow-down issue I created a script that will delete all of the cached files on a scheduled basis. The cached data is really only useful for about a day any way. Removing the cache files has no other affect on the facebook app since all of the data is still stored on facebook. The app will re-download anything it really needs. I chose to schedule the script to run at 4:00am every day on my iPhone but you can modify the plist file below to run at any time you like.

Steps to implement the facebook slow-down fix on your iPhone (tested on iOS 3.1.3):

  1. Find your facebook app GUID by running the following command. The GUID will look something like (B81C7FF4-78B8-4898-8BFC-DA83AFEA8E95):
    find /User/Applications/*/Facebook.app/Facebook

  2. Create a new file named /usr/bin/fixfacebook.sh and insert the following content. Note, you must replace each ?????????? with the facebook app GUID from the previous step. This is the cleanup script:
    #!/bin/sh
    
    echo Removing facebook cache files...
    
    rm /User/Applications/??????????/Library/Caches/Three20/0*
    rm /User/Applications/??????????/Library/Caches/Three20/1*
    rm /User/Applications/??????????/Library/Caches/Three20/2*
    rm /User/Applications/??????????/Library/Caches/Three20/3*
    rm /User/Applications/??????????/Library/Caches/Three20/4*
    rm /User/Applications/??????????/Library/Caches/Three20/5*
    rm /User/Applications/??????????/Library/Caches/Three20/6*
    rm /User/Applications/??????????/Library/Caches/Three20/7*
    rm /User/Applications/??????????/Library/Caches/Three20/8*
    rm /User/Applications/??????????/Library/Caches/Three20/9*
    rm /User/Applications/??????????/Library/Caches/Three20/a*
    rm /User/Applications/??????????/Library/Caches/Three20/b*
    rm /User/Applications/??????????/Library/Caches/Three20/c*
    rm /User/Applications/??????????/Library/Caches/Three20/d*
    rm /User/Applications/??????????/Library/Caches/Three20/e*
    rm /User/Applications/??????????/Library/Caches/Three20/f*

     
    Note: If you are wondering why there are so many rm (delete) commands, it is because sometimes there are so many cache files that the rm command will refuse to delete that many files at once! Running multiple wildcard deletes will avoid this issue.

  3. Create a new file named /Library/LaunchDaemons/com.krahmersoft.fixfacebook.plist and insert the following content. This is the scheduling information:
    <?xml version="1.0? encoding="UTF-8??>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    		"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0?>
    	<dict>
    		<key>Label</key>
    		<string>com.krahmersoft.fixfacebook</string>
    		<key>OnDemand</key>
    		<true/>
    		<key>Program</key>
    		<string>/usr/bin/fixfacebook.sh</string>
    		<key>StartCalendarInterval</key>
    		<dict>
    			<key>Hour</key>
    			<integer>4</integer>
    			<key>Minute</key>
    			<integer>0</integer>
    		</dict>
    	</dict>
    </plist>

  4. Run the following command to make the script executable:
    chmod 755 /usr/bin/fixfacebook.sh

  5. Run the following command to preform the cleanup immediately. Beware, this could take several minutes to run if you have been using the facebook app for a while:
    /usr/bin/fixfacebook.sh

  6. Run the following command to activate the schedule:
    launchctl load /Library/LaunchDaemons/com.krahmersoft.fixfacebook.plist

Please post a comment if you found this information helpful!

Bookmark and Share
3 comments
2009
09/27

I recently had the need to be alerted when my T-Mobile cell phone minutes were running low to help avoid overage charges.  Unfortunately T-Mobile does not offer such a service.  I did some searching on the internet and I could not find anything that would automatically alert me if my minutes were running low. The best I could find was a Firefox plugin that would show your used minutes in the Firefox status bar. Although it worked well and saved me from logging in to my online T-Mobile account each time I wanted to check my minutes balance, it didn’t do what I was really looking for.  I needed a service that automatically alert me so I don’t have to constantly check myself.

A few days ago I decided to write my own program to alert me when my remaining minutes were running low.  I spent a few hours and created a simple script that would check my personal T-Mobile account once per day and send me an email when my my remaining minutes reached 90 or less.  It worked great but I thought there may be others out there in need of the same service.  I thought this would be a great opportunity to contribute to the internet community with a free service that anybody could use.  I spent a few more hours and created a simple database and web application to allow anybody to sign up and configure their own alert criteria.

It’s not the most refined application. It’s pretty basic with limited error checking but it does the job it’s supposed to do.

Check out my T-Mobile Low Minutes Email Alert here.

If you try it and find it useful please let me know by commenting on this blog entry.

Bookmark and Share
1 comment
2009
09/15

To track a package on the UPS web site you must enter one or more tracking numbers and then submit the request. If at a later time you want to check the status of the same packages you must re-entered the tracking numbers, unless you happened to have left your browser open from the previous query.  It would be nice to be able to bookmark a link so you didn’t have to enter the tracking numbers each time wouldn’t it? Well, there is an easier way.

Enter your tracking numbers here to be able to bookmark the tracking page.

You may also be interested in tracking your package via RSS feed.

Bookmark and Share
Add Comment