Feb 24 2010

Optimize your PNG’s with OptiPNG

Category: UncategorizedBrian Racer @ 5:39 pm

Here is a quick shell command tip to run all your PNG files through the file size optimizer OptiPNG. Since PNG is a loss-less format quality stays exactly the same and file-size shrinks! I install optipng via MacPorts via the following command:

sudo port install optipng

In this example, public/images is the directory I want to search for PNG files:

find public/images/ -iname *.png -print0 |xargs -0 optipng -o7

The -o7 flag means it will try seven different compression techniques for each file and pick the best one. If it couldn’t do better, optipng will just leave the file alone and move on to the next.

If you just want to check if optipng will perform better compression but you don’t want it to modify your files yet just, add the -simulate parameter at the end.


Jul 16 2009

How to fix Munin’s Exim Graph on cPanel

Category: UncategorizedBrian Racer @ 10:57 am

If you notice the Exim graphs on your server have stop updating, you might want to check /var/log/munin/munin-node.log and see if you have lots of these entries:

tail /var/log/munin/munin-node.log
 
...
Plugin "exim_mailstats" exited with status 768. ----
...

You just need to remove the state file, and the graph will start updating again. Don’t worry about deleting the file, no data should be lost.

rm /var/lib/munin/plugin-state/plugin-exim_mailstats.state

Tags: , ,


Sep 03 2008

Hello world!

Category: UncategorizedBrian Racer @ 5:25 pm

 

class Greeter
{
  public static function sayHello()
  {
    return 'Hello World';
  }
}
 
echo Greeter::sayHello();