Linn LP12 Upgrade to Hercules II Power Supply

Today I received my new Hercules II power supply for my Linn LP12 (1982, pre Valhalla).

I’ve put some pictures here so you can see how to install, which is made slightly more complicated as you’ll need to drill out the holes for the stand-offs for the PSU card.

So lets plug the spindle reservoir, so the bearing oil doesn’t spill out. Apparently there’s a cap you can use but I simply used clingfilm taped to the top.

Plug the spindle reservoir.
Plug the spindle reservoir.

Now we can place the turntable upside down on some cushions on a well lit surface (I used by Range Master cooker as the hood light is very bright).

Upturned LP12
Upturned LP12

OK lets get the back off and have a look at the old PSU.

Original PSU
Original PSU

We can disconnect the motor wires, which are soldered on, and the wires to the switch.

Original PSU
Original PSU

I’ve popped out the power switch, which was relatively easy as there where no corner braces. So now we have a bare cross brace.

cross brace LP12
cross brace LP12

With a silver Sharpie pen I made marks for the holes for the spacers on the Hercules II psu. Then I drilled 6 holes in my £600 turntable !!!.

cross brace LP12 with holes and risers.
cross brace LP12 with holes and risers.

Well after a stiff coffee I figured I’m nearly there. Next simply place the psu on the spacers and gently push it on.

Hercules II attached to LP12
Hercules II attached to LP12

Connect it up :-).

Hercules II PSU attached to LP12.
Hercules II PSU attached to LP12.

Done! Now find something I haven’t listened to for ages.

Blue light for 45 rpm
Blue light for 45 rpm

This took me just over an hour to do and I’m very pleased with the results. I think everything has just gotten that little tighter, the music is more precise and bass punchy.

This is a cheap way to upgrade an old LP12 and I can definitely recommend it.


Hello world! goodbye Joomla!

We’ll after many years on Joomla 1.7, I’ve had to give in as it’s a leaky as a leaky thing, and I’ve been hacked twice now.

Why anyone would want to do this is beyond my wonder really, it’s only a small blag with no importance and must be pretty easy to hack.

However I have learned something out of this:

  • htaccess is a nasty file and you need to keep it well protected.
  • put well difficult passwords on your ftp account and your MySQL account.
  • don’t use an “admin” user id for admin!
  • pick a CRM or Blog platform that you can keep up to date with latest version and take regular backups.

So with that in mind I’ve plunged for the latest version of WP and it seems much much easier to use than Joomla.

So get ready for lots of changes in Themes over the next few months until I get bored with them and probably stick to the first one that I’ve used! ha.


Recursively read UNC path and count line for specific file

Here is a script that will count the number of lines in each FooBar.csv file it find in all subdirectories.

I want to also show the parent folder for each FooBar.csv file.


# Script to count the lines in each FooBar.csv file, so determining the total open orders each day.

$outFile = “FooBarCount.csv”

If (Test-Path $outFile) {
    Del $outFile

echo ‘Directory,LineCount’ > $outFile

$List = Get-ChildItem -path “\\<servername>\d$\Archive\Main” -Recurse -Include FooBar.csv
foreach ($file in $List)
 $result = Get-Content $file | Measure-Object -Line | Select-Object -ExpandProperty Lines;

    $directory = Split-Path $file.fullname -Parent #get the directory full name
    $parent = Split-Path $directory -Leaf # get the last directory folder name

    $printline = $parent + ‘,’ + $result

    echo $printline
    echo $printline >> $outFile

Formatting datestamps on LOAD DATA

I have a csv (of Control M batch data) that I need to load into a MySQL table, but it has a selection of timestamps and dates that I need to format, so that they can be accepted by the MySQL TIMESTAMP and DATA data types.

Data Example…

20141031,20141031,MY_GROUP,MY_JOB,01/11/2014 00:30,01/11/2014 00:30,Ended OK

Here’s my code with the appropriate formatting:

 LOAD DATA INFILE 'D:/Build/MySQLDump/ControlM stats for Kieran.csv' INTO TABLE stats FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (title1,title2,report_gen,title3,title4,title5,title6,title7,title8,title9,title10,title11,title12,title13,@order_date,title15,job_name,@start_time,@end_time,job_status,title16) SET order_date = STR_TO_DATE(@order_date, '%Y%m%d'), start_time = STR_TO_DATE(@start_time, '%d/%m/%Y %H:%i'), end_time = STR_TO_DATE(@end_time, '%d/%m/%Y %H:%i');

I’ve used the @variable placeholder so I can reference the column name in the SET command.

 ‘%Y%m%d’ : will format 20141031 correctly.

  ‘%d/%m/%Y %H:%i’ : will format 01/11/2014 00:30 correctly. Note the uppper “H” for 24Hour Format.





Remove Whitespace using Perl

If you need to remove white space from say a CSV file that has been spooled by SQLPLUS, then try this:

 perl -pi.bak -e "s/^ *//g;s/ *,/,/g;s/, */,/g" C:\working\Batch\spooled_output.csv

This will remove leading spaces and any spaces in between comma separated values.

It will also create a *.bak file of your original.


ODBC TNSNAMES Dropdown Gobbledygook and windings

On Windows 7 ODBC Administrator, if you add a new Oracle connection in System DSN, and the TNS Selector shows a list of gobbledygook or Windings, then check your %TNS_ADMIN% System Environment Variable.

Chances are it is not pointing to where the Network/Admin directory is (ie where your tnsname.ora is located).

Simply update with the correct path and you’re sorted.

(right click computer, Properties->Advanced System Settings->Environment Variables->System Variables)

Debugging Views that don’t compile

If you’re running SQLDeveloper and you compile a View, it will show a little red X next to it if there are issues.

However it won’t actually tell you what the problem is!

Go into sqlplus and enter this command:

 show errors view my_schema.kc_tradedetails

You should then see something like this

 LINE/COL ERROR -------- ----------------------------------------------------------------- 0/0 ORA-00904: "TRADEFIELDS"."COMPANY_SECTOR_CODE": invalid identifier

Which is now a straightforward debugging task

Formatting JIRA Issues List with XSL

I use JIRA allot but I don’t like how it formats it’s Issues List, and I’d rather provide my own formatting.

Now I believe you can apply templates to the actual JIRA website if you are an administrator, or if you know one, but in many occasions you might be out on a client site where you can’t do this.

However all is not lost you can simply Export the List as XML and work on it independently with XSL.

Jira Export to XML


I’ve created some XSL that will transform the XML into a nice webpage with comments included in the list.

Before you can apply the XSL you need to remove the top 11 line of the XML as this contains stuff you don’t need and that interferes with the XSLT process.

 more +11 %recent% > MyJiraReport.xml

Then you use msxsl.exe to transform you xml into a html file.

 msxsl.exe MyJiraReport.xml JiraIssues.xsl -o MyJiraReport.html 

You can download msxsl.exe from here

I’ve created a small DOS batch file that will do all this for you, it even picks up the most recent xml file in your download area. The xsl is there too.

Once opened in Chrome you can Print -> Save to PDF, and your report comes out really nice.

Patently, as this is html you can add all sorts of nice CSS to it. At the moment it’s quite plain but I’ve left a comment in the XSL,  so you can put the CCS reference in, if you want.


SVN Scripts for managing several folders

You may find that you have several directories all connected to (Subversion) SVN so that their code, scripts, xml, ini files etc can all be managed under Subversion source control (
It’s possible that you have this repeated on several servers!
Here’s a nice script that will check your directories to see if they are currently managed by SVN.
If they are, then the script will svn update the directory.
If they aren’t, then the script will svn checkout the directory.
You can add as many directories as you want to this.
This saves me loads of time when building new app servers.
@echo off & setlocal enableextensions
rem ******************************************************
rem * Update directory structure for all SVN repos
rem *
rem * Kieran Caulfield, June 2012. Excelian Ltd.
rem *
rem ******************************************************
echo This will update all svn attached directories.
rem pause
Set drive=D:
echo Drive is set to %drive%
Set SVN_User=””
echo Updating SVN Directories…
rem *********************************
set myFolder=D:\MyScripts
set svn_URL=””
Call :SVN_Folder
set myFolder=D:\MyScripts2
set svn_URL=”″
Call :SVN_Folder
set myFolder=D:\CrystalReports
set svn_URL=””
Call :SVN_Folder
echo Please check results and press any key to end….
rem *****************************
rem *****************************
if exist “%myFolder%\.svn” (
echo folder %myFolder%\.svn already exists – SVN UPDATE
echo D:\TortoiseSVN\bin\svn update “%myFolder%”
svn update “%myFolder%”
if not exist “%myFolder%\.svn” (
  echo folder %myFolder%\.svn not found – SVN CHECKOUT %SVN_URL%
  echo svn checkout %SVN_URL% “%myFolder%” –username %SVN_User%
svn checkout %SVN_URL% “%myFolder%” –username %SVN_User%
rem *******************************
Note, I use the Tortoise SVN Client, it’s brilliant.