Posts By: jonny

The world is over-populated

We had this discussion over coffee one day so to back up my argument with a few figures: 30 percent of food never makes it into a human stomach (UK’s Government Office of Science, The Future of Food and Farming) Rising energy prices encourage the diversion of food stocks into biofuel production (UK’s Government Office… Read more »

If at first you can’t compete, sue, sue again

“It is further evidence of the fact that Android is getting ever huger. Microsoft has failed in attracting any serious interest from device makers, and now it’s trying to spread ‘fear, uncertainty, and doubt’ about the Android platform in an attempt to mafia device makers into paying protection money to Microsoft – protection money which… Read more »

jqplot Problem and Simple Example

This is a simple example usage of the jqPlot jQuery plugin. The example on the author website omits the “, {}” options in the .jqplot function call. <html> <head> <script type=”text/javascript” src=”./scripts/jquery-ui/js/jquery-1.4.2.min.js”></script> <script type=”text/javascript” src=”./scripts/jqplot/jquery.jqplot.min.js”></script> <link rel=”stylesheet” href=”./scripts/jqplot/jquery.jqplot.min.css” type=”text/css” media=”all” /> <!–[if IE]><script language=”javascript” type=”text/javascript” src=”./scripts/jqplot/excanvas.js”></script><![endif]–> <script> $(document).ready(function() { $.jqplot.config.enablePlugins = true; alert(‘1’); $.jqplot(‘chartdiv’, [[[1,… Read more »

Rsyslog and Log Analyzer

These are the steps I took to create a centralised location of system logs. In this scenario multiple servers (earth, venus, mars) send their system logs to a central server (sun 192.168.1.1). I’m not going to cover the configuration of Apache, MySql except were it applies to Log Analyzer. Most of the servers are running… Read more »

MySQL Proxy

Today I wanted to create a straight-forward MySQL Proxy service which would forward MySQL queries from a development machine to another live server which was running MySQL. The aim was to allow people on the development machine to use the same connection string as on the live server, specifying the MySQL host as localhost but… Read more »

FFmpeg Command-line Video Conversion

Video files can be converted using GUI tools such as Handbrake, Arista, WinFF but if you don’t mind the command line – or if you want to automate video file conversion then the following examples might help:Convert to FLV ffmpeg -i video.avi video.flv ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320×240 video.flv… Read more »

MySQL query output to text or CSV

I needed to output the results of a MySQL query today for further analysis and found the answer here. For future reference… SELECT * FROM errors WHERE mailfrom LIKE ‘a.n.other%’ INTO OUTFILE ‘/tmp/a.n.other.txt’ FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\n’; It is also possible to enclose the fields with quotes using: ENCLOSED BY ‘”‘

Piwik Funnel Plugin

The goals analysis in Piwik is a little limited in comparison with Google Analytics but the following plugin which is in development looks promising and of use already.http://dev.piwik.org/trac/ticket/220

PHP Ternary Operator for If Else

These two snippets of PHP perform the same function but the ternary operator takes much less space. Read more great PHP tips at phpro.org /*** using if / else ***/ if(isset($variable)) { echo $variable; } else { echo ”; } /*** using ternary ***/ echo isset($variable) ? $variable : ”;