Thursday, December 29, 2011

Add Tab Bar Controller in a View instead of a Window

Links used for research while experimenting:

Monday, December 26, 2011

Git Cheat Cheet

Friday, December 16, 2011

Use web analytics as a mirror for your users

The question on you mind may be: What do I possibly have to gain by exposing my website analytics to my users?
Well, if used simply & sparingly, it offers you a chance to engage your users by letting them satiate their curiosity about where they belong in the overall community that frequents the given website.

The following tools are polar opposites in how they decide to track the information that will be exposed but both offer the ability to expose the data and controls for which parts to expose:
  • SeeTheStats - hooks into your Google Analytics account to collect the data and will let you expose it in a controlled manner.
  • Piwik - runs locally on your webserver to collect real-time data and expose it in a controlled manner. You can check this link to find hosts that offer automated installation of Piwik on your webserver. In my experience PowWeb is another host that does this well.

Saturday, December 10, 2011

Provision & Automate free Amazon EC2 instances with Hosted Chef

  1. Sign-Up with Amazon via this link and they will offer one year of usage (micro instance) to help you understand and evaluate EC2. Read their terms of usage carefully and make sure to only provision the free instances if you don't want to get dinged on costs due to ignorance or carelessness on your own part.
  2. Now the free instance image provided by Amazon happens to run RHEL4 but the out-of-the-box Chef-Client requires a higher version of that OS! Luckily some, if not all, of the very same issues have already been tackled in a post on the opscode's help website. And here's a gist of my experience with it as well. In case it is difficult to follow, let me highlight the fact that the modified file that allows you to properly finish the chef-client installation process on the AWS image for Linux was found here: CHEF-2515
  3. Some Notes:
    • Either command works well:
      • knife ec2 server create -x ec2-user -i /Users/xxx/.ec2/ec2.pem --template-file ~/chef-repo/.chef/bootstrap/centos5-gems-modified.erb
      • knife ec2 server create --ssh-user ec2-user -i ~/.ec2/ec2.pem -d centos5-gems-modified
    • I find it crucial to configure the appropriate Amazon security group as part of the instance creation otherwise its ends up using the "default" group. To do this, add it to your "knife ec2 server create" command with "-G groupName" and remember that it can be a comma separated list of security groups "-G secGroup1,secGroup2" if you want. Example:
      • knife ec2 server create --ssh-user ec2-user -i ~/.ec2/ec2.pem -d centos5-gems-modified -G elasticsearch

Monday, December 5, 2011

EC2 Bare Minimum

  1. install ec2 tools
    cd ~/.ec2
    ssh -i /Users/XXX/.ec2/ec2.pem ec2-user@ec2-XXX.compute-1.amazonaws.com
    sudo yum install screen (why?)
  2. For moving data to & from the EC2 instance, simply use scp which runs on top of ssh like so:
  3. A lot of images will flunk all ssh connection attempts! It seems like this has nothing to do with the permissions on the pem file that you use to connect to them or opening up port 22 by default in their security policies. They just don't work even after all that, all the attempts spit out:
    • either, Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
    • or, Net::SSH::AuthenticationFailed
    So don't waste your time on them! Here's a small list of useless ones that you should avoid:
    • ami-31d41658, Red Hat Enterprise Linux 6.1, x86_64
    • ami-8f4083e6, RHEL-5.6-Starter-EBS-x86_64-11-Hourly2