Wednesday, November 2, 2011

linux is lateral - uk corridor

Linux use in UK companies, clustered on M62 and M4?


Apart from stating the obvious (Central London) where big financial is regularly advertising for Linux, the two corridors stand out.
Between Warrington and Leeds the M62. With a particular focus on Manchester.

The M4 corridor, not that it is news to see this area mentioned for startups.

Cardiff and Bristol - a nice tech cluster going on there either side of the River Severn.


Developments in 2012 and 2013:

The Silicon roundabout and other initiatives should help Linux move further east of Central London. At the moment skills are concentrated in Central London and other parts of London, but not much in East London.

( Middlesex and/or the stretch Left of Central London between M1 and M4, has always traditionally been a tech hotspot also )

The Silicon roundabout will stretch the reach of Linux a little further along that southern corridor, but what about the Midlands and North?

Tech startup success in Warrington, Manchester, and Leeds should spur on the extremes (Liverpool and Hull) to eventually play catch up.

Birmingham is underrepresented, and I will keep watching the news for any development there.


Linux and Tech Startups:

Take the map above and overlay it onto a map of startup clusters. What do you see?

Note: That map at the top is a point in time analysis, and will change month to month, however I suspect the picture will look broadly the same until those initiatives mentioned above take off.

Friday, October 21, 2011

Birmingham - city visit

Having never visited Birmingham except for business, i took the opportunity for a short two day hotel stay as a leisure visitor.


First impressions of this Pedestrian visitor to Birmingham, UK:

There is a lot to it. Do have satnav enabled on your phone if you plan to go walkabout.

If you are planning a shopping trip, then your activities are already laid out in the several great shopping areas in the city centre. No satnav required.
(If you are going purely for a shopping day, then you can probably ignore the rest of this section)

One of the things that attracts medium sized and large businesses to Birmingham is the excellent road network.

Unlike Leeds though, Birmingham have yet to reconfigure the inner ring roads and connecting arteries to suit current needs of traffic / pedestrian mix.

The car is king in Birmingham, and being on foot feels a bit like visiting London used to feel, before the congestion charging move.

There are expanses of paved area where shoppers are somewhat shielded from king car, however these are not well connected enough to complete the impression.

Having lived in Leeds for a decade, and witnessed the gradual change in the inner ring road & one way systems, I now understand why those changes were required.

Proactive traffic planning and a decade of staggered disruption is what Birmingham will have to endure to create the pedestrian / traffic complimentary mix which Leeds have succeeded in providing.

Alternatively the London model (congestion charging) and moving the arteries away from the centre, through charges, might be another alternative.

Now the 'Big City Plan' is Birmingham's answer to my comment above.
It also sets out visionary proposals in which each of the seven 'quarters' will be able to evolve.
The developments of New Street Station, the Library and Museum & Art Gallery (most of which complete in 2014 / 2015) will be a big step forward.

However the connectivity of those seven areas and, more importantly, creating one way systems or other ways of pushing the high speed traffic out, from the very centre, need to be addressed (my humble opinion).



Art and Birmingham - Wow!

Pleasantly surprised to find the central Art locations so well stocked.

The Museum and Art Gallery has some fantastic works, however the layout of the listed building in which it is housed, does the visitor few favours.

I challenge any couple to spend a few hours in the main Museum & Art Gallery and rely on just signage for directions.

When the renovation work is complete in 2015, I do intend to visit again. Part of me hopes that the signs will have improved, and that the lack of renovation work makes the difference in visitor experience.

Do visit. The range and total number of items on display is fantastic.


Culture and Birmingham - just dipping a toe:

It is impossible to understand the culture of a city in a couple of days, so I will not try. Do treat my comments lightly - they are not thoroughly researched and are really just some minor observations.

If you like a Cultural mix (I do) then you will feel right at home in Birmingham, it is a melting pot of cultures and friendly with it.

Whilst I am sure reading the local press I might find some examples of when this mix does not work, it certainly wasn't my impression, during my short visit, that this was the case.

Travel on a bus. Yes there are some groups of folks in two or threes chatting about aspects of their shared culture. But that never seemed to create a feeling of division. My impression was that it was just 60 people from Birmingham on a bus, with more in common, than otherwise.

If you live in an area that is uni-culture, then do visit Birmingham and see for yourself. But do so with the intention of being open and receptive. Otherwise why bother wasting your own time, and the time of the good folks of Birmingham.


Real Ale and Ska - now there is a potent combination:

I cannot think of a better activity than having a few pints in friendly company, whilst listening to some good jukebox music.

In Selly Oak, I followed my visit to the Barber Art Institute, with a few pints of Banks and some relaxed Reggae and Ska on the jukebox.


Notes and Further Reading:


Did I enjoy my 2 night city break in Birmingham? Yes.
Would I visit again? I will.

If you are visiting and the weather is good, then do explore the tourist trail near the canal - sun bouncing off the water will give you a good dose of Vit D.

You need the sun's ultraviolet B rays to manufacture vitamin D.

I try not to get too hung up on musical categories, but here are two links, if your interest takes you further:

Sunday, September 11, 2011

google API - command line access to googledocs

Each google service has an API.

These APIs change regularly as google develops it's services, however the core activities should always work.

If you want to take advantage of the latest features, then the API might well be developing as I write this. However things like 'Uploading a pdf' should work and be stable ... or so I thought.


I repeat the text below for easy copy/paste for future web searching:

Loading ./cal_man_EL531_509refBySharp.pdf
Failed to upload ./cal_man_EL531_509refBySharp.pdf: {'status': 415, 
'body': 'Content-Type application/pdf is not a valid input type.',
'reason': 'Unsupported Media Type'}

Other types of file might work fine, however the lack of .pdf upload facility from command line, was enough to halt my experiment.

On Debian GNU/Linux the following install will help get you started:

apt-get install python-gdata googlecl

Sunday, August 21, 2011

protecting a section / paragraph in a document

Here are the two ways which I protect portions of a document:

 ...wanting to protect it often occurs for important content which I'll also frame (hence protecting frames)

But sometimes I just want to protect a block of text to prevent accidental overtyping...

 Create a section, then paste in your text, and then 'protect' the section. Example...



Don't let the actual text (gcc / pthread, etc) put you off, I just wanted to show a real world example.

Here I have included in my document some commands, which I will later use as reference. What I don't want to happen is to accidentally overtype some of those commands whilst editing my document, and losing the concrete reference.

Frames or Sections, both will do a job for you in protecting a block of content - choose whichever you find most convenient :)


Notes and Further Reading:

How to protect a section is discussed in Chapter 4 of the LibreOffice / OpenOffice documentation (links below)

 Chapter 4 pdf is 1.4MB and the .odt version is much smaller.

If you have LibreOffice or OpenOffice installed then you might have local copies accessed by pressing F1 (help)

Monday, August 8, 2011

move / resize partitions - the zero cost way

There was a time when resizing and moving partitions required a trip to the computer store for some software.

No longer the case.

GNU Fdisk is a feature rich fdisk replacement that supports many options including:

  • v - move a partition
  • c - rescue a lost partition
  • z - resize a partition
  • h - check the consistency of a partition
  • o - copy the partition over another partition
By default GNU Fdisk will work in 'compatibility mode', so as to aid users who are making the switch from traditional fdisk.

So options v, c, z, h, o would not show in your menu.

However the -G flag turns off the compatibility mode.


By running gfdisk -G /dev/sda the extra options are available.

( Replace /dev/sda above with whatever your disk device identifier is )

In Debian GNU / Linux you will find GNU Fdisk here.

If all this is too much command line, then there is gparted for a clickable alternative:

gparted list and resize

Friday, July 1, 2011

sample data in postgres

This article takes some sample data and imports it into Postgresql (i) using CSV import and (ii) using INSERTs from an export of MySQL

Now to get the data into postgres we could go back to the spreadsheet (csv loading approach) or maybe take a compatible export from mysql and load that (compatible loading approach)

The data we will be using can be found here and I am about to start working with this file.

( If you are coming from a MySQL background and want to just load the sample 'employees' database into Postgresql, then project at  this link will help with that )

CSV loading approach:

In postgres use COPY FROM to get data from the filesystem into the database.

But wait; surely you need to already created a table so as to have a table to load into?
Yep, otherwise you would see postgres complain about a missing relation like so...

postgres=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV QUOTE AS E'\042';
ERROR: relation "amd_bang_per_watt" does not exist


The table does not exist so you need to 'create table'.

I cover this in more detail in the next section 'Compatible loading approach' so either consult there or have a go yourself first perhaps.

I now assume you have the table amd_bang_per_watt created.

My table needed emptying first but you can likely ignore the next command:

: #root@156ns1(~) ;echo 'delete from amd_bang_per_watt' | psql amd_power_dissipation postgres
Password for user postgres:
DELETE 50

...and pick things up again here where I will try the COPY FROM:

amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV QUOTE AS E'\042';
ERROR: value too long for type character varying(10)
CONTEXT: COPY amd_bang_per_watt, line 1, column model_family: "Model Family"
amd_power_dissipation=#

and taking care of the header we execute

amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV HEADER QUOTE AS E'\042';
ERROR: null value in column "speed_power_ratio" violates not-null constraint
CONTEXT: COPY amd_bang_per_watt, line 4: ""X2 ","6??? x¹ ",2.3,,,"3.4 HT3 ",,,45,"x¹ 2009 ","
amd_power_dissipation=# select count(*) from amd_bang_per_watt;
count
-------
0
(1 row)

which is still not completing as we would wish so attempt 3:

amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV HEADER QUOTE AS E'\042' FORCE NOT NULL speed_power_ratio;
ERROR: invalid input syntax for type numeric: ""
CONTEXT: COPY amd_bang_per_watt, line 4, column speed_power_ratio: ""

...attempt 4...

amd_power_dissipation=# ;COPY amd_bang_per_watt (1,2,3,4,5,6,7,8,9,10) FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV HEADER QUOTE AS E'\042';
ERROR: syntax error at or near "1"
LINE 1: COPY amd_bang_per_watt (1,2,3,4,5,6,7,8,9,10) FROM '/tmp/amd...

...attempt 5...

amd_power_dissipation=# COPY amd_bang_per_watt (model_family,model,clock_speed,l2cache,l3cache,ht_bus_ghz,voltage,socket,tdp_watts,process_comments) FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV HEADER QUOTE AS E'\042';
ERROR: extra data after last expected column
CONTEXT: COPY amd_bang_per_watt, line 2: ""X2 II ","550 Black Edition ",3.1,"2x512k ","6MB ",2,"1.15-1.425 ","AM3 ",80,"45nm Callisto Q3-2009 ..."

...attempt 6...

amd_power_dissipation=# COPY amd_bang_per_watt (model_family,model,clock_speed,l2cache,l3cache,ht_bus_ghz,voltage,socket,tdp_watts,process_comments,process_comments) FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv' WITH CSV HEADER QUOTE AS E'\042';
ERROR: column "process_comments" specified more than once

...and still no success so back to the drawing board (or rather sed in fact):

sed 's/\,$/\,0/' <> amdAM3clockSpeedsAndWattage__200907.csv-truncated
: #root@156ns1(tmp) ;sed 's/\,$/\,0/' <> amdAM3clockSpeedsAndWattage__200907.csv-edited
: #root@156ns1(tmp) ;sed 's/\,\,\,/\,0\,\,/' <> amdAM3clockSpeedsAndWattage__200907.csv-edited2

Here is some dialogue to explain how I came to have three sed commands of which the first is now redundant:

amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv-truncated' WITH CSV HEADER QUOTE AS E'\042';
ERROR: missing data for column "speed_power_ratio"
CONTEXT: COPY amd_bang_per_watt, line 4: ""X2 ","6??? x¹ ",2.3,,,"3.4 HT3 ",,,45,"x¹ 2009 ""
amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv-edited' WITH CSV HEADER QUOTE AS E'\042';
ERROR: null value in column "clock_speed" violates not-null constraint
CONTEXT: COPY amd_bang_per_watt, line 10: ""X2 ","6??? x¹ ",,,"2MB ","DDR2 ",,,,"x¹ 65nm Kuma Q2/2008 ",0"
amd_power_dissipation=# COPY amd_bang_per_watt FROM '/tmp/amdAM3clockSpeedsAndWattage__200907.csv-edited2' WITH CSV HEADER QUOTE AS E'\042';
COPY 50

and now a few selects to check things look okay:

amd_power_dissipation=# select count(*) from amd_bang_per_watt;
count
-------
50
(1 row)

amd_power_dissipation=# select count(*),substr(process_comments,1,4) as nm from amd_bang_per_watt group by nm;
count | nm
-------+------
2 | x¹
3 | x¹ Q
1 | x¹ 4
6 | x¹ 2
19 | 65nm
15 | 45nm
4 | x¹ 6
(7 rows)

All looks well here.

The CSV files (original, and edited using sed) are listed below:
If recommend saving the above files to your filesystem and viewing them from there, however if you do instead open them directly in your browser and you see x¹ rather than x¹ then try using Konqueror instead.

Konqueror is a clickable install on most Linux desktop distributions and is available to Windows users via KDE on Windows project.


Compatible loading approach:

Here is an extract of some ruby code which I looked up, so as I have an idea of what mysql types map to what postgres types:

def convert_type(type)
case type
when "tinyint(1)"
"boolean"
when /tinyint/
"tinyint"
when /int/
"integer"
when /varchar/
"varchar"
when /decimal/
"decimal"
else
type
end
end
You might find a more accessible read in the form of the Mark Slade migration guide for mysql to postgres. That guide includes some discussion about datatype mappings.

What I wanted to check was that decimal in mysql would mean decimal in postgres, and, yes it seems that it does.

One recommendation for using decimal fields in any database is to always specify both parameters rather than relying on database defaults.
That way if you do end up exporting/importing as part of some migration, then you will not be tripped up by differing defaults for precision.

Now in part 3 of the 'sample data and mysql' postings I used --compatible=postgresql flag to produce these files:
Having following the mysqldump documentation link through to reading about server modes it seems that a reasonable expectation is as follows:
  • Mysql is going to do what it can to help you when you ask for --compatible=somerdbms
  • Mysql will try and avoid giving you sql output it knows for sure will cause somerdbms a problem.
  • Mysql does is not promising 100% compatibility but just goes some way to making your task less onerous.
In particular you should not expect --compatible=postgresql to spit out sql which postgres can feed on right away - there is still some work to do.

To give a quick illustration I took the .mysqldump4postgresSansOpt file and removed the row inserts and tried to get psql to execute it:

cat /tmp/amd_bang_per_watt.mysqldump4postgresCreateOnly | psql amd_power_dissipation postgres
Password for user postgres:
ERROR: syntax error at or near "@"
LINE 1: SET @saved_cs_client = @@character_set_client;
^
ERROR: unrecognized configuration parameter "character_set_client"
ERROR: syntax error at or near "COMMENT"
LINE 12: ...power_ratio" decimal(5,2) NOT NULL default '0.00' COMMENT 'b...
^
ERROR: syntax error at or near "@"
LINE 1: SET character_set_client = @saved_cs_client;

As you can see postgres is not happy.

So I clean it up a bit and retry:

: #root@156ns1(~) ;cat /tmp/amd_bang_per_watt.mysqldump4postgresCreateOnlyCleanedUp | psql amd_power_dissipation postgres
Password for user postgres:
CREATE TABLE

...better. Now what I had to do was get rid of the column comment for speed_power_ratio and get rid of the set type stuff mysql had placed before and after the create table block.

Here are the files as I worked on them:
So we have the table - lets get on run the inserts as follows (abbreviated):

: #root@156ns1(~) ;cat /tmp/amd_bang_per_watt.mysqldump4postgresInsertsOnly | psql amd_power_dissipation postgres
Password for user postgres:
INSERT 0 1
...
INSERT 0 1

The 'INSERT 0 1' feedback above is what we should expect given our setup here.
Further reading of the postgres documentation for INSERT and scanning down for oid should make things clear.

A few quick selects to see if things look okay:

postgres@ns1:~$ psql
Password:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# \l
List of databases
Name | Owner | Encoding
-----------------------+----------+----------
amd_power_dissipation | postgres | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(4 rows)

postgres=# \dt
No relations found.
postgres=# \c amd_power_dissipation
You are now connected to database "amd_power_dissipation".
amd_power_dissipation=# select count(*) from amd_bang_per_watt;
count
-------
50
(1 row)

amd_power_dissipation=# select count(*),substr(process_comments,1,4) as nm from amd_bang_per_watt group by nm;
count | nm
-------+------
4 | x¹ 6
19 | 65nm
2 | x¹
3 | x¹ Q
1 | x¹ 4
6 | x¹ 2
15 | 45nm
(7 rows)

amd_power_dissipation=# select model,clock_speed,l3cache,tdp_watts,speed_power_ratio from amd_bang_per_watt where speed_power_ratio > 27;
model | clock_speed | l3cache | tdp_watts | speed_power_ratio
--------------------+-------------+---------+-----------+-------------------
550 Black Edition | 3.1 | 6MB | 80 | 38.75
545 | 3 | 6MB | 80 | 37.50
720 Black Edition | 2.8 | 6MB | 95 | 29.47
710 | 2.6 | 6MB | 95 | 27.37
705e | 2.5 | 6MB | 65 | 38.46
810 | 2.6 | 4MB | 95 | 27.37
900e | 2.4 | 6MB | 65 | 36.92
905e | 2.5 | 6MB | 65 | 38.46
910 | 2.6 | 6MB | 95 | 27.37
945 | 3 | 6MB | 95 | 31.58
9100e | 1.8 | 2MB | 65 | 27.69
9150e | 1.8 | 2MB | 65 | 27.69
(12 rows)

Sidenote: Having tried the substr() funtion, it seems that the sql statement shown below works unaltered in both mysql and postgres:

select count(*),substr(process_comments,1,4) as nm from amd_bang_per_watt group by nm;


Conclusion:

The --compatible option of mysql goes some way to getting your data into postgres and this article hopefully gives a flavour of what manual steps you might have to take.

Having worked through both options for getting the data in (csv and --compatible), I have to say that I am much in favour of using --compatible=postgresql and going that way.

Sunday, June 5, 2011

Natural Muesli - Wholegrain using your own ingredients

Just what exactly is in shop Muesli?

Well that depends where you buy, but here is one 'basic' ingredients list:
  • Wholegrain Oat Flakes (50%)
  • Wholegrain Wheat Flakes (40%)
  • Vegetarian Whey Powder (5%)
  • Raisins (3%)
  • Hazelnuts & Nuts (2%)
If you visit a 3 or 4 star hotel, then the Muesli you will be presented with, will be quite different. But just how different?


Whole grains and variety of fruit and nuts - luxury:

Premium oat flakes will be whole and perhaps of a larger size.

Whole hazelnuts or halved hazelnuts rather than a few chips scattered about.

Dried Apricots and fruit which is a bit pricier, rather than the cheapest ingredients often glazed.

Fruit which has not been processed to aid longer storage ( glazing )

Perhaps fresh seeds, rather than seeds toasted / glazed to aid preservation.

Note: I have used the term Muesli here, if you instead use the term Granola then please substitute as you read.


Toasting Seeds - Makes for Tasty Muesli some folks feel:

Dry Toast seeds over a textured heated surface for 2 to 3 minutes.

Toss regularly during toasting and do not blacken the seeds.


Evil head of Dentistry - Toasting and Oil:

Toasting seeds is one thing, toasting flakes another thing entirely.

If I were the [fictional] Evil head of Dentistry, sitting stroking my cat, here is what I would mandate adding to all muesli:
  • Glazed banana chips
  • Toasted oat flakes - toasted in oil
  • Toasted malted wheat flakes
  • Fruit all covered with a glazing agent ( vegetable oil )
  • Good old sugar ;)
Why? Because all of these things will increase the pressure on a weak tooth, and make Muesli into a crunching exercise, rather than a mild grinding exercise.

If you were Kwik Fit and wanted to sell more suspension parts, then one way is to persuade ordinary motorists to 'off-road' once every day.
No different for [fictional] Evil head of Dentistry and your daily morning meal.

Adding sugar to cereal is a great way of removing user choice.
Most folks who are aware of their sweetener intake, would make a conscious choice to sprinkle a little sugar on, or pass - might depend on mood or fancy.


Adding sugar to cereal it could be argued does remove that choice, and any extra sugar in your diet, is good news for the Dentistry business.



Tesco 'Value' Muesli - how tasty, how healthy?


'Value' ranges tend to ignore health as a measure of value and focus almost entirely on cost.


The 'Value' Muesli ingredients list:


Wheat Flakes, Oat Flakes, Barley Flakes, Malted Toasted Wheat Flakes, Raisins (4.5%), Whey Powder, Sugar, Hazelnuts

Malted Toasted Wheat Flakes contain: Wheat Flakes, Barley Malt Extract.
Raisins contain: Flame Raisins, Glazing Agent (Vegetable Oil).


Some notable figures from the Tesco 'Value' Muesli Nutrition sheet:


60% Carbohydrate
15% Fibre
10% Protein
10% Sugars
5%   Fat

How healthy? Well it helps to have something to compare it to - see next section.



Morrison 'Value' Muesli - how tasty, how healthy?

Add you own dry fruit (Apricots / Raisins / whatever)

Add you own seeds or whatever you think makes a great breakfast taste for you.


...and how healthy....


Hints quoted from the Muesli Recipe at greenfootsteps.com (below)
It is best not to have too many nuts and seeds in your muesli mix as they are rich in proteins and oils - the mix can become rather a challenge to the digestive system!
Chop the larger nuts into pieces. Almonds and coconut are best flaked.
Soak Muesli for at least half an hour before you want to eat it.

How about the Morrisons 'Value' and your Government recommended daily amount (GDA)?


How about Morrisons 'Value' versus Tesco 'Value' summary values quotes previously?

Carbohydrates and Fat - the two 'Value' Muesli are comparable.

Slightly more Protein in Morrisons

Bit less Fibre in Morrisons


Can I make my own Muesli for £1 a Kilogram?

£2->£4 per Kilogram is a more realistic figure.

If you happen to live right near a supplier of staple goods, and have no transportation costs to consider, then you might just be able to hit £1 per kilogram.

Supermarkets are really making no money at selling Muesli for £1 per Kilogram.
My feeling is that it is a 'loss leader' intended to tempt you into the supermarket, rather than being a profitable line.

At the top end of the market is £10 per kg "Ultimate" organic muesli


Soak Muesli - Surely you can just eat it right after adding milk?

Soaking Muesli helps break down the phytates in the fibre.

Unsoaked Muesli (phytates intact) might prevent the absorption of Iron and other minerals by your system.

If you don't like the idea of adding milk then waiting 30 minutes, then instead perhaps fortify your Muesli with iron rich additions such as:
  • Chopped Almonds
  • Dates
  • Prunes
  • Pumpkin
  • Raisins
  • Wheat Bran
  • Sesame Seeds
Having a Muesli made of Wholegrain Oats and Wholegrain Wheatflakes is higher in Iron, but higher in Phytates also, so do soak if you can.

Phytates are an anti-nutrient, and by soaking you are helping to stop those compounds from binding to your nutrients, thus allowing your body to gain the nutrients as intended.


Notes and Further Reading:

Most Health Foods stores and Supermarkets offer a 'Luxury' or 'Premium' muesli, and some are very good.

The more pricier offerings, are probably little different to your 3* or 4* hotel variety, once you add some premium fresh / unpreserved fruit, seed, nuts to brighten further :)

Waitrose Muesli takes an interesting approach with main ingredients being Barley Flakes (12%) and Rye Flakes (8%) and Spelt Flakes (8%)
*Buying for a commune or social housing project, you might be able to justify a 25kg pack of Wheatflakes, however a single person might take 20 -> 50 weeks to eat there way through that pack!

Ingredient amounts in cups / mugs - some examples to help with conversion to grams:

Cup of Oats is 70 grams
Mug of Oats is 100 grams 

Cup of Morrisons 'Value' Muesli is 90 grams
Mug of Morrisons 'Value' Muesli is 130 grams

For dry cereals you can approximate using Mug = 1.45 Cups

All figures above are approximate. Use your own cup and scales for exact figures.

Tuesday, May 31, 2011

Beep Beep - pcspkr and snd_pcsp quiet please!

Having the flexibility to have the pc speaker / beep active in different contexts is useful, however it does require you to know, how to switch off beep, in each context.


tty terminal Ctrl+Alt+F1 - silence the beep:


Here (as root) I created a file named /etc/profile.d/beep-pcspkr-pcbeep-disable.sh and included a setterm command.

Permissions of 644 work okay for this file.


What you should now experience is a TTY console having no beep.

Switch to a tty console login using Ctrl+Alt+F1 and login, your shell completion should now be free of any audible feedback beep.


X terminal - xfce4 terminal - silence the beep:

Graphical desktops (X based) have their own preferences for audio feedback beep, and in my terminal xfce4-terminal, the preference is shown below:

MiscBell=FALSE

...which can be found in the file .config/Terminal/terminalrc


But my MiscBell=TRUE?

Change it to FALSE using an editor if you want to silence the beep.

But my user does not have a file .config/Terminal/terminalrc  - does not exist?

Xfce4-terminal has a preferences screen in Edit->Preferences, go into there and change 'initial title' from Terminal to Xfce4terminal and select 'Close'

What your action above did, was trigger the creation of .config/Terminal/terminalrc

Now you can make your edit.

Why would you want a beep anyway?

Some command line novices find the audible beep a useful feedback mechanism.

Being a novice, back before Red Hat became Red Hat Enterprise Linux, I remember using the feature myself.




But I still have a bootup and reboot Beep - absolute silence please?

Mute the 'PC Beep' column in alsamixer using the 'm' key.


  • Startup alsamixer from a terminal (not required to be root)
  • Navigate right until the PC beep column is highlighted
  • Press 'm' to mute that column
Exit alsamixer using Esc (avoid pressing Q as this is the key for volume increase)

There is no need to explicitly save alsa settings, as simply exiting using Esc is enough to make your new settings persistent.

Note: PC Beep '00' is probably not going to be complete silence. Mute the thing.


Notes and Further Reading:


The alsa-utils package contains the program alsamixer. The package alsa-utils should already be installed on your system. If not use the following:

apt-get install alsa-utils

( apt-get above is for Debian and derivatives including Ubuntu)

yum install -y alsa-utils

( yum for Fedora / Red Hat / MeeGo and similar )

That alsa-utils package includes a utility named aplay, which can be used to check which sound devices in your system are known to alsa.


The above is a Dell Inspiron 1525 laptop, which I am currently setting up with Debian Squeeze. This laptop will have an Xfce desktop, and I have yet to test HDMI audio output, as HDMI port is not something I use regularly.

Saturday, May 28, 2011

Terminal Preferences - #C0C0C0 and "Terminus Bold" 16

Terminal and "Grey on Black":

I am fascinated by folks who use white on black, and often wonder if it is just a lack of knowing, where / how to change the text colour.


#C0C0C0 is an nice Grey for text appearing on a Pure Black (#000000) background


Terminal Font - Monospace or Terminus:

The default in my Xfce terminal on Debian is 'Monospace', which is a perfectly usable font.

Going a little retro with Terminus

For widescreen desktop: "Terminus Bold" 16

For 15" laptop: "Terminus Bold" 14


Terminal Bell - love it or loath it:

For Xfce terminal, there is a MiscBell option in preferences file which should be set TRUE if you want to hear beep.



Terminal programs and terminal fonts - listings:

Just a quick hint or two for programs / fonts you might try.


Thursday, May 26, 2011

Onboard Sata type - Ahci or IDE - which best

If you are a Windows user then you will have to go search based on your particular version - advice varies per version, and read up about install time drivers.

For GNU / Linux there is just a single set of current advice.
However if you are installing with a motherboard that has secure boot / Uefi, then you need to get familiar with these gatekeepers or experiment (some suggestions below )

This post has been edited since it was first published, and this 4 point summary is added:
  1. Use Ahci rather than Ide mode where you are doing a new install
  2. Existing installs should not switch from Ahci to Ide or vice versa once the operating system is already configured
  3. The main thing that Ahci will give you is support for Native Command Queuing which is a hard drive feature.
  4. If you are unable to install GNU/Linux with secure boot / uefi or other restrictive gatekeeper software with Ahci setting, then try ide mode and see if that allows the disk to be recognised (Later you can rebuild initrd and flick the bios switch if you feel you desperately need NCQ support)
If your problem is that the drive (hard drive / usb drive) is not being recognised so you cannot install Linux, then you can either become a master of secure boot zzzzzz, or just switch the thing off (there is usually a secure boot Yes/No in bios)


Choose at the outset - don't try changing it later:


The reasons for choosing Ahci or IDE will be covered next. But first you should make a commitment now to 'get it right' and stick with that setting.

To enable fast booting, grub (by default) will only includes the drivers it really needs, based on your initial system configuration.*

If you set your system up with 'Onboard Sata type' as Ahci, then later try and switch that mode in your bios, then you are asking for trouble.

If you set your system up with 'Onboard Sata type' as IDE, then later try and switch that mode in your bios, then you are asking for trouble.

Read on to make sure you 'get it right' at the outset.

*Sometimes this minimal approach is termed 'targeted' grub.


SATA and IDE emulation:

Do not use 'IDE mode' for Sata for any new install unless you are installing operating systems which had an initial release prior to 2007.

Use Ahci for current Debian and current Red Hat and similar.

The whole point of having a 'IDE mode' for SATA controllers was to help then current software ( Red Hat 5 & Windows XP ) cope with the change in disk standards.

The change to a newer version of Windows from Windows XP is not to be taken lightly for organisations with > 50 employees, which is why some IT departments continue to support that stable release.

Moving versions of Debian (Lenny -> Squeeze -> Wheezy) is much less of an issue, which is why most Debian installs were migrated from Etch long ago.

Moving point release of Red Hat Enterprise Linux (6.2 -> 6.3 -> 6.4) is also not a big deal, however there is just one caveat.

Red Hat is extremely popular as a base system for lots of virtualisation 'hosting containers'. If this is your situation, then that might require a little more planning  as hosting 40->200 VPS atop of Red Hat does make a migration a bit more involved.


Grub (initrd) and Ahci:

What will happen if you have 'Onboard Sata Type' set Ahci, and then do a GNU / Linux install, is that the boot mechanism (grub and initrd) will be built during install with --preload=ahci

To keep boot times down and loading from disk optimal, GNU / Linux installs keep the initrd minimal (only what your system needs*).

This approach gives sub 30 second boot times on my laptop (which I appreciate), however it does put the onus on you to choose the right bios setting and stick with it.

If 'Onboard Sata Type' was IDE mode when you installed, and then later you switched bios to be 'Onboard Sata Type' as Ahci, then ...
the workaround is to build a new initrd containing the AHCI module.
Source: Wikipedia

There is a great Fedora specific posting here describing in more detail why changing the bios setting after your install was done, will lead to issues.

*The latest Debian installer, specifically asks you if you want a 'targetted' boot setup or the more bloated but future proofed version - the choice is yours :)


Initially bios option was set 'Ahci' but for some reason now want IDE:

Hey maybe this is a little dose of nostalgia...what you are saying is in 2011 my system will be set to act like a 2006 / 2007 system.

Have no idea why you might choose to do this, however the kernel boot time option all_generic_ide might be what you require.


Ahci is not listed as an option in my bios - what should I do:

The bios menu selection might be titled 'Sata Controller Mode' or 'Onboard Sata Type' and should list two or three options.

Some bios have a selectable option named 'Compatible (sata only)', which is I guess just another way of saying Ahci



My operating system is very early version of Red Hat Enterprise Linux 5:

Check your kernel version. Kernel 2.6.18 is 5 years old now. Kernel 2.6.19 and newer, all support Ahci.

If you are thinking about doing an install today of a version of GNU / Linux that uses Kernel 2.6.18 then think again. Justify your choice to yourself.

The current 'stable' of Debian uses 2.6.32 and that is pretty conservative.

RHEL6 kernel is RHEL 6.0, Linux 2.6.32-71.29.1.el6.x86_64

Any kernel configured from the current kernel tree in the last 5 years,
should be > kernel 2.6.19 and therefore have Ahci support.

Kernel 2.6.32 and newer and Kernel 3.2 and newer have excellent support for Ahci.



There are other reasons why Kernel 2.6.18 for an OS acting as host container, might not be ideal.


Notes and further reading:


If you are working with bios that make necessary choice between Ahci and IDE today, then perhaps rather than being nostalgic, you are installing GNU / Linux on second hand machines.

Plenty of non-profits and charities are using donated hardware, and this might be your work.

If so, you might also find this link regarding AC97 audio, handy for new installs of Debian Squeeze, on that legacy hardware.

For native English speakers a translation here

    Monday, May 16, 2011

    mercurial init - git init - summary clone and push

    hg init            or      git init

    ...are generally the first commands I use.


    Have your code ready and a reasonable directory structure in place.

    Add a README and a LICENSE file (OSI approved licenses in my case)

    hg init

    ...and you are up and running (for your git stuff   git init)

    If you are working from an existing codebase then you might want 'clone'

    hg clone http://hg.savannah.nongnu.org/hgweb/someproject


    Publishing one time projects via git lends itself well to a set recipe:

    1. git init
    2. git add .
    3. git commit -m 'first commit of GPL3 licensed python scripts'
    4. git remote add origin git@github.com:someuser/apt-utils-python-shell.git
    5. git push -u origin master
            [ Above we used -u switch (--set-upstream) which is correct ]
    6. git add README
    7. git commit -m 'added some to README'
    8. git push origin master
            [ Note there is no -u switch here which is correct ]

    Openshift and git - what commands there?

    In order to commit to your new project, ...

    Make your changes, then run:

    git commit -a -m 'Some commit message'
    git push

    Then reload this page

    Note: The above is quoted from the openshift page


    Notes and further reading:

    If you feel the desire to host your own Mercurial from which other folks can pull, then:


    hg serve 

    and the point browser at http://localhost:8000/


    Note: If your machine is internet facing rather than on a private company network, then you should think about authentication / security, and follow this guide:
      Setting up a Mercurial CGI server

    Alternatively you could think about Trac



    If you feel the desire to host your own Git from which other folks can pull, then:

    git-daemon 

    and the point browser at http://localhost:9418/

    Note: If your machine is internet facing rather than on a private company network, then you should think about authentication / security, and read up about gitosis or gitweb.


    Saturday, May 14, 2011

    mailserver A is "inherently" better than mailserver B

    For GNU / Linux there are several good mailserver packages.

    Here are a handful (in alphabetical order):
    • Exim
    • Postfix
    • Qmail
    • Sendmail
    There are others, but for the purposes of this article that is enough to go on.

    Each of these packages will have their own fanbase. If you have a long history with Plesk hosting automation, then you might well love Qmail ... why? Because you know it inside out.


    Exim 4 is inherently more secure than Postfix:

    No it is not.

    Neither is Exim 4 inherently less secure than Postfix.

    But there was recently a vulnerability in Exim 4 around dkim signatures?

    Yes there was. Debian users should have the security repository of Debian active (by default) and automatic updates (usually active by default on login to Gnome).
    ( See links at the end for further information about Debian and automatic updates)

    However postfix does get vulnerabilities also.

    Mailservers are complicated and involve a huge codebase. Recent changes have been made, particularly to incorporate functionality around dkim.

    When humans code, other humans will review and sometimes mistakes will be found and then corrected.


    But what about Qmail - there is a stable codebase that has changed little in 10 years? Well Qmail has a small core codebase and recent functionality is added via patches. Is this a better way to maintain a mailserver? You decide.


    Debian and Automatic Updates:

    For Gnome desktop users (including Ubuntu migrants), the easiest way is to install update-manager-gnome

    Here are some other useful packages if you run a different desktop, or prefer to have updates happen, without a graphical interaction:
    • cron-apt which is a utility for background download (optional email output)

          [ once installed issue  ln -s /usr/sbin/cron-apt /etc/cron.daily/ ]
    • aptdaemon another daemon, that can be used with user privileges and an optional frontend

    • package named unattended-upgrades (see below)


    If you are really comfortable with cron anyway, you might just want something like this for your updates:

    50 11  * * * ( apt-get -q update && apt-get -qy upgrade -u )



    The Debian project, and how an active upstream can influence choice:

    Distributions are a little like biological systems in some ways, things become more popular, things become less popular. Not unlike natural selection in a fashion.

    One of the things that Debian novices and even some experienced SysAdmins do not appreciate, is the importance of 'upstream'

    It might be the tastiest code morsal your system has chewed in years, however somebody has to package the thing and maintain it
      
    If upstream is inactive or uncooperative (it does happen), then it sometimes can put undue pressure on the maintainer.

    With no upstream support, a complex package, will perhaps, have more outstanding bugs, or the maintainer might decide the weight it too much to carry alone.

    Even if you are not doing Debian packaging, but might be making a commitment to a certain mailserver, then do ask about upstream.

    How active is the upstream of Mailserver A?
    How active is the upstream of Mailserver B?


    If you are going to build a business around systems that include mailserver installs, then you want to know this!

    Here is Exim own bug tracking system - how convenient :)


    Crackers and mailservers - the case for mailserver diversity:

    ( Crackers: Folks who break into systems - think hackers if that is clearer for you )

    If there was only one single GNU / Linux distribution, and every desktop and server in the world was GNU / Linux - wouldn't the world be great!

    Well actually, NO.

    Folks who make a business out of breaking into systems, have a skillset, just like regular developers and System Administrators.

    The less the diversity in commonly run server based services, the better for the cracker.

    In todays diverse GNU / Linux world that cracker is not going to just crack mailservers, he will likely have a toolkit of useful things s/he is knowledgeable in. SSL, file obfuscation, whatever.

    However the wider the skill set required to be effective, the fewer people will be drawn into seeing 'blackhat' activities as an easy career.

    Now if that cracker wants to compromise the mail server on a Red Hat system, then he needs to know Sendmail and it's vulnerabilities / attack vectors.

    Now if that cracker wants to compromise the mail server on a Plesk automation system, then he needs to know Qmail and it's vulnerabilities / attack vectors.

    Now if that cracker wants to compromise the mail server on a Debian system, then he needs to know Exim and it's vulnerabilities / attack vectors.

    This is all assuming that the mailserver administrator has just 'gone with the flow'. They might not, they might have installed any of the 4 mailservers in my original list.

    You know the Red Hat admin might have installed Exim, or the Debian admin might have installed Postfix.

    My point is, that reducing diversity in mailservers, to the point that there is only one type of mailserver, might be considered making it easy for crackers.

    Modern day cracking toolkits have lowered the barriers to entry for crackers somewhat. Let's not make it too easy for intruders by trying to extinguish choice through rabid fanboyism.

    There are arguments for 'biodiversity' in the plant world. In this article, I have presented one argument for diversity in server based services.

    I personally hope Qmail is around for another decade ... my argument for diversity.


    Notes and Further reading:

    An Extract from the Exim4 description:
    If you build exim4 from the source package locally, you can also build an exim4-daemon-custom package tailored to your own feature set.

    If your business is going to create some custom functionality around a mailserver, then that sort of thing might appeal.

    Here is an example of the type of debate that starts up when somebody asks "What mailserver for Debian".
    ( Nothing wrong with that sort of discussion, however do bear in mind my earlier point, about mailservers and fanbase. )

    Saturday, April 30, 2011

    Switch from GPL - The Dual Licensing Gloss over

    .
    Leaving the GPL - the gloss over:

    Puppet has provided an example of a change in licensing, which I will refer to in this article.

    "I know this argument doesn’t persuade all of you"
    ...Somebody forgot to mention dual licensing perhaps.

    Fact is if you want to go Apache, then go Apache, no need to gloss over dual licensing option, and suggest that your hand was somehow forced.


    GPL versus BSD / MIT / Apache style Licensing:

    For a useful Comparison MySQL is GPL, but Postgres is under more of an Apache style license.
    Personally I really like Postgresql, however there is no denying that MySQL does seem to be the bigger of the two in terms of counting installations.

    The GPL allows you to charge for your software, and companies do just that (MySQL enterprise), aswell as selling support.
    Both of these things are no easier for Puppet now that it is under an Apache license.

    "Apache enables far more partnerships", well now Infobright and Calpont seem to be getting along pretty well with MySQL and no hinderance from the GPL there.

    There has yet to appear a column oriented database partner for Postgresql, and Postgresql is under the sort of license which Puppet has just switched to in order to "enables far more partnerships"

    If somebody does a fork of Puppet from the last GPL point, then I'm sure there will be howls of protest.

    Big question for puppet is whether a well funded commercial rival might enter the market, if it did happen would they take the GPL codebase, and try and take out puppet, whilst sharing changes, or would they take the Apache codebase, and start looking at what value added features they might add, that could be patented in an exclusive way?


    How do I sell my GPL software, surely my competitors can just copy it?

    If what you are working on is a simple shopping cart with a few thousand lines of code, then yes your competitors will easily copy what you have, and produce an equally saleable variant.

    If you answered yes above, then you might want to ask yourself is a couple of thousand lines of code really a saleable and 'protectable' innovation. Might be that neither you or anyone else out there could actually sell the thing, in sufficient numbers for it to be viable?

    Be honest. It might be a great little project, however few of those little projects could actually persuade thousands of folks to part with money willingly.

    ( On Windows and Mac desktop systems, there has been a history of freeware. Not free to distribute or contribute to, but free as in zero cost. Those freeware cds were mostly programs that were great little ideas, but not a saleable proposition. )

    If you are unsure then set aside £1000 and pay for two things:
    1. Small market research exercise via social media
    2. Group of physically present test subjects, who are willing to install the thing and give honest feedback.
    But £1000 is a lot? Not if you are seriously planning to make a business from selling software. Your legal costs in the first two years, from selling software, would I think easily exceed this.


    Even without access to the code, the functionality is likely to be reproducible by an independent developer with a couple of weeks tops.

    If you are talking about Red Hat Linux, which has a codebase of which a significant part is GPL licensed, then that is different. Because of the sheer scale of the product (lines of code), you have something that really is saleable and protectable, and that is your experience, your brand, your support, and rolling them all together, the recognisable product known as 'Red Hat Linux'

    But CentOS just copied Red Hat?
    Yes and No. The saleable brand of Red Hat includes all those things I just mentioned, and is not simply the bare code on a cd.

    But Oracle just copied Red Hat with Unbreakable Linux?
    Yes and No. In Unbreakable Linux they copied Red Hat code as part of a very specific Application Stack, and do not provide support for the complete range of tasks and workflows that a regular business user of Red Hat might be able to use / utilize.

    By doing this they have sliced off whole areas of the Red Hat brand as 'out of scope' for their support. That has provided some success because of this narrow focus.
    I could make a whole article about Red Hat versus Unbreakable Linux, but I'll reiterate what I said and move on...Yes and No.

    Here is a question for you....
    "Did CentOS or Unbreakable Linux have an easier or harder time of the copying exercise because of GPL"

    My opinion: License was irrelevant.

    The question of GPL becomes more interesting if CentOS or Unbreakable Linux tried to compete directly with Red Hat by attempting to derive and build upon Red Hat codebase, by say adding a few million lines of code to the kernel and important system routines.

    Neither of these things has happened.

    No reason why it could not happen, however the 'challenger' would have to be 'better' than Red Hat, and that is no mean feat.


    How do I sell my Apache 2.0 software, surely my competitors can just copy it?

    See the first three paragraphs of the previous section.

    Licensing is playing no part in this question, it really is firstly about whether you truly have something that you can build a sustainable business around.
    ( A few thousand lines is just not going to cut it, regardless of whether you license GPL, Apache 2, or keep it hidden in a safe! )

    What your competitors might be able to do if the code is Apache 2.0 is wrap it up and pass it off as their own, by submitting to a smartphone app store. It does happen!

    But I digress, lets say that your product is a significant codebase, say 10 million lines of code.

    Perhaps it is the Apache server itself?

    Does Apache 2.0 license prevent some other company from coming along, wrapping that code up and calling it Cherokeeee Web Server.

    Some companies in fact probably do similar things - I am just guessing here that IBM http server is probably Apache rebadged (I might be mistaken)

    Why does Apache not just go commercial and sell it's software?
    The history and licensing decisions made previously have provided an ethos which would be difficult for the Apache foundation to now change.

    Fact is that IIS which is Microsoft's take on web serving, is hardly a cash cow, so reality also says that web serving (as a portion of the corporate stack), is not a profitable segment to target anyway.

    Now OpenOffice is being made available under an Apache license and LibreOffice under an LGPL3 license.

    Neither makes a difference to the end users ability to give a copy on a usb stick to a friend - perfectly legal, great way to share a good piece of software with a pal.

    So why the distinction? IBM market a free software suite as 'Symphony', and want to continue to 'pull' changes contributed by the open source community, but without engaging with the LibreOffice folks. There is much speculation as to why that might be, however I leave that as a research exercise for the reader.


    Does Apache 2.0 or LGPL3 make any difference to IBM ability to rebrand? Not really, however LibreOffice is something that IBM (and Oracle) see as an organisation that might undermine their attempts, to dominate a business channel (Non-Microsoft Office)

    The reaction: Undermine LibreOffice by creating a split license situation, and attempt to slow the acceptance of LibreOffice.

    Neither Apache 2.0 nor a GPL license make any difference to the Office example above - that is just corporate shenanigans ... license switching to disrupt a new competitor (LibreOffice) before it can develop a sales channel of it's own.

    But one day I might be the IBM or Oracle? Well you might be, but more likely is that you will make a successful business selling to SME's, and shifting several hundred thousand licenses - in direct competition to IBM and Oracle.

    You will likely be on the receiving end, of similar attempts to disrupt your sales channel by the big corporates.

    Here you need to think about software licensing as a 'protection' of you business, not from the consumer (EULAs and all that garbage), but from the sharks further up the food chain.

    Reread your preferred license, and think about it, from the point of view of your own business success, and how your OSI license, might help you deal with threats from larger players.

    Here your concerns will go beyond software licensing, and will take in branding, marketing, patents, access to markets and other concerns.

    Piece of advice: Stay away from any sort of custom license. Choose GPL or Apache 2.0 and run with it. Any sort of custom license may well open you up to:
    • The slow drip drip of fees to law firms, as the market challenges the custom clauses you have created. Probably seemed a great idea at the time, but long term, those custom clauses are just a law firm money sink.
    • Disruptive moves by the larger competition. The top ten frequently used licenses from OSI including GPL and LGPL and Apache 2.0 have clauses that were carefully drafted over several years, and have been tested in the market.

    How do I partner with Commercial companies - do I have to change my license?

    Not at all.

    If you are GPL, then some of your partnerships will be formed on a sharealike understanding.

    If you are GPL, then you can make whatever alternative licensing arrangements you like with partners who are wanting to take a codebase, and work on it without contributing back changes.

    The phrase is "Dual licensing"

    You can go further and "Triple license", it really is up to your company.

    The important thing is not to switch from GPL. When you do that you create a future cul-de-sac into, which an IP aggressor can push the project after a takeover.

    Worst case: You are taken over by Oracle and everything seems rosy for a couple of years, then the closure creep begins to wear on you, and you get tired of your once great product being just an 'up sell' opportunity to a proprietary product.

    You have spent a decade working on the thing. Within two years the takeover has dead ended your project. By switching away from the GPL a couple of years prior to the sale, those two years of building (now kept private) are lost to you and everyone else.

    Do you work on that software ever again? Do you give up on software engineering altogether as you cannot see yourself investing a decade in something new?

    The things I have referred to in the past three paragraphs are real. Do some reading up about the career moves of the leading Java and MySQL folks, during and after, the Sun to Oracle sale.


    I am wanting to partner with Puppet, but somebody suggested that this GPL thing is dangerous?

    Do your research. Consult as widely as you need to.

    You talk to some fella in the queue at Starbucks, and he mentions that GPL is bad and Apache 2.0 is better.

    I repeat ... Consult as widely as you need to. Try a software licensing expert if in doubt.
    (If it costs you £500, it really is small change for a partnership, where you intend to work on several hundred thousand lines of code)

    When you consult, you will understand that a key question is 'sharealike'.

    Puppet make their code freely available for partners and the wider community to distribute and modify. Do you want to do that?

    Do you want your partners to be compelled to 'return the favour', and make available the 5,000 lines of enhancement they just added?

    A commercial license arrangement in addition to GPL give you both ways of partnering - pay me and take my codebase with no forward requirement to share your enhancements, or take the GPL codebase and 'sharealike'.

    A commercial license arrangement (in addition to GPL) also *might* be expected to include warranty and indemnification.

    If your partner indicates that they want (1)Warranty and (2)Indemnification included in the commercial license...
    Then (1) means people, time, and quality business processes and (2) means legal counsel and possibly a commitment, by your company, to absorb some of the legal threat a partner may be subject to, as a direct result of using and distributing your original codebase.

    Just to point out one benefit of the GPL from the perspective of a future partner.

    **A commitment to non-exclusive patent granting.**

    But how could this be a benefit for me as a partner?

    As the only partner, you probably care little about the two way non-exclusive patent handshake you are party to through the GPL.

    However I give an example of the situation under Apache 2.0 which has no bi-directional non-exclusive patent right clause.

    I am Puppet, and I develop software P. I then partner with you (Apache 2.0) and you develop your own P+. Another partner agreement is made (Apache 2.0) and another product P++ is born.

    The P++ vendor is an IP aggressor and intends to use the '++' features as a market lockout. The company files a bundle of patents on the '++' technology they added, develops the market to want those '++' features.

    Nothing too bad just yet.

    But then the patent stick is pulled out. As a 'market aware' partner you mistakenly got caught up in adding some of those features, which IP aggressor patented, and you are now the target of a patent lawsuit.

    Three boats set out on the river...the original and two partners.

    The original has now become a little less relevant due to market developments.
    The 'P+' partner (that's you) has been killed off by the deliberate patent plan of the 'P++' vendor.

    A non-exclusive patent clause now probably sounds like a good idea in retrospect.

    A non-exclusive patent clause is not to be feared as a partner, if you genuinely build robust reliable software that is better than the competition (P++), then people will buy it. It does not need patents to be a better product. It needs skilled developers and lots of commitment.

    But Oracle will just take my additions and market that on top of their product?

    Are they marketing a 'better' product than you by doing that?
    No. And your customers can see just that.
    ( Going back to the Unbreakable Linux question, Oracle in that instance are not offering a 'better' product, they are addressing a very specific appliance segment, one which is not, just now, targeted explicitly by Red Hat )

    But what about the original project, should they be rewarded for not adding features the market wants?

    If the P++ vendor has really built an excellent, and significant set of features in the ++ additions it made, then it will be first to market, and associated with those excellent features.

    There is little reward to just copying exactly what another vendor has done, especially if that vendor has an active marketing campaign.
    They are associated with being first to market with the ++ features, and make the sales.

    However if the ++ features are an unstable pile of mush, then the original project could theoretically rework the codebase and implement it better.

    Who wins there? The market and the customer.

     Just to put things back into terms of the boats on the river analogy...

    A bi-directional non-exclusive patent right, ensures that none of the partners can sink the boats of the other using patent aggression.

    This is why Oracle and Microsoft do everything they can to discourage GPL adoption, it deprives them of an element of their corporate strategy ...

    ... To kill decent rival products by using patent aggression, to scare development teams away from projects, using patentable 'value added' additions, and private patent agreements.

    Whilst I do not agree with everything that Brian Gentile of Jaspersoft say, I quote an extract here with my own highlighting:
    They would rather have standard, commercial terms around the software and its use. By going to a commercial version, customers have a commercial license which includes the indemnification and protection they want to go along with it.

    The third reason is professional support. The forums and the support that you get from working with the Jaspersoft community are pretty robust, but if your use of Jaspersoft is relatively mission critical, you probably want the comfort of knowing that you have a support team that’s very intimate with the code and available to you 24/7.
    I have touched on some of those highlighted points previously.

    I am going to interpret the use of the word indemnification to mean warranty, something which MySQL AB used to offer in it's commercial licensing, to meet that requirement.

    Brian's use of the word protection should have been clarified further by the interviewer, or Brian himself.
    I will not speculate further, other than saying this, could be just another way of saying 'security updates', or could be closer to what the Oracle and Microsoft camps, mean by protection.


    Oracle and GPL:

    I could take aim at Oracle regarding the Oracle / Google android situation, however I reserve judgment on that issue. It is complicated and has a ream of in depth articles already.

    But surely Oracle contributes to Open Source, and under the GPL license?
    Btrfs is a good technology, and the license is GPL

    Contributing to one project under GPL, whilst a promising start, does not 'define' Oracle.

    Since taking over Sun, Oracle have taken many 'Free and Open Source' projects, and, thrown out anything, which cannot be seen to contribute to their proprietary stack.
    Rather than embrace all those developers, Oracle has chosen to reassert it's 'type', rather than adapt.


    Microsoft and GPL:

    A company even less able to adapt than Oracle, pursuing tired business tactics to try and turn back the clock to the 90s.

    Rather than drone on here, just do a websearch for GPL microsoft app store, to read up on opinion, as to why Microsoft, is targeting the GPL, as one of the few OSI-approved licenses which it prevents from entering it's smartphone app store.

    By comparison I quote from the Wikipedia section 'Legal barrier to app stores' and the portion related to Ubuntu app store
    In other cases, such as the Ubuntu App Store, proprietary commercial software applications and GPL-licensed applications are both available via the same system