Learnosity Logo
Learnosity Banner Image

Remote collection of vmstat log files

We've been doing a lot of load testing recently and are planning on doing a lot more, so we've developed a simple little script to make the collection of the vmstat (performance statistics) a bit quicker.

multivmstat is a php command line script which makes it easy to collect the statistics. Download the script

To run it you specify a list of servers to check:

./multivmstat server1,server2,server3 5

This will run vmstat on each of the servers with a 5 second interval between samples.

It will create the following files:

server1-vmstat.log
server2-vmstat.log
server3-vmstat.log

Note: You mush have ssh access to each machine - ideally with a certificate so that no interactive authentication is required.

Download the script

Choppy sound on Twinkle Softphone on Ubuntu Linux - Solved

I just reinstalled my system with the latest Ubuntu 8.10 x64 and one of the apps I use regularly for testing and developing Asterisk applications is Twinkle, which is a great VOIP softphone.

It works great, but when I tried it in my new install the sound was all choppy, i.e. I would get every half of each second of the audio.

A bit of fiddling about with the settings and I got it solved. Posting it here so when I forget about it and run into the same problem again I'll know how to fix it.

The solutions is as simple as:

  • From the menu select Edit -> System Settings.
  • Select Audio on the left
  • Change the audio devices to use the most approriate device that is NOT "ALSA: default: Default Device" - in my case it was "ALSA: plughw:0,0: HDA Intel (AD193x Analog)"

I do like the very friendly naming scheme for devices :-) Hope it helps, Mark

Job Vacancy Sydney AU - Graduate or Junior OO Programmer

We're looking for a Computer Science Graduate or similar with strong Object Oriented programming skills and the ability to grasp cutting edge technologies quickly.

If you are looking to work with the latest technogies and are a motivated self starter with a positive "can do" attitude this is the job for you. The ability to take problems and deliver solutions is a must.

There will be significant on the job learning as we are always pushing the boundaries and using the latest and greatest technologies. We are currently working on projects using Actionscript/Flex, ColdFusion, PHP, and Javascript, and are leveraging technologies such as VOIP, SMS, Instant Messenger (Jabber XMPP) to deliver cutting edge solutions.

Suitable applicants will have a Bachelors Degree in Computer Science or Engineering, or similar tertiary qualification. Remuneration commensurate with experience.

Responsibilities would include:

  • Developing new functionality for Asterisk and VOIP applications
  • Creating Rich Internet Applications with Adobe Flex
  • Creation of Desktop applications with Adobe AIR
  • Design and development of new Web applications

Must haves:

  • A robust foundation in Object Oriented programming
  • Demonstrated experience in at least one OO language
  • Motivation to learn and push the boundaries
  • Understanding of XHTML and CSS

Preferable:

  • Experience with PHP, ColdFusion, Farcry CMS, XML, Web Standards etc
  • Competency using linux-based tools (SSH, bash, etc)
  • Familiar with using source control tools (Subversion, etc)
  • Familiarity with Actionscript or Flash

This role may be full time, part-time or on a contract basis depending on the candidates skills and experience. You will be working in a casual workplace with flexible hours in the centre of Sydney.

If this sounds like the job for you email your resume to mark@lynchconsulting.com.au if interested - no agencies please.

Skype with Video on Ubuntu 7.10 Gutsy

I was very excited to see that Skype recently released a beta version of Skype for Linux which has video support.

I duly went and downloaded the version for Ubuntu (the Fiesty Fawn one works great on Gutsy).

Initial attempts to get it working met with frustration - it quickly flashed up on screen and gave the following output:

$ skype
Aborted (core dumped)

After thinking on it a while and hearing reports of other people using it happily I had some further attempts. First plan of attack - make sure there are no settings from an old version that would conflict by (re)moving the settings directory.

$ mv .Skype .Skype.old

Try again and everything came up sweet - even the webcam! Thanks Skype. I'm very happy that this has removed the last reason I had to reboot to windows.

Check out the wiki page for the list of supported webcams in Skype on Ubuntu.

Cheers, Mark

HOWTO Create DVD's from AVI's on Ubuntu

To create simple DVD's (i.e. with no title menu's) you need the following software:

  • mplayer
  • videotrans
  • libxvidcore4
  • dvdauthor
  • mkisofs

To install all this use:

$ sudo apt-get install mplayer videotrans dvdauthor mkisofs libxvidcore4

Here are the simple steps to format a video for DVD:

First, make sure you can view the video using mplayer:

$ mplayer MyMovie.avi

Then we convert if to DVD mpeg format:

$ movie-to-dvd -m pal MyMovie.avi

This will create two files: MyMovie.m2v and MyMovie.ac3 which we need to merge back together:

$ mplex -f 8 -o MyMovie.mpg MyMovie.m2v MyMovie.ac3

Format the video for DVD:

$ dvdauthor -o dvd/ -t MyMovie.mpg

Create a title page for it:

$ dvdauthor -o dvd/ -T

Create an ISO image to burn to dvd:

$ mkisofs -dvd-video -v -o MyMovie.iso dvd

Then right click on the ISO in the file browser (Nautilus) and select "Write to Disc" and you have a DVD that will play in you normal DVD player.

References:

Good website design resources

I normally stay away from the look and feel of websites (as it's not my forte), however, for a current project I need to it and came across these resources:

FreeCSSTemplates.org - Lots of nice CSS templates which are W3C compliant and released under the Creative Commons Attribution 2.5 license. You can use them as you wish or modify them as long as you continue to attribute them to the original author.

Public Domain Photos - A great collection of stock photography that you can use completely free.

Morgue File - Not as morbid as it sounds - some really great photo's here.

Cheers, Mark

Updated: Fixed urls. Updated: Added Morguefile

HOWTO Backup and restore MySQL db's

Handy reference for backing up and restoring db's via the mysql command line tools as it is by far the quickest way to do it.

We do this regularly as we take copies of our staging db's from a central DB server and put them on our local machines for development work.

Backup a database & zip it up

mysqldump -h db.example.com -p mydbname | gzip > mydbname.sql.gz

This will back the mydbname database from the server db.example.com and will prompt for a password (much better than writing it in the command line) and will then gzip it into the file mydbname.sql.gz

Create a database (if it doesn't exist)

mysqladmin -h 127.0.0.1 -u root create mydbname
This is only necessary the first you are creating a copy of the db on your machine.

Restore DB backup

Note: this will overwrite all local changes to the DB

zcat mydbname.sql.gz | mysql -h 127.0.0.1 -u root mydbname
This will take your previously gzipped backup copy and restore it into the local mysql instance to the db called mydbname

Hope it helps. Cheers, Mark

HowTo recover jpeg images from corrupt memory card

Today my digital camera decided that it had been too well behaved of late and the SD card decided to completely corrupt itself for no good reason, losing all the photos on it.

I've spent a significant portion of my youth messing around with file system editing and partition table editing an was not going to give up on the series of photos I'd taken over the last couple of days - luckily it didn't need anything more than a couple of simple commands to recover all the photos. Go Open Source software.

This tutorial is written for Ubuntu, but should be similar for most Linux machines

Step 1 was to make an image of the card (to have a backup of it) using the venerable dd command.

sudo dd if=/dev/sdb of=sdcard.img bs=1M

  • sudo - used to perform command as root user (i.e. have correct privileges)
  • dd - command to copy data a byte level
  • if=/dev/sdb - read data from /dev/sdb - you may need to change this depending on where your memory card it located.
  • of=sdcard.img - save this to the sdcard.img file in the current directory
  • bs=1M - Copy it in 1M chunks

Once this has completed you will need to run the marvellous program recoverjpeg on it.

First lets install it:

sudo apt-get install recoverjpeg

Then run it:

recoverjpeg sdcard.img

and you should get something like the following:

$ recoverjpeg sdcard.img
Restored 290 pictures
The images will be saved in the same folder.

Check the images out and hopefully it works as well for you as it did for me.

Cheers, Mark

Speaking at LearnX

I'm going to be speaking at LearnX tomorrow about some of the eLearning and eAssessment projects we've been working on over the last few months and years at Learnosity.

I'm speaking at a Frontliner session about Mobile and Web based assessment in High Stakes arenas. This will cover a number of applications based around ColdFusion, Flex and VoiceXML, but will be a high level session for Executives and Educators.

  • Time: 13:30 - 14:15
  • Location: Room 101 - L1, Bayside Terrace

If you're at LearnX pop on by and ask some questions.

Mobile phones in education powered by CFMX

Lynch Consulting has been working with Websonic Learning to deliver mobile phone and IM based learning solutions.

A pilot project in Ireland that we recently completed has just been written up in one of the national newspapers: Pupils lap up hi-tech learning of Irish

Behind the scenes it's using CFMX 7 with VoiceXML for the mobile phone integration and Jabber for instant messenging.

More Entries