EAFP Coding Style in Python

What is EAFP ?

EAFP (Easier to Ask for Forgiveness than Permission) is a coding style that’s commonly used in Python community. This coding style assumes that needed variables, files, etc. exist. Any problems are caught as exceptions. This results in a generally clean and concise style containing a lot of try and except statements. This technique is really contrasts with common style in many other language like C with LBYL (Look Before You Leap) approach which is characterized by the presence of many if statements.

Installing Varnish with nginx on Ubuntu 14.04

About Varnish

Varnish is an HTTP accelerator and a useful tool for speeding up a server, especially during a times when there is high traffic to a site. It works by redirecting visitors to static pages whenever possible and only drawing on the server itself if there is a need for an active process.

Disabling Apport Error Reporting on Ubuntu

What is Apport ?

Apport is an Error Reporting Service provided by Ubuntu to intercept and analyze crashes and bugs as and when they occur. Crashes and Bugs may sound like bad things, but actually most operating systems will have several a day, and it doesn’t mean your computer is broken, nor does it necessarily stop working. As such, Apport can usually be safely disabled, as it doesn’t fix anything, it just tells developers that something went wrong.

Do Git Pull When Git Push Failed

Don’t you hate it when you’re gonna push your code to git repository and find out someone just push earlier and you must do git pull and re-push again ?

I made a simple and dumb bash script to do a git pull when git push is failed because you need to git pull first. Well, this is the script.