Bored with your GNOME looks?
August 11, 2008
If you are a GNOME user, uou can do a lot worse than using the Humanoid-Dark-OSX theme.
What is astounding is that even if you consciously try NOT to emulate OSX on your GNOME desktop, it still works
Get it here.
Format String Attacks in a non-C/C++ environment
February 5, 2008
A ton of people are under the impression that format string attacks are only a C/C++ vulnerability (as in, if you code in a different language, you are safe).First, read this article
Second, try this bit of C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FormatStringsC
{
class Program
{
static void Main(string[] args)
{
try
{
// if I was a user inputted string you would be in trouble
String fspec = "{1},{10}";
Console.Write(fspec, "I don’t know but ", " I’ve been told ");
// return 0;
}
//generic catch all
catch (Exception e)
{
Console.WriteLine("Oops! Shutting down app\n");
}
}
}
}
Third, keep watching this space for examples in other languages
Optimizing Joomla Sites for Speed
December 5, 2007
As I have blogged before, I have the dubious honour to work as a web application developer/Linux administrator/general IT “Mr fix-it-all” guy at a Joomla based shop. (hey it pays the bills and it’s not like I will be here for long
). This is essentially a mom-and-pop store with a tight budget so one has to cut corners. In that light, the decision was to buy a linux VPS (Virtual Private Server, for the uninitiated). As my projects are not connected with the Joomla development team, I have left them happily turning one cookie-cutter page after another. Like many other techies, I am a content-over-style person so I felt that the graphics ladden pages were at least atrocious. But hey! its the customer’s wish so they get their money’s worth in .swf animations, animated .pngs, the works.
It came of little surprise when the pages viewed not in our Gigabit LAN but over a run-of-the-mill DSL line where slooooooooooooooooow. Guess who comes to the rescue. Since it is only logical that many other shops fail to hire web monkeys that adhere to web development best practices, I decided to share my experiences in trying to solve the problem (ok, I use the verb solve more in a “band-aid applied over multiple 7.62mm wounds” but I am sure you knew that already).
- When using CSS and Javascript, try to keep them in external files as much as possible (always for you and me). This way, they get cached and you save some precious user experience time by using that.
- PNGcrush is your friend. I cannot stress this enough. Even if you get only a 10% reduction in filesize for each .PNG, they quickly add up. Speaking from experience, I got reduction between 5% and 25% in each file, which was well worth it.
- Since you are using a database to store your content, turn RAM caching on (if you can afford it). While memory hungry (total memory consumption of our server is 280Mb), it gives a tremendous boost. MySQL documentation has an excellent section on how to do this and some consideration/poor man’s benchmarks. I can assume that your database has something relevant (between you and me, while MySQL gets the job done and has tons of support, it certainly is not the pinnacle of technological achievement in the open source database field).
- If you are using Joomla (or Mambo or a similar CMS), try to keep the number of modules to a bare minimum. Each module, even if it is lightweight in actual size, is at least one HTTP request so that bogs the performance down.
So, if you have to face the all-too-common “clueless management with incompetent web designer” syndrome and teaching (enforcing should be a more appropriate term) web design best practices is out of the question, the (kinda obvious, to be honest) tips above might squeeze an ounce of performance or two that can make a difference.