Category: How-To

  • 4 Things I learned from blogging 11 days straight

    I said I was going to blog for 6 months straight but last night after a streak of 11 days I stopped.

    I was at home, and after I moved my things into my new flat, I just passed out. I’ve been plain tired with the start-up, planning for the CSS meet up, an early and long drive from SF to LA, and a touch of jet lag from returning back from NYC.

    But even though the project is a fail, here is what I learned:

    • I learned that you can blog from your smartphone using the WordPress App. This really helped while I was in Brooklyn and didn’t have my laptop.
    • Weekends really suck for a tech blog. My traffic just dropped.
    • Keyword focused-posts and quality posts grow traffic. There is no way around this.
    • A really good blog post can take up 4 hours of your day.
  • Working on the Road

    Here’s how my Friday worked out.

    5:30 am PDT Wake Up
    5:45 am PDT Catch a Cab to SFO

    6:25 am to 6:55 am PDT Work E-mails

    7:25 am PDT Wheels up SFO
    8:30 am Arrive LAX
    8:30 am – 8:55 am Get Ticket for NYC & go through security again
    9:00 am – 10:00 am Log into IM & plan out day

    10:00 am – noon Make the database faster by sending search traffic to prod02, adding indexes where needed and optimizing table.

    12:00 – 12:20 lunch at airport bk

    12:40 – 14:00 Work on Android bug
    14:00 – 14:55 compare SQL_CACHE vs. memcached. Use both? Where?

    14:55 – 15:25 Board Flight; wheels up NYC.

    15:25 – 15:45 Internet Blackout
    15:45 – 18:00 Work on hosting issue for client & registration for business users

    Hours worked: 8
    internet outage: 20 minutes
    miles Traveled: 3,124
    Hours awake: 19.5

  • Commands I Use Frequently

    Here’s a list of commands I use frequently, where the first number represents the number of times I used that command today:

    86 git – the best version control software ever
    59 cd – used to change directories on the command-line
    54 ls – used to list files in a directory
    41 vim – when textmate just isn’t fast enough for moving and manipulating text I use this text editor
    24 grep – this is great for searching through code
    21 sudo – I use this for stopping and starting servers and anything that requires super user access

    I figured this out by using the following:

    history | cut -c8-20 | sort > commands.txt

    I created the following script in Perl:

    #!/usr/bin/env perl

    use strict;
    use warnings;

    my %h_list = ();
    my @sorted = ();
    my @listed = ();

    open(LS, “commands.txt”);
    while() {
    if ($_ =~ /(\w+)/) {
    $h_list{$1}++;
    }
    }

    close(LS);

    foreach my $key (keys %h_list)
    {
    push @listed, $h_list{$key} . “\t” . $key;
    }

    @sorted = sort { $b <=> $a } @listed;
    foreach (@sorted)
    {
    print $_ . “\n”;
    }

  • 3 Creative Ways to Recruit Developers

    Recruiting talented developers in this market is still extremely difficult. How should a recruiter find the talent (PHP, Ruby, MySQL, iPhone, .NET, Java) your clients need? I outline a few creative out of the box solutions below.

    Disclosure: I work as the lead developer at AppDevAndMarketing.com . This article in no way suggests we’ve used any of these methods.

    Update on 4/15/2011: Ya, I’ve had to resort to all these methods and they’ve worked for us. 😀

    1. Turn your project managers, account executives and marketers into coders. This is a fairly cheap investment with a high ROI. It is cheaper than paying out a bounty, and you already trust these folks. Send them to iPhoneDev Bootcamp now! Just be sure to prepare their machines for the development they’ll need to do. I tried this at a previous place of employment with great results! If you were trained by me and are reading this, please ask for a raise.

    2. Look for places not so obvious. Use dating sites to find talent. Ya, I know, you haven’t used that match.com account in awhile, or have sworn of okaycupid.com or JDate, but guess what. For you bleeding edge types, try the iPhone, dating app, Skout. Although s/he might not be the person of your dreams, s/he might have the talent you need. The key take away is to use unexpected social media spaces for recruiting. Don’t be sleazy or sly about it. A simple, “Hi, I read your profile. You seem very talented in X. I’d actually like to hire you. Coffee or drinks?”

    3. Use IRC. If you’re smart enough to do this, you probably shouldn’t be recruiting, but IRC is this best place to find pure, raw talent. Details on how to get onto IRC can be found on Google, but the best guide for newbies can be found on this gaming site. Use reputation defender services to help improve your business reputation and attract reliable talents.

    There’s one more special place that I haven’t revealed that will guarantee you top talent every time. Leave a comment and I’ll contact you with that exclusive place to find developers.

  • 4 Ways to Avoid Foursquare Fatigue

    As a social media expert, I’ve noticed a severe decline in Foursquare check-ins by innovators and early adopters.

    This phenomena, which I’m calling Foursquare Fatigue, can be avoided by following these 4 tips.

    1. Use two phones on different carriers. We all know that AT&T’s 3G blows on the iPhone, so carry a spare phone like a Blackberry running Verizon. That way you get all your bases covered. Can’t check-in with the iPhone? Check-in with the Blackberry. Now you’re stylin’.

    2. You don’t have to check in all the time. Ya, getting the mayorship for Starbucks is huge and forces you to check-in 5 times a day, but after that 5th cup o’joe there’s a diminishing point of return. Why not save money, not check-in. In fact, don’t go to Starbucks.

    3. Check-in with Yelp. Ya, I know. It’s pretty pointless because you don’t get the Foursquare deals, but there’s been less of a reliability issue with Yelp where check-ins are currently faster and less buggy than Foursquare.

    4. I have Stalin, who said, “No person; no problem,” to thank for this one. The discovery I made is this: No Foursquare, no foursquare fatigue.” Logic is magic.

  • How to Get a Good Tech Job

    I love this quote from Mark Suster:

    “Finding the best jobs takes a lot of commitment to taking many different networking meetings with executives, recruiters, entrepreneurs, VC’s, investment bankers, etc. The best jobs (as you know) are found through personal connections. The best jobs are the ones that have not already been put on a job board. The best jobs are the ones that certainly haven’t gone out to an executive recruiter. The reason these are the “best” jobs for you is that once it goes to an executive recruiter there will be a stack of 100 prospective recruits, 20 amazingly qualified resumes that will have phone or in-person interviews with the recruiter of which the company will meet 5-6. So unless your last job is a mirror image of your next then good luck with those odds.”

    Okay, that’s pretty general. What’s a specific example of getting the best job?

    A good example is starting out small. Get a reputation for doing quick tech jobs on weekends. This can be anywhere from:

    • writing a basic facebook app, or wordpress plug-in
    • fixing bugs that you are sure you can fix
    • addressing server issues that you are sure you can fix

    After a string a little successes like these, you can start taking on bigger jobs.

    Recruiters at this point will start knocking at your door. It is not worth it. In my experience, they will fill a position that hasn’t been filled in a long time and with good reason. Also, the fact that your prospective place of work is going through a recruiting agency means 3 things: they are ramping up with hiring and are being quick to hire and slow to fire. There are good reasons not to do this. Another reason is that, they simply cannot recognize talent. If they cannot recognize talent, then they cannot understand you. Misunderstanding is the source of a lot of work grief.

    The 3rd thing that it means is that you are walking into a den of Vampires that will take all your soul and talent and feed off of it. You can find the worst Vampires in large corporations and they are usually project managers, or middle management. It is one thing to let a contractor just get the job done, and another thing to take what they do and keep the glory for yourself. These glory hounds, these vampires should be avoided at all costs. They will burn you out.

    At this point, be sure to be paying your taxes. You should have a nice little consultancy going. Be disciplined. Don’t be afraid to say, “No.” If something doesn’t feel right, e.g. you sign a contract for PHP work but are doing .NET, then drop them. Yes, drop them. Any person with business sense will understand bait and switch is not the way to think long term.

    Two choices will present themselves:

    1. Continue freelancing, or
    2. Focus on one company, e.g. being a co-founder or lead

    The first choice makes sense if you are shooting for the 4 hour work week. The second choice makes sense if you are hoping to turn a company in a few years.

    If you are going for the 2nd choice, then a few things are key:

    • You need to court this company if they’re a hot commodity. This means hanging out with the devs, the marketers, top-level folks. If you’re really good, they’ll just ask you to go for the interview process. But the best jobs are never listed…. therefore…
    • Use the process to understand the company’s true business needs. From those needs list the ways that you can contribute to the company.
    • From that list, you’ve created your position.

    The best job ever is something you create. It is not some laundry list of things someone you don’t know has given you. Your best job ever is your destiny, your meaning of life. Do not settle for less.

  • How To Boost iPhone App Ratings

    This is something I learned from Nirvino.com, the iPhone wine rating app.

    • have an event where you invite iPhone users
    • Make the entrance to the event downloading your app. In this case it was a winetasting
    • Have folks come in and enjoy the wine.
    • Before they leave ask them to rate the app at a set up terminal

    I thought I would be put off by it, but if you approach it in a smooth and non-pushy way, it’s a great way to get more ratings for your app. All of the ratings were positive.

  • WP Geo Plugin

    The print_GeoCache_Url function came across my email today from a self-described local designer and geek, but after a little research, I found out it only works up to WordPress 1.2 . Thank goodness for the WordPress WP-Geo Plug-in which I’m using right now.

    More info here: WPGeo.com

    [wp_geo_map]

  • EC2 Backup Script

    This is a quick and dirty EC2 backup script for virtual unix servers that works just fine when crontabbed:

    #!/bin/bash

    DATE=`date +%m%d%Y-%H%m%M`
    BUCKET=”codebelay-$DATE”
    PRIVATE_KEY=’pk-codebelay.pem’
    PRIVATE_CERT=’cert-codebelay.pem’
    USERID=’555555555555′
    AWS_ACCESS_ID=’AKIA0000000000000′
    AWS_SECRET=’asdf+asdf+asdf+asdf’

    s3cmd mb s3://$BUCKET

    cd /mnt
    mkdir img
    ec2-bundle-vol -d /mnt/img -k /mnt/$PRIVATE_KEY -c /mnt/$PRIVATE_CERT -u $USERID -s 9999 –arch i386
    cd /dev
    mkdir loop
    cd loop
    mknod 0 b 7 0

    ec2-upload-bundle -b $BUCKET -m /mnt/img/image.manifest.xml -a $AWS_ACCESS_ID -s $AWS_SECRET

    # rm -rf /mnt/img
    echo “please register $BUCKET/image.manifest.xml” >> /mnt/registerbackups.txt

  • Part II: Getting to 600 Concurrent Users

    I couldn’t sleep last night. I’m worried we’ll lose this client.

    So just to be clear. I wasn’t part of the crew responsible for scaling this site. I had already set up a scalable architecture for the site, that would automatically and horizontally scale at Amazon. That idea got shot down for legal reasons that to my surprise haven’t been in play for awhile. Can we say, “Office politics?”

    I totally recommend Amazon’s Autoscaling to anybody that’s new to this.

    Instead of auto-scaling, the site was architected by a local San Francisco firm who I won’t mention here.

    Let’s just hope enough people read this so that they won’t even have to know the name of the company and will just know the smell of an un-scaleable architecture.

    Scalability requirement: 100,000 concurrent users

    This is how they set it up:

    • two web servers
    • one database
    • four video transcoders that hits the master database
    • one more app server that hits the master database
    • no slave db 😀

    If they had even googled ‘building scalable websites’ they would have come across a book that would have avoided all of this, Cal Henderson’s Building Scalable Websites. It should be mandatory reading for anybody working on a large website, and it just scratches the surface.

    So, how did we get to 600 concurrent users?

    We tweaked mysql by putting this in /etc/m.cnf:

    [mysqld]
    max_connections=10000
    query_cache_size=50000000
    thread_cache_size=16
    thread_concurrency=16 # only works on Solaris and is ignored on other OSes

    We ran siege and were able to get to about 300 concurrent users without breaking a sweat, but now apache was dying.

    So we tweaked apache. We started out with this:

    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    ServerLimit 256
    MaxClients 256
    MaxRequestsPerChild 4000

    And ended up with this:

    StartServers 150
    MinSpareServers 50
    MaxSpareServers 200
    ServerLimit 256
    MaxClients 256
    MaxRequestsPerChild 4000

    RAM and CPU were doubled.