Posts By: jonny

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 : ”;

VirtualBox: Cloning a VM

My Virtual Machine was named http1 so I cloned the vdi as http2.vdi using the VBoxManage command: VBoxManage clonevdi http1.vdi ../pathtonewlocation/http2.vdi The output was: 0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%Clone hard disk created in format ‘VDI’. UUID: 9e65bd30-663e-4bf8-acd2-3120d1f41fec Then create the new Virtual Machine in the VirtualBox GUI: Machine > New On the third step for ‘Virtual Hard Disk’ choose… Read more »

SNMP with Nagios

I thought I would jot down a few notes about today’s adventures with SNMP. Specifically using SNMP with Nagios mostly on Red Hat/CentOS. I have an appliance from a third-party from which I would like to monitor and graph performance. So view this as a beginner howto for future reference. There is good info here… Read more »