Writing code requires two important things: creativity & discipline. The creativity to create the unknown, unexplored, exciting parts of software. And the discipline to create the dull & all-too-well-known parts of software / documentation.
You may come up with new ways (or use frameworks) to reduce repetitive work. Effectively beating discipline with creativity. But boring stuff will still always be there in some form. And on days when creativity is low, you may need to tap into that jar of discipline so you can still be productive, by doing things you never feel like.
But every now & then, there is a day when bot...
At transloadit we use HAProxy "The Reliable, High Performance TCP/HTTP Load Balancer" so that we can offer different services on 1 port.
For instance, depending on the hostname, a requests to port 80 can be routed to either nodejs for api.transloadit.com, or nginx for www.transloadit.com.
HAProxy has been good to us and setting it up was a breeze. But getting HAProxy to log on Ubuntu Lucid was harder than I thought. All of the tutorials I found either didn't cover logging, or had deprecated information on it.
Google suddenly stopped being my friend.
Today we are very happy to announce the commercial availability of
transloadit.com.
Here the notes I took during the Dutch PHP conference 2010 (#dpc10). They're not a representative
summary of the event's highlights cause I could only attend 1 of 4 talks at any given time.
I also filtered out things that didn't interest me personally.
When you're debugging a tough problem you sometimes need to analyze the
HTTP traffic flowing between your machine and a webserver or proxy.
Sometimes you can use firebug or chrome inspector for that. But here's a
lowlevel alternative that I'm pretty excited about. Meet Tshark.
Some time ago I was in the situation where I was looking at 200 MyISAM tables
screaming to get converted to InnoDB for performance reasons.
You probably know that MyISAM is better at fulltext searches and such,
but what I needed was this database stop locking entire tables when I was
just doing row-level interactions. Here's how I did in one go.
Don't know Redis? Think Memcache, with support for
for lists, and disk-based storage.
You can use Redis as a database, queue, cache server or all of those combined.
Let's see how you can use this power in your PHP apps.
If you want to do command-line MySQL administration like restoring databases
or dumping statistics, you need the root account and it's password. Or do you?
I still got sites running Apache, but all new projects are launched with Nginx. I don't need many of the features that Apache offers, and the speed gain of Nginx is just tremendous. Once you've experienced it, I doubt you'll want to go back.
At our company we have a lot of uses for a solid API. We can use it to distribute config files, have servers report in, let customers edit DNS records using their own interface, etc. Now that I'm converting all of our legacy code to a big CakePHP application, the API needed a revisit as well. I chose to use REST as a standard, read about everything related to Cake & REST, and started hacking on a reusable plugin. The idea is that you can drop it in any application and unlock existing functionality to REST with minimal changes to your code.
The core of our new project runs on Node.js. With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But how do you make it run nicely in the background like a true server?
When migrating projects over to GitHub, I found there were still some passwords inside my SVN repositories. Obviously it's not good practice to store your passwords in a code repository - let alone at a remote location, so I wanted to replace all passwords. Not only in the current version, but in all commits that have been made over the past 3 years. Luckily with Git - you can.
Hi. Have you met KvzHTML? It's a standalone PHP Class for generating HTML. It's been hiding deep inside the caverns of my secret GitHub repo: kvzlib - a collection of code snippets too small or unfinished to deserve their own repository. But I find working with this class so pleasant, I thought I'd share the fun.
Today I've moved all of my SVN repositories over to GitHub. 5 private reps and 4 public ones. Two of which you may know: PHP.JS and System_Daemon.
If you store application data in memcache, you may want to invalidate it once you deploy a new version to avoid corruption or weird results. There are several ways to do this but I recently tried one using nothing but BASH, and I like it.
PHP 5.3 is a big leap forward for PHP and brings of a lot of neat features. However, big leaps can also mean big changes and potentially big breakage when it comes to backwards compatibiltiy. I did some experimenting with running a big legacy application and a CakePHP application on PHP 5.3 and would like to share my findings with you. Here are a couple of tips to prepare your code for PHP 5.3
Looking back at a great CakeFest in Berlin, I learned a lot about CakePHP and met many nice and inspiring people. Here are some conference notes I took that where particularly useful or new to me.
IDs are often numbers. Unfortunately there are only 10 digits to work with,
so if you have a lot of records, IDs tend to get very lengthy. For
computers that's OK. But human beings like their IDs as short as possible.
So how can we make IDs shorter? Well, we could borrow characters from
the alphabet as have them pose as additional numbers....
Alphabet to the rescue!
If you are in IT professionally (coding or sysadmin) you will be staring at monospaced fonts for many many hours a day. So it's probably justified to spend 2 minutes picking a very good one. It can make your work (typing ; ) just a little bit more pleasing.
I had some difficulties playing Flash videos lately. Problems ranged from lagging sound, to ugliness, to idling black screens, to strange gray Play buttons that didn't do anything. The following solved my Flash issues on Ubuntu.
Pictures say more than a thousand words. This is true for your data as well. With Google Chart you can now easily generate charts of your data. No expertise required. Just make sure you format your data correctly, add it to the Google Chart URL, and it will return a nice graph.
Sometimes MySQL needs to work hard. I've been working on an import script that fires a lot of INSERTs. Normally our database server handles 1,000 inserts / sec. That wasn't enough. So I went looking for methods to improve the speed of MySQL inserts and was finally able to increase this number to 28,000 inserts per second. Checkout my late night benchmarking adventures.
With all the abstraction layers between code & database, and now with my recent CakePHP adventures: The need for writing SQL statements deminishes. But over the years I've developed my own way of formatting them. And before I'll have to wave queries goodbye forever ;) I just want to put it out there.
If you've written a PEAR package, it's probably a good idea to submit some end user documentation. Here's how to do it.
So I've been learning CakePHP the last few days. Bit by bit I've been trying to port a lecagy admininistration app to Cake. 'Secretly' linking menuitems to finished Cake parts as we go. And I must say: I'm pretty excited. I did run into a disturbing conclusion though. I estimated the legacy app will have over 300 Models & Controllers once finished. That could easily add up to (300 x 4 =) 1200 views. And here I am, creating a maintenance hell while trying to solve one!
Everyone knows PHP can be used to create websites. But it can also be used
to create desktop applications and commandline tools. And now with a class
called System_Daemon, you can even create daemons using nothing but PHP.
And did I mention it was easy?
Following Alan Pope and Christer Edwards, I too felt the need to log everything I that I setup right after an Ubuntu Desktop install. It ranges from customizing the user interface to setting up a programmers IDE. It's mainly for future reference by myself, but may bring you on a couple of ideas as well.
Recently I needed ogg123 on an Ubuntu server to convert some media. Naturally, I wanted to use aptitude to install it, but I didn't know what package it was in. Now, you can always google of course, but you can also use system commands to find the package you need.
Hi there. I'm making use of RSS feeds more than I did before. This has to do with Google Reader - which is very neat - and a lack of time. Having sites keep ME up to date, is way more relaxed than scouring the web myself. So I figured I might want to return the favor and make my blog a bit more accessible by introducing two new feeds.
One error that has bugged my Eclipse PDT for a long time, was org.eclipse.emf.ecore.util.EcoreEMap $DelegateEObjectContainmentEList. A vague error, not much to go on, not many hits on google either. Turned out it had to do with the version of my Java Runtime Environment I was using.






tagcloud