databases


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
return.

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 )

Consultancy relies in no small part in having a skill set which reflects what is hot in the IT marketplace.

Linux and Server Skills - Graphical Representation

18 months have passed since my an earlier posting (2009), it seemed a good time to update that Skills Matrix.

Consultancy relies in no small part in having a skill set which reflects what is hot in the IT marketplace.

Skills that may have served you well a couple of years ago might need refreshing or replacing with skills that are more in demand.

Cloud computing skills (google app engine and Amazon S3) are up and coming skills certainly.

In the UK these skills will be in demand, but personally I will not be focussing on those areas just yet.

Here is a skills matrix I have recently produced (darker is better) showing the areas in which I am skilled:

Skills Matrix

Skills Matrix - Stronger skills are shown in darkest colours

I feel this picture gives a reasonable picture of where I am at today and where I would like to be in a year or so. To have all the skills showing as dark green would be saying that I have no plans to to develop future skills. Not having enough dark greens would show that I am currently working entirely in areas which I want to leave (not the case).

Depending on how my training pans out in practice it may be that I do fit in some of the cloud computing skills perhaps at the expense of Tomcat, Xen, MySQL.

Hopefully I will be able to post an updated skills matrix a year or so from now.

PS Calling this a ‘Skills Matrix’ might lead to some comments about how this picture is not in fact a matrix. I did think about calling it a skills table or a skills diagram but the title ‘Skills Matrix’ fitted best for me.

I do understand what a true matrix is as this post illustrates: Maxima and matrices