Posted on November 17, 2008
Stoyan Stefanov has recently written an interesting series of articles on optimising image files for the web. In his latest article he shows how to use pngcrush to safely shrink your files, one file at a time:
$ pngcrush -rem alla -brute -reduce src.png dest.png
This evening I found myself wanting to repeat that command for all the PNG files in my current directory, and then (having reviewed the new images) overwrite the originals. Rather than do it by hand I did what all pragmatic programmers do these days, and wrote a script. Here it is in action:
$ pngcrushall
Crushing test4012.png ... ok
Crushing test9200a.png ... ok
Crushing test9200b.png ... ok
Overwrite original files? (y/N) y
Overwriting test4012.png ... ok
Overwriting test9200a.png ... ok
Overwriting test9200b.png ... ok
You can get it from github – download pngcrushall.
Obviously you’ll need to install pngcrush too. On a Mac this is pretty easy with MacPorts:
$ sudo port install pngcrush
Tagged with: automation |
1 comment
Posted on November 11, 2008
I’ve recently been developing a Rails app that relies on a database that is maintained by another team as part of a different application. As you can imagine, unexpected changes to the database schema can bring our Rails app to it’s knees if they’re deployed to the live server before our application is updated.
So far we’ve been lucky, but the issue has been at the back of our minds for a while. So this week I sat down and cooked up a solution, and we’ve called it Integral.
Integral consists of some Thor tasks that:
- Run tests on your test server.
- Keep track of which versions of your applications work well together.
- Can be integrated into your deployment recipes to ensure that deploying an app should never break your live server again…
All the Integral code is on github, and I’ve written some fairly extensive documentation on the Wiki. Please try it out, give us some feedback, fork it, burn it, give us some feedback, etc. etc.
Tagged with: automation |
0 comments
Posted on April 24, 2008
I’ve been trying to persuade git-svn to work properly with Rails plugins that have been installed via svn:externals. Whilst working out how to do it I stumbled across several great articles, but I couldn’t get any of the solutions presented to work perfectly. Samuel Tesla’s article is especially informative, but for a long time I couldn’t stop git-svn from trying to commit Git metadata back into my Subversion repository…
After a bit of head scratching I got it sorted, and wrapped the process up in a little utility called git-me-up.
Tagged with: automation |
Posted on April 06, 2008
I used to work for a company that was in the business of deploying laptops running Linux into hospitals. We automated the installation of these laptops to such a degree that all we had to do build a new laptop was unwrap it, plug it into an ethernet network and turn it on. We used PXE boot and our own bespoke deployment system to achieve it. It even supported deploying automatic configuration updates over a mobile phone connection, while the laptops were in a different country.
It never seems to be worth going to the effort to setup a tool like puppet when configuring a new desktop computer, a virtual server to run your blog, or a VPS for a small client who is keen to keep the budget down. But why should automation be expensive?
If you like the idea of an automated server build on the cheap, read on...
Tagged with: automation |