Category Archives: Perils of Software Development

Remove ._ files from Mac OS X

Run this command on the terminal to remove every ._ file created by Mac OS X on the current path and its descendants: find . -name ‘._*’ -deletefind . -name ‘._*’ -delete

Replace tabs by space on git history

So, I prefer spaces, and when I press tab, it should instead write 4 spaces. I forgot to set this option on Sublime Text and did some commits with tabs. The following git command will rewrite the repo history and replace tabs by 4 spaces. git filter-branch –tree-filter ‘git diff-tree –name-only –diff-filter=AM -r –no-commit-id $GIT_COMMIT […]

memcached monitoring and statistics

I wanted to know, overtime, how many cache hits and misses my instance was getting. Searched a lot and finally found this perl script: http://code.google.com/p/memcache-top/ Usage is very simple. Save the file, give it execution permissions, then just run: ./memcache-top.pl –commands –cumulative Here’s an output example: Seems like I’m doing fine, caching the right parts! […]

Apache + mod_wsgi + Django + lighttpd

I’ve written how to configure Apache, mod_python and Django and how to put lighttpd behind Apache. Recently I decided to host my most visited website on a different VPS provider[1], and started a quest to update my knowledge about Django deployment. I did things differently this time, using mod_wsgi (the recommended way of deploying Apache […]

Wikipedia with just links

So I just read how Britannica is planning a new website version, mostly to “compete” with Wikipedia. Britannica’s CEO also talks about the relationship between Google’s results and Wikipedia’s pages. Anyway, one criticism is valid, sometimes Wikipedia articles are not the best source of information about a topic. And this is being written by someone […]

How the fuck is trim in Python?

HTFITIP is a website where you can see what a function from one language is called in another (or an implementation). The idea came to me after the eleventh time I asked myself, how the fuck is trim in Python? It’s called strip by the way. The website is very simple. On the front page, […]

Easy sharing of screenshots

I like having ideas. Specially when I am a little unhappy on the daily job. I start dreaming how cool would be to have my own company (I will someday). And then I start thinking about what my company will do. Or what software it’ll make. Most of the time it is games, but recently […]

Lighttpd with Apache

One of my websites is experiencing phenomenal growth and after optimizing the database queries and using memcached, I decided it was time to use another webserver to serve static media. Here’s how to do it. I recommend that you take a look on a previous post that I wrote about how to configure a webserver […]

I am not amused

I am working on a codebase developed by an ex-employee, correcting code like: 1 2 3 4 5 6 7 8 9 10 $x = $y = 0; while ($x < $interval + 1) { $looped_date = date(’Y-m-d’, mktime(0, 0, 0, date(’m’), date(’d’) + $y, date(’Y’)); $formatted_looped_date = implode(’/’, array_reverse(explode(’-‘, $looped_date))); $looped_date = implode(”, array_reverse(explode(’/’, […]

Django on SliceHost Virtual Private Server

I’ve recently moved my Django websites from Dreamhost due to poor FastCGI performance to the 256 plan option from SliceHost. If you sign-up with them, please use “[email protected]” as your referral. I have no idea how much they pay for referrals, but any money is good money 😉 Here’s my guide: Sign-up to SliceHost Painless […]