A client recently supplied some old data from an archive cd produced several years back

The data had been edited on a Mac system prior to OSX

Commodore 64There are convenient Gnu / Linux tools for converting CR+LF  to Line Feed (U+000A), however lone CR (Mac OS 9 and Commodore 8 bit) had me running for emacs and sed.

Ctrl-X and Equals (=) in Emacs will tell you about the document generally, your position, and the hex for the character under the cursor.

x0d or more correctly x0D is the lone CR

sed 's/\x0D/\n/g' < loneHatM.txt > fixed.txt

…is useful.

However if you already have dos2unix and tofrodos installed on Debian, then these two commands, in the sequence shown, will work also:

  1. dos2unix -l oldmac.data
  2. fromdos -a oldmac.data

Quoting directly from the dos2unix manpage about -l switch:

-l –newline
Add additional newline.  Only DOS line endings are changed to two Unix line endings.  In Mac mode only Mac line endings are changed to two              Unix line endings.

Quoting directly from the fromdos manpage about -a switch:

-a     Always convert. If converting from DOS to Unix, this option will cause the program to remove ALL  carriage  returns.  The  default  is  to
remove  carriage  returns  only if they are followed by line feeds.  If converting from Unix to DOS, this option will cause the program to
convert ALL linefeeds to carriage return pairs. The default is to convert linefeeds only if they are not already preceded  by  a  carriage

On this occasion I was lucky in that there were some lookup tables in addition to the main load to MySQL, and these tables were small enough to open in an editor (emacs)

For larger files either take the first few hundred characters (use cut command) or inspect with a hex editor without opening the entire file.

Max OSX now uses the Unix / Linux convention, so thankfully these conversions are now rare.

Postscript: Turns out that dos2unix utils has a convenient mac2unix command, which does exactly what I require for this client work.

( Given the mac change OS9 to OSX, i can see the need to create a backup before you try out mac2unix the first time )

( The image of the commodore 64 is courtesy of Wikipedia and is located at this page )


Having taken delivery of a new server in the last few days I am finding my way around SWsoft Plesk control panel, having last used Plesk in 2003.

The pricing for Plesk 30 domains is reasonable enough**, for it to not add too much to the cost of a server.

This new server is not memory constrained at all, but I find myself in the habit of minimising memory usage anyway.

One of the things which occurred to me was to switch off InnoDB in MySQL so as to:

  1. Save some memory – the fewer storage engines the smaller each mysql process should be in memory.
  2. Avoid having to worry about managing/rotating ib_logfile0 and any other InnoDB logging

Simple enough to disable InnoDB – just need to put…


in the section…


…in a suitable configuration file (perhaps my.cnf on your server)

All this seemed fairly straightforward to me and so I went ahead and made the change.

The first sign of trouble was the appearance of some diagnostics headings in the main area of the Plesk panel 😦

Having a look at the server from ssh shell and trying




…gave me some idea of what might be the problem:

console output that might give clues to plesk unhappiness

console output

Rather than spend a lot of time investigating whether Plesk really does use InnoDB, I just re-enabled InnoDB for MySQL and restarted the container.

The problem went away 🙂

**Plesk 30 domains when included by your server provider is reasonably priced.
If you wish to purchase a domain license yourself then the cost is a bit steeper, and you might consider taking a look at HyperVM/Kloxo (or other open source offerings)