Since I read about Green Unicorn, better known as gunicorn, a Python WSGI HTTP server that goes along very well with Django, I knew I had to try it, and trying it I did. And I liked it. There were many steps to make a server work but overall it was cleaner than other approaches, including the Django deployment using Nginx, Apache and mod_wsgi that I described long time ago. And many reports indicate that a Django setup with gunicorn performs better than one using Apache.
But when you have to setup many servers with the same configuration, the process gets boring and repetitive, and when you're bored you make mistakes. This is the perfect scenario for automating with Python and a Fabric script.
One of the most used functions in Drupal's database abstraction layer is db_query, which allows passing an SQL string and corresponding arguments to send a query to the database. I'll give you a quick overview of how db_query works before showing you how to drupalize a query such as:
SELECT field1, field2 FROM table_name WHERE field1 IN (value1,value2,...)
If you write web applications you may already be using a version control system to keep code in sync between your servers, but what about your MySQL or PostgreSQL database?
Sure, there is replication, one master database server with one or more slaves is a possible case, but that may be overkill for most simple projects. You just want to make sure the database is the same in your development, staging and production servers at a certain time, like after some major changes in code or before a new release.
Worry not my friend as you just need a few quick commands to keep your valuable data in sync. Yes, it's command line time again.
Your time is valuable and you need valuable content in your Twitter timeline. Here some reasons why you should follow me on Twitter:
- I just share knowledge and ideas that I think may be helpful for my followers.
- I spend a lot of time teleworking, programming, designing and consulting on Internet projects. Many useful thoughts from all that turn into tweets.
- I like to watch good movies, listen to great music and enjoy the best books I can find. Even if your tastes are different than mine you may find something worthy.
- I follow a very small group of very interesting people. You may find some very smart guys and gals thru me.
- Once in a while I may have a few questions that you could answer. I may retweet your answer and we both can help a lot of people.
- If I find your tweets valuable I may follow you. Many of my followers could do so as well.
- We can become good friends and possibly collaborate on a project later.
- I keep personal messages in private and won't clutter your timeline.
- I tweet in both English and Spanish. If you're learning either of those languages this is a good way of doing it.
- I try to keep updated on the latest news all over the world. You may hear it from me before you watch it on TV or read it on news sites.
- Finally, I have a good sense of humor so you can mock me and I won't send my goons to your house, or nearest ISP.
Wanna try? Follow me on Twitter
Versión en español: ¿Porqué debes seguirme en Twitter?
I signed up for my first web hosting account back in 1998, a shared plan with 20 Mb. of disk space and five mailboxes running in a Windows NT 4.0 server. At US$ 72.50 per month it seemed like a good deal at the time.
Two months later, with a couple of hundred dollars less in my pocket, I started searching for other options. I moved from Windows to Linux and then tried many providers in shared, reseller and VPS plans.
In 2001 I leased my first dedicated server and started a web hosting business that grew to six servers and more than 500 clients in ten countries. In 2006 I decided to move on, sold the hosting business and bought a server for my own projects that I colocated in a Los Angeles data center.
During all that time I worked in dozens of web development projects hosted in lots of different configurations. Obviously, I've had enough of hosting experiences to know when a provider delivers and is developer friendly. JaguarPC is such a provider.
By the end of 2007 I decided to buy a nice little gizmo for my 6 years old daughther, a tiny 7" laptop manufactured by Asus called the Eee PC 701. Nintendo had started with the funny sounding names a year before when launching the Wii.
Many thought there was no space in the market for a new kind of laptop. Boy they were all wrong, a couple of years later we have a new category added to the usual desktop and notebook line up, there are netbooks all over the place and if you're serious about web development you should be ordering yours just now. This is why.
In the old days everybody making his life online knew content was king. The best sites were those with the most useful information and well written articles attracted loyal, often educated, audiences. Nobody cared about fancy Ajax based widgets, clicks on ads or lots of links to social networks and bookmarking services.
Indeed, content and good writing were important back in the oldies.
Then, around 1999, blogs became the next big thing and suddenly everybody was adding tons of garbage to the Web. King Content started a long and painful death in the hands of zillions of bloggers due to many reasons, I'd like to share just five of them. This is why I think blogging is killing good content.
While I was writing a new article about why every web developer should buy a netbook in his arsenal, writing that happens using my tiny daugther's Asus Eee PC 701, I was quite tempted to buy the newest star in Asus line of netbooks: the Asus Eee PC 1000HE.
At US$ 389, with a 10" screen, 1 Gb. of RAM, 160 Gb. hard disk, improved keyboard and the promise of more than 9 hours of battery life looks like a great deal.
I had it already in my shopping cart but then I made a few numbers and decided not to complete the checkout. The reason? I have two daughters now. Beatriz is seven and lovely little Catalina arrived just a couple of weeks ago.
Obtaining the much desired wife acceptance factor of one is more difficult than ever and the finance crisis, worldwide now, doesn't help either.
So, what a man/web developer/father's got to do? Well, ask for a little help from his friends, I guess.
I've created a Chipin account to raise the funds for my new Asus Eee PC 1000HE, see the nice widget above. I'm sure some of my articles may have helped some of you in the past so if you want to put a few bucks in the tip jar I would really appreciate it. Let's see how it goes.
Come on! Admit it, you spend endless hours in front of a computer, really love what you do and are a geek but once in a while you need to escape from all that work and relax a little. Here's my take on the 8 funniest websites I use to get my daily fix.
Warning: start reading late in the afternoon or you could lose your whole day.
After a few Drupal 6 projects where I had to create themes from scratch, including my recently released Woodpig theme for Ventanazul I've learned a lot and decided to gather some tips I'm sure will help you, my fellow Drupalist, when turning your next design into a functional Drupal managed site. Sounds good? Let's dive into the powerful Drupal 6 theme API.