Linode vs Digital Ocean

Digital Ocean* is relatively new in the cloud hosting industry but is getting a lot of serious attention as of late mainly because of its price and SSD hard drives. There are also a lot of stuff going on at Linode* lately where they are upgrading their hardware, double the RAM and faster network. Let’s take a closer look between them in terms of resources/price.

For comparison, we will use Linode 1GB plan and Digital Ocean 1GB Droplet.

Pricing

Linode:

  • CPU: 8 Cores
  • RAM: 1GB
  • Storage: 24GB
  • Bandwidth: 2TB
  • Pricing: $20.00

Digital Ocean:

  • CPU: 1 Core
  • RAM: 1GB
  • Storage: 30GB SSD
  • Bandwidth: 2TB
  • Pricing: $10.00

Pricing wise, DO wins hands down. 1/2 the price of Linode but still offering 30GB of SSD storage. With $20, you can get 2GB RAM, 3TB bandwidth and 40GB of SSD storage with 2 CPU cores.

Performance

There is a detailed performance benchmarking between Linode and Digital Ocean by Jason Ormand and also bits and pieces can be found on Hacker News.

  • Network: Linode has better network connectivity compared to DO as mentioned here on Hacker News. Currently, there is no internal network for DO droplets but is coming soon.
  • CPU: All Linode’s plans come with 8 cores so Linode clearly has an upper hand in terms of CPU performance.
  • I/O: All DO’s plans come with SSD storage so it’s blazing fast. DO wins hands down.
  • RAM: DO is slightly better in RAM speed compared to Linode.

If CPU performance is important for your app or if your servers need to communicate internally (e.g. separate app and db server), you should go with Linode. Otherwise, DO gets my vote.

Others

  • Data center: Linode has more options compared to DO. Linode: Newark, Atlanta, Fremont, Dallas, London and Tokyo. DO: New York and Amsterdam.
  • iPhone app: Linode has one and it’s really convenient to manage your servers on the go.

Support

I can’t speak on behalf of DO as I’m not one of their customers yet but I can speak highly for Linode. I’ve been with Linode for more than 4 years and their support is second to none. Their response time is usually less than 3 minutes and their support staff know what they are doing.

Benchmark

Here is a nice post written by Remco Bron comparing EC2 vs Linode vs Digital Ocean. For $20/month, Linode clearly gives you a better performance thanks to their 8 cores CPU but I expect Digital Ocean to catch up very soon.

Conclusion

I still think (as of writing) Linode is more suited for production while Digital Ocean is great for development. Feel free to chip in in the comments below, especially you have experienced both Linode and Digital Ocean.

*Note: My referral link. Sign-up using my link if you think this post is useful, I would appreciate the referral.

 

Sublime CodeIntel Configuration for virtualenv

If you are using Sublime Text 2, Sublime CodeIntel is a must have plugin. It provides code intelligence for languages ranging from Python to Javascript with features like code autocomplete and jump to symbol definition.

Working with virtualenv

It supports Python default installation out of the box but if you are working with virtualenv, then you will need to manually configure CodeIntel to pick up your virtual environment.

Configuration files are located at ~/.codeintel/config or project_root/.codeintel/config (you might need to create this yourself). Change the config file like so:

1 2 3 4 5 6 7
{
"Python": {
"python": '~/.virtualenvs/your_env/bin/python',
"pythonExtraPaths": ['~/.virtualenvs/your_env/lib/python2.6/site-packages',
]
},
}
view raw config hosted with ❤ by GitHub

The example above is based on my virtualenv setup, yours might be different. So, please change accordingly.

Managing Django Static Files on Heroku

Deploying and running Django apps on Heroku is really a no-brainer, except for one thing — serving static files via collectstatic.

I run collectstatic as usual, using heroku run command just like how I did it for syncdb. It worked but I’m getting 404 error when serving static files.

It turns out that running collectstatic via heroku run spins up a new dyno and collectstatic is running in an isolated environment. So, all the collected static files are deployed to that location and only for this new dyno and the dyno attached to our Django app can’t access that. — Heroku support staff

Solution

The dead simple solution would be to run collectstatic as part of the Procfile before starting the app. We need to “chain” together our Procfile commands for the web process, like so:

1
web: python my_django_app/manage.py collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=0.0.0.0:$PORT my_django_app/settings.py
view raw Procfile hosted with ❤ by GitHub

OK there you go, no more 404 error when serving static files from your Django app on Heroku. Plus, every time you deploy your app, newly added static files will be collected automatically.

Update

There are a lot of questions about the configurations. Cross check with my settings.py here http://pastebin.com/H43gRKsJ

Important thing here is your STATICFILES_DIRS. Make sure to include your project_name/app_name/static here. In my case, I have project_name/staticfiles for the STATIC_ROOT. Change STATIC_URL = ‘/static/’ if you want to serve from Heroku, same goes to ADMIN_MEDIA_PREFIX = ‘/static/admin/’

Finally add this to your urls.py in order to serve from Heroku.

urlpatterns += patterns(”,
(r’^static/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: settings.STATIC_ROOT}),
)

Files could be access as such:

/app/project_name/staticfiles/style.css > http://flaming-fire-999.herokuapp.com/static/style.css

/app/lib/python2.7/site-packages/django/contrib/admin/media/css/login.css > http://flaming-fire-999.herokuapp.com/static/admin/css/login.css
Please note that this is not the best way to serve static files but it works. One last thing, you still need to go through all these things if you are using django storages and django compressor to serve static files via Amazon S3 because django compressor needs a temp file system cache on Heroku.

Start-Up Chile: Want to Make The Cut? Here Are Some Advice

The 3rd and final round of Start-Up Chile 2011 application is now open. If your startup is still in “alpha/beta” mode, you are highly encouraged to apply (even your startup is not, do apply). My startup, Flvrd (still in beta mode) was one of 154 startups around that get selected in the previous round.

If you are applying or think to apply, one of the questions that usually goes through your mind is: “Is it hard to get into Start-Up Chile?

Well, honestly I don’t think it is hard based on Flvrd’s application but it is getting tougher from round to round because more and more startups are applying. FYI, Round 1 (329 applications, 110 startups selected) and Round 2 (650+ applications, 154 startups selected).

But there are a few important areas that I think you need to really focus on. So lets go through those (together with my personal advice) by looking into the judging criteria.

  1. Human Capital (weight: 33%): quality of the talent and commitment of the founding team members.
  2. Project (weight: 34% – composite): Strategy, differentiation, and innovation factors of the product/service purported:
    • Product/Service (weight: 17%)
    • Market (weight: 17%)
  3. Environment (weight: 33%): Value of the founding team’s networks for the Chilean entrepreneurship ecosystem.

Human Capital

They are looking for an awesome team. All startup incubators are looking for the best team and not the best idea. So make sure you have an awesome team — good chemistry, work well together, complementary skill sets and some impressive stats about the team members.

In brief, the Flvrd Team: Flvrd has two co-founders (Koekoe and I) with complementary skill sets. We have known each other for more than 3 years and we work together on projects and group assignments during our time in university. We have also participated and won in a number of international tech and entrepreneurship competitions while in university. Bonus: we are a couple.

How about a single founder? Well, to my knowledge there are a number of single founder startups that got accepted. So if you are alone, your Start-Up Chile dream is not dead, never. There are other factors which are more important than this. So don’t worry.

Project

This is all about your idea/product and they are looking for globally scalable ideas/products. If your idea is super local and could not be replicated in other countries, you might want to rethink your idea.

I don’t know how well Flvrd scores under this section but if you don’t have a world changing idea/product — I don’t think this will put you in a disadvantaged position. FYI, Flvrd is neither a world changing idea nor follows the blue ocean strategy. We just do things differently.

But It is important to have a working prototype. It shows your commitment and also your execution. Remember the popular saying? “An idea is nothing without execution”. So having a real product where you and your team have been working on for some time is a huge plus.

A pitch video is also important in the case where the judges didn’t get the picture of what you are doing, a KISS video will help you explain your idea/product. FYI, we spent more than a week working on the pitch video but well worth it.

You are also required to answer questions related to your startup’s execution and business plan. So, make sure you know what you are doing, what is your plan, the market, competitors, etc. You have to do some basic research to answer these questions well — don’t assume!

Side note: The best way to keep up with your market and competitors is to follow tech and startup blogs like TechCrunch, Mashable, ReadWriteWeb, The Next Web, VentureBeat, etc.

Environment

This is where they want to know how you can contribute to the Chilean entrepreneurship ecosystem by leveraging on your skills, experiences and your networks. So, it is good to have an established network back home so that you can link them to Start-Up Chile and Chilean entrepreneurship culture/ecosystem as a whole.

Bonus: Make your application stands out and the best way to do it is through video.

So, there you go some tips and advice for startups applying for Start-Up Chile. Feel free to ping me if you have any questions.

Reminder: You have until October 27th 2011 to make the cut. Act now!

Hello WordPress, Bye Posterous

I’ve been switching back and forth between various blogging platforms  — WordPress, Tumblr and Posterous. If my memory serves me right, I started off with WordPress, then Tumblr, and back to WordPress before ended up with Posterous. Now, I’m back on WordPress.

Past few months, I’m contemplating a move from Posterous for two reasons — speed and flexibility.

  • Speed — Posterous is slow, and getting slower after they roll out Posterous Spaces. Back in the early days when I started using Posterous, loading my blog and the blog management pages is pretty fast but now, speed bump everywhere. Try search for posterous is slow on Google.
  • Flexibility — Posterous’ simplicity is great, but because of that it’s not very flexible. You can’t embed Javascript snippets and do much modification besides the look and feel. Those like me who want more control, a self-hosted WordPress is a better choice.

So, it’s time to switch back to a self-hosted WordPress blog and here I am. Now I’ve total control over every aspect of my blog from the speed to the look and feel. If you are wondering how I migrate from Posterous to a self-hosted WordPress, check out this post by Antonio Cangiano.

Flvrd Joining Start-Up Chile

Woot! Flvrd (my first real startup project) will be joining Start-Up Chile with 153 other startups from around the world. You can read the official announcement here and Flvrd’s own blog post.

I’m ecstatic. I started Flvrd as a personal project while learning Python/Django. Then, it became a startup project when I decided to make it public. Now with the help of Start-Up Chile, I can make it my real startup sooner than later.

This is a once-in-a-lifetime opportunity and the stepping stone to my life-long entrepreneurship journey. I finally get to experience what entrepreneurs call “the startup culture”. I’m looking forward to meet the other participants from all around the world and those dedicated people behind Start-Up Chile.

See you!

Django “Global” Template Variable

Depending on the project you are working on, you might want to access one or more template variables across all your templates like the User object. If you are making news or blog project, one example would be navigation bar item, say a category list.

You might be tempted to pass the category list from your views or create a template tag for that; but that just violate the Django’s DRY principle. So the best way would be through custom context processor. Writing your own is actually very easy.

1. Writing the context processor function.

You can put this function anywhere in your project. My preference is to place this code inside a context_processors.py file under the related app.

1 2 3 4 5 6 7
# The context processor function
def categories(request):
all_categories = Category.objects.all()
 
return {
'categories': all_categories,
}

Note: Each context processor must return a dictionary and takes only one arguement, HttpRequest object.

2. Point it to your TEMPLATE_CONTEXT_PROCESSORS in your settings.py file.

1 2 3 4 5 6 7 8 9
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
# ...
"yourapp.context_processors.categories"
)
view raw settings.py hosted with ❤ by GitHub

Now categories is available for use in all your templates.

Done!

Flvrd and What I’ve Learned

Flvrd, a project I’ve been working with @koekoecrunch for the last four months has finally launched on May 18, 2011, about a week ago. You can read the launch announcement here. Have been fixing bugs and pushing updates for the past week, so a little delay here. Anyway…

Some History

Before Flvrd, I’ve been poking around with two projects — a casual Facebook game (codename Traveloot) and a location-based looting/scavenging mobile game (codename Lootpop). I abandoned Traveloot because at that time, the Facebook apps platform is very buggy. So I pivoted the concept (of looting “virtual” items) to Lootpop. While working on Lootpop I learned a decent amount of Objective-C and iOS programming but what makes me abandon this project is because it’s a little too much to take for a person who is learning new stuff. My takeaway here is, if you are learning new stuff (programming languages), work on something that is simple and interest you, period.

Back to Flvrd

So, I had this idea… jump straight in and start coding (Why? See my bottom line). The idea of Flvrd has been “refreshed” and simplified several times during the development period. The original concept was about expressing comments without the need of words. You use “flavors” to express your thoughts (what I try to solve is to reduce comments that are rubbish and spam). So, long story short, Flvrd is now what it is — flavoring pictures or videos with flavors using flavicons. Simple yet fun.

What I’ve Learned

After four months of hacking and hustling…

  • Learned Django (and Python) and some Javascript + JQuery.
  • Level up my CSS.
  • Learned and relearn sysadmin stuff (setting up servers, config, etc)
  • Launched a real project/product to the World.
  • Starting a web startup is NOT easy BUT cheap (and I’ve nothing to lose, just my time)

Bottom Line…

So entrepreneur wannabe, if you have an idea, just do it and start hacking! Stop worrying whether your is good or bad, whether there is a market for it or whether the world will use it or not. You can spend time all you want finding the perfect market, writing a 100+ pages of business plan or validating your idea so it could be the next Google or Facebook. BUT, the only thing that matter is your product or prototype. Why? Because you are nobody and just a wannabe. People don’t give a damn about your idea or your sugar coated, well crafted business plan unless you are somebody. Really… seriously. So, don’t waste time worrying, spend time working on it. Need more motivation? Read this.

BTW, you… get flvrd now.

Announcing: Fryday App

Today, I’m happy and proud to announce the launch of Fryday an experimental project by @koekoecrunch and me, @matthewphiong.

Fryday What?

Fryday Logo

Fryday is a web app that let you express your anger, frustration, hatred, outrage or whatever negative on Friday. Yes, just on Friday. It allows you to post your messages, pictures, videos or voice screams securely (secured with bank-level data encryption). You’ll be able to share with your friends, your selected friends and have a good laugh about it.

One common use of Fryday is to take a picture of your boss, doodle on it (uhmm… like “Stop throwing me work you bitch! It’s Friday, Friday, gotta get lost on Friday”) to release your anger and then upload it to Fryday. You can select which friends to share with and have a LMFAO!

Why Fryday?

As we all know, Friday is the most tense and frustrating day of the week. This very day that is all about work, work and work and deadline, deadline and deadline. When we are all excited and planning our weekend, Friday will come and spoil it. So, we really can’t stand Friday and because of that we really want to FRY it! Hence Fryday was born.

Oh BTW, Fryday (the name) is highly inspired by Rebecca Black’s Friday. Thanks Rebecca! We ♥ your Friday.

Fryday FYI

We have been working on this on and off for more than 6 months now. Here are some unbelievable and shocking stats (even we are shocked!)

  • 1000 litres of sweat drained.
  • 100 kilograms of caffeine consumed.
  • 500 SMS sent.
  • 250 papers wasted.
  • 25 Fridays wasted.
  • 500 kilograms of chocolate strawberry cakes consumed.
  • And most recently… 100 hours of Rebecca Black’s Friday!

Excuse us if Fryday is not as good as it sounds or hyped. FYI I’m learning Django and Koekoe is learning Illustrator while building this app, we are still very noob. We hope this app will make you feel as good as having a delicious chocolate strawberry cake on Friday. Anyway, we hope you don’t hate it :)

P.S. Happy 1st of April :)

KTHXBAI,
matt & koekoe
ireallyhatefriday@gmail.com

Price War: Linode vs Amazon EC2 vs Rackspace Cloud Servers vs Windows Azure Virtual Machines

Updated: 

  • 18 September 2012. Slicehost is now Rackspace Cloud Servers and added Windows Azure.
  • 31 October 2012. New EC2 price.
  • 10 April 2013. Linode NextGen specs.

It’s time for a “cloud” war but on the pricing side. So what is the real price per month between the four most popular cloud/VPS hosting providers? Which one has the best value for money? Let’s find out with a simple resource/price comparison below.

Again, the contenders are:

I’m currently hosting a few blogs and websites on a Linode 1024 plan (1024MB RAM). The incoming and outgoing bandwidth are approx. 70GB and 140GB respectively/month. So I’ll use these data in the calculation for EC2, Cloud Servers and Azure Virtual Machines and assumes 730 hours of service/month.

The Numbers

For Linode, the price is fixed with preallocated storage and transfer with free incoming traffic.

Linode 1024 Plan

  • CPU: 8 Cores
  • RAM: 1024MB
  • Storage: 24GB
  • Transfer: In (Free), Out (2048GB/2TB)

Price/month: $20.00

Note: Linode has upgraded all of their plans with better hardware, network and double the RAM for the same price (actually it is $0.05 more for all plans). You can read more about their NextGen of Linode on their blog: NetworkHardwareRAM.

Amazon EC2 Micro Instance

Price varies between regions, we’ll use the cheapest one.

  • Instance/hour: $0.02
  • CPU: 1 Core
  • RAM: 613MB**
  • Storage: EBS storage only ($0.10/GB), say we use 20GB
  • Transfer: In (Free), Out (First 1GB is free, subsequent GB up to 10TB is $0.12/GB)

Note: EC2 Micro instance doesn’t come with instance storage, that is why we need to use Amazon EBS.

Instance/month: $14.60
Storage/month: $2.00
Transfer (In)/month: $0
Transfer (Out)/month: $16.68

Price/month: $33.28

Rackspace Cloud Servers

  • Instance/hour: $0.06
  • CPU: 1 Core
  • RAM: 1024MB
  • Storage: 40GB allocated
  • Transfer: In (Free), Out ($0.12/GB)

Instance/month: $43.80
Storage/month: $0
Transfer (In)/month: $0
Transfer (Out)/month: $16.80

Price/month: $60.60

Windows Azure Virtual Machine XS

  • Instance/hour: $0.013
  • CPU: Shared
  • RAM: 768MB**
  • Storage: Locally redundant storage ($0.095/GB), say we use 20GB
  • Transfer: In (Free), Out (First 5GB is free, subsequent GB up to 10TB is $0.12/GB)

Note: The free first 5GB outgoing transfer only valid until 30 June 2013. More here.

Instance/month: $9.49
Storage/month: $1.90
Transfer (In)/month: $0
Transfer (Out)/month: $12

Price/month: $23.39

So we have it: Linode ($20.00), EC2 ($33.28), Cloud Servers ($60.60) and Azure VMs ($23.39)

Here, the clear “winner” is Linode*. But again, this is not really an apple-to-apple comparison because the VM’s performance is not taken into consideration. But in terms of specs and resources, Linode came out top. Linode is more superior in terms of hardware with 8 cores of CPU and very generous with their outgoing bandwidth, 2TB. But please take not that having more cores doesn’t mean more processing power.

Conclusion

As noted here, go for cloud if you want to run your stuff for a short period of time (few hours or days. You can still use Linode and get credited for the unused time for the rest of the month), CPU intensive stuff or web apps that have unpredictable load and need to scale up and down easily and quickly. If you want to host a blog or website (long-term) go for VPS. I would recommend Linode* over the rest. It’s really hard to argue when comes to hardware and price/resources. It’s simply the best bang for the buck. I’ve been with them for many years now, great support (usually less than 3 mins response) and great performance.

*Note: My referral link. Sign-up using my link if you think this post is useful, I would appreciate the referral. Otherwise, just hit linode.com in your address bar.

**Closest available RAM option to 1GB.