Quick Tip: making an image (.iso) of a DVD/CD using OS X

>> Wednesday, 2 September 2009

This is just a quick blog post to detail how to make a (mountable) image of a CD/DVD using nothing but the pre-supplied tools in OS X. It's a bit of a no-brainer once you know how but it's something I keep forgetting and I figure here's as good a place as any to make a note of how it's done for the next time my brain malfunctions.

Step 1. Insert your CD/DVD into it's corresponding drive.

congratulations you are now more proficient with computers than my Grandmother. have a gold star.

Step 2. Open the Disk Utility application which can be found in a subfolder of Applications called utilitys. You'll see your disk listed in the left hand pane, click on its name to highlight it.

Step 3. Now we create a new disk image by selecting the menu option File -> New -> Disk Image from "your CD/DVD name here"

Step 4. A popup window will appear asking you things like the name of the image you want to create, where to save it etc. the main thing we're concerned with here is making sure we set the image format setting to 'DVD/CD master'. Click Save and the image will be created in the location you specified.

Nearly there. This is rather exciting isn't it,

Step 5. Once the image has been created browse to it's location in Finder and you'll see a lovely new image file that is called .cdr. "hey! wait a minute. you said this was going to make me an .iso file not a .cdr. what gives?" I hear you cry. well fear not my intrepid compadres because here comes the wonderfully clever/magic bit. rename the file from .cdr to .iso and you're good to go.



Minor Railo 3 / MySQL / Mango Blog gotcha

>> Monday, 9 March 2009

I've been meaning to give Mango blog a whirl for a while now and as I'd just been given some server space by my pal Mark Drew (twitter:@Markdrew) for one of my pet projects I thought why not so this weekend I tasked myself with getting it up and running.

Now I have to say first and foremost I love the way Mango is installed. It's nice to see a CF app give as much care and attention to the install process as some of the bigger OSS apps from the PHP arena (Drupal, Joomla, Wordpress etc.) just unzip, upload and browse to the document root to view the installer.... perfect.

However after the hassle-free installation I immediately ran into a problem when trying to view the frontend site that left me scratching my head somewhat. the error message was...

"Can't cast String [] to a value of type [Array] Java type of the object is java.lang.String"
Nice and generic eh? Well I muddled about trying various things such as uninstalling and re-installing it to the webroot instead of a sub folder, installing it without using a prefix on the db tables. nothing seemed to work. I then consulted Google looking for an answer and found a similiar problem posted up on the Mango blog forums that suggested it may be an issue with the data in the db table concerning links. So I checked there and found nothing amiss and by this point I was at a total loss what to do.

Luckily for me James Buckingham (twitter: clarkee21) was experiencing the exact same problem when attempting to install Mango Blog on Railo 3 using MySQL as well. We exchanged a few messages back and forth last night about the problem and then I eventually gave up and went to bed. However James contacted the extremely helpful and lovely Gert Franz (twitter: Gert_Railo) from Railo and between them tried some bits but it was Laura Arguello who came up with the suggestion that it was down to a setting in the Railo datasources configuration section concerning the preservation of single quotes within the cfquery tag in the Mango Blog support forum here.

A quick trip to the datasource page under services in the Railo web administration panel to uncheck the box marked 'Preserve single quotes' and presto! all was now working.

I thought I'd mention this on the blog so people can find the solution if they do a search as I struggled to find anything pertinent when I attempted to do so.

It is also worthwhile to note that this setting affects ALL datasources in your context.

If you experience similiar problems when running your own code then you can also programatically set this option for each query by adding the following option to your cfquery tags
<cfquery psq="true">
Hopefully this post will be of use to someone as it would be a shame for someone to hit this minor stumbling block and swear off either Railo or Mango blog because of it as they're both pretty damn great if you ask me.

until next time...
À bientôt


Scotch on the Road - 90 days away

>> Tuesday, 3 March 2009

My favourite ColdFusion event on the social calendar is rapidly approaching so I thought I'd re-iterate all the information bouncing around the net in case anyone wasn't already aware.

This years format for Scotch is slightly different to the other years. Following on from the great 1-day event 'A wee dram of Scotch' which took place in London the badgers are fully mobilising the conference and taking it on the road.

Venue details

  • 1st June 2009 - The Sway Bar, London
  • 3rd June 2009 - TigerTiger, Manchester
  • 5th June 2009 - The Caves, Edinburgh
Pricing info

A 1 day ticket will set you back a mere £49 (+ vat)
A ticket to any of the 2 days is just £89 (+ vat)
And if you want to attend all three events it'll only cost you £129 (+ vat)

To top it off the ticket prices even include lunch and 2 drinks at the bar.

If you or your company are sending a group of people there is also a group discount which gives you 5 tickets for the price of 4. you'll need to use a code which you can find on the SotR tickets page.

Speakers / Sessions
These are still being confirmed I believe but details will be up on the Scotch site in short order I'm sure. either way if any of the previous events are to anything to go by it'll be a blast and you'll learn something new.

Any other details you need can be found at http://www.scotch-on-the-rocks.co.uk/

But Ciq will we get to meet you at any of these wonderful events?
Yes. My company are yet to confirm the details of which dates I can attend but even if all else fails I'll be showing my face at the drinks after the London event as it's just round the corner.

If you see me there say howdy.

oh and for people who have been waiting for another installment in my 'perfect OS X dev environment' series. I'm busily working on setting up a railo instance for testing the details of which I'll be posting in the upcoming few days.

until then stay loose and don't forget to book your Scotch tickets.


My perfect OS X development environment - MySQL part 2 - Installing phpMyAdmin

>> Wednesday, 19 November 2008

In the last post we installed MySQL and I showed you how to administer it from the command line but that's not really ideal in day to day usage for most people so today I'm going to show you how to install phpMyAdmin a really handy tool for administering MySQL databases through a web-based interface. There are other alternatives out there but unlike some of the more popular choices like AquaDataStudio this is free to use which in the current economic climate can only be a good thing.

As you may have guessed by it's name phpMyAdmin runs on PHP so before we start installing it lets get the default Leopard PHP install enabled in Apache (apologies if this offends the sensibilities of any particularly hardline CF purists out there :-p ).

Enabling PHP

First up we need to make some changes to the apache config file (httpd.conf) so fire up Terminal and enter the following command...

$ sudo vi /etc/apache2/httpd.conf
Scroll down until you see this line of text and remove the # from the beginning (effectively uncommenting it)
#LoadModule php5_module libexec/apache2/libphp5.so
Handy tip: To search in VI hit the esc key then forward slash followed by what you're looking for then hit enter. It'll jump to the first result automatically and you can then skip through the remaining results by hitting n.

Typically that would be all we needed to do as by default a file in /etc/apache2/other/ called php5.conf is included in the Apache config which checks if the libphp5.so module is loaded and sets up how php files are handled automatically but as we're using a slightly finer grained setup with our virtual hosts we need to update the virtual host configuration file for our default site. In Terminal run the following commands.
$ sudo vi /etc/apache2/vhosts/yourhostname.local.conf
Find the line that looks like this
DirectoryIndex index.cfm index.html index.htm
And add index.php to the end so it looks like this
DirectoryIndex index.cfm index.html index.htm index.php
Save and exit the file

Simple as that! We just need to restart Apache now to pickup our changes so we can see if PHP is running correctly.
$ sudo apachectl restart
To test our handiwork just create a new file called phptest.php in the web root of your default web site and inside the file add the following text.
<?php phpinfo(); ?>
Save and close the file then browse to the file in a web browser. If everything is working you should see a very long page that tells you the exact setup of your PHP installation. For a development environment this is a pretty handy page to have hanging around if you plan on doing anything with PHP but it is not advisable to leave this lying around on a public facing server. Just bear that in mind.

Installing phpMyAdmin

Now we have the basic php install working so we can finally download phpMyAdmin. Go to the projects site and download the latest version (i'm using unzip it to somewhere sensible on your machine, rename the folder to phpMyAdmin and copy it into the webroot of your default web site.

Before I go any further I should probably explain the way I plan to set up the default (hostname) web site on my laptop. The idea is to use the default site as an overarching admin area where I can administer everything across all projects. To achieve this for phpMyAdmin we'll be setting up this phpMyAdmin install in the default webroot to have have full visibility of all databases (using an admin level user) and then later on I'll setup each individual site with its own phpMyAdmin install as part of the semi-automated site creation process I have planned so that it only allows visibility of the databases related to that project. It's not strictly necessary to do it this way but I like the separation of concerns between each project as you know you'll never accidentally change the wrong project as long as you're browsing via that projects domain. But I digress...

phpMyAdmin kindly includes a script to perform all the basic configurations we need to make but before we can run it we need to make sure we have a valid MySQL user account (using root is always a bad idea mmmkay) and an empty database for holding some phpMyAdmin data, we'll also need to create some folders to hold the configuration file that the setup script creates and any uploaded or saved files used by phpMyAdmin. The easiest way to do all this is by Terminal so fire it up again and run the following commands

First we login to the MySQL command line
$ mysql -u root -p
Then we create our new admin user that will hold dominion over any databases we create
mysql> GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'enterapasswordhere';
Then we'll create an empty database for phpMyAdmin to use and exit the MySQL command line
mysql> create database phpMyAdmin;

mysql> quit;
Now we need to change to the directory where you put the phpMyAdmin folder under your default web root e.g.
$ cd ~/Development/Sites/yourhostname.local/webroot/phpMyAdmin/
Handy tip: you can use '~/' as a shortcut to the root of your OS X directory, saves some typing sometimes :-)

Now we can create the required folders
$ mkdir config upload save

$ chmod 777 config upload save
Now open your browser and browse to the following URL


You may see a warning about 'Not secure connection' but for now we'll ignore that as we haven't setup and kind of ssl yet.

Now we need to add our MySQL to the config so click the Add button under the Servers heading and fill in the following details...
Server Hostname: localhost
Server Port: 3306
Server socket: /tmp/mysql.sock
Connection type: socket
php extension to use: default (mysqli)
compress connection: no
Authentication type: config
user for config auth: admin
password for config auth: youradminpassword
only database to show: leave blank
verbose name of this server: .local
phpMyAdmin control user: admin
phpMyAdmin control user password:
phpMyAdmin database for advanced features: phpMyAdmin
session name for signon auth: leave blank
login url for signon auth: leave blank
logout url: leave blank
Click the green add button under actions to add the server to the config

Now we need to setup the upload/download functionality within phpMyAdmin so hit the Upload/Download button under features and enter the following
Upload directory: upload
Save directory: save
Then hit the update button under actions to save

If you would like to be able to do charset conversions then you'll need to enable the functionality now. Click the Charsets button under features and check the tick box that says 'Allow charset conversion' then hit update to save.

Feel free to go through and make any further configurations you may want, when you've finished hit the save button under configuration to write out all the settings you've just configured. The config file is written into the config folder but we need to move it into the root of the phpMyAdmin folder and then remove the config folder to make things a bit more secure so we need run to the following commands in Terminal
$ cp config/config.inc.php config.inc.php

$ rm -rf config
If you browse to http://yourhostname.local/phpMyAdmin/ you should now see your lovely fresh phpMyAdmin install ready for use.

Until next time Happy Databasing :)


My perfect OS X development environment - Installing MySQL

>> Friday, 14 November 2008

Chances are if you're building websites you'll use some kind of data along the way, but where to keep it? the obvious choice of course is a database. Now there are a ton of databases out there that you could use but to get us started I'm going to use MySQL community edition a fantastic open source (and free!) database engine used by many hundreds of thousand sites across the web for their data storage needs.

Go to mysql.com and download mysql 5.0 for mac os x 10.5 (x86_64)

Once downloaded mount the file and run the mysql installer using the provided defaults.

When the installer is finished run the other installer for the mysqlstartupitem and again install using the defaults.

In the disk image you will also see a file called mysql.prefpane which is a handy preference pane that goes into your system preferences and lets you stop and start the mysql server with the push of a button.

To install it copy the file to /Library/PreferencePanes

Open system preferences and you'll see the new pane in the bottom row. click it and start the mysql server.

Now we need to secure the default mysql login so open terminal and run the following commands

First we need to add mysql bin to the path

$ vi ~/.profile

Add this line

export PATH=$PATH:/usr/local/mysql/bin

Save and quit then run the following script bundled with MySQL to secure the default installation

$ sudo /usr/local/mysql/bin/mysql_secure_installation

This will run you through securing your installation, select the following options:


In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Now that we have MySQL Installed and pretty well secured you can access it from the command line using

$ mysql -u root -p [enter]

Once logged in you'll see a prompt like this
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.67 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

into which you can then run any commands you want to create databases, users etc.

However I would advise using a GUI tool so you can administer your databases in a much nicer and easier fashion, there are a number of them out there for the mac (like Aqua Data Studio, or MySQL.com's very own Mysql Administrator and Query Browser tools)

In the next post of this series we'll be configuring Apache to use PHP so we can install an extremely handy web-based MySQL administration script called phpMyAdmin which we can use on each of our sites to do pretty much any database task you may wish to think of.

Until then stay loose :)