WordPress – Sorry, this file type is not permitted for security reasons.

Now that my file upload size has been fixed, I want to upload a .dmg (Mac universal Binary) file for people to download.

WP tells me ‘Sorry, this file type is not permitted for security reasons’.

Frankly I can’t be Rsed to install a plugin just to enable .dmg files, so I’ve zipped my file and uploaded it with no problems.

Some documentation here for others searching for the answer – if you find a convenient answer (preferably with a GUI) then please leave a comment!

http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes

Increasing WordPress 2MB Upload Limit

A default WP install is limited to 2MB file uploads. File upload behaviour of PHP is controlled by the php.ini file. We can edit the .htaccess file to insert variables into our php.ini at runtime.

When WP told me ‘Max upload file size: 2MB’, I set:

php_value upload_max_filesize 64M

Then WP told me ‘Max upload file size: 8MB’, so I set:

php_value post_max_size 64M

Now WP tells me ‘Max upload file size: 64MB’.

Job’s a goodun!

Delegation of PTR Records

Reverse DNS a.k.a. PTR records are a requirement for anyone hosting their own mail server. These are usually administered by your ISP although can be delegated to another provider through clever use of CNAMEs. As ever, Dyn offer a product for dynamic users, but they also provide a guide to PTR delegation for those with static IPs.

Kernel Panic has a great article on using OpenBSD as a DNS server, which clearly describes the function of PTR records.

Pain d’Epi Enriched

The previous Pain d’Epi lasted for a whole 2 hours before being devoured by hungry Martels. We really need something that stays fresh for a week so we can spread out the scoffing… Time for some enrichment!

  • 500g flour (3 parts strong white to 2 parts plain)
  • 300ml milk
  • 100ml water
  • 40g butter
  • 1 tbsp salt
  • 30g sugar
  • packet o yeast

Heat the milk and butter in the microwave to get them nice and warm, then add the water to take the edge off it. Mix all ingredients, kneed for 10 minutes, cover and leave to rise for 1 hour, then knock back, shape into a baguette (this one ended up being wreath shaped due to the size of my tray), cover with oiled film and leave for 20 minutes.

Dust with flour then cut to shape and bake for 30 minutes at 200.

Mince Pies 2012 – Trial Run Review

The Good:

  • The pies kept their shape and are edible without a requiring a plate – an absolute requirement for office treats.
  • No filling escaped!

Improvements:

  • The pastry could be thinner and slightly shorter – icing sugar?
  • The ‘el cheapo’ mincemeat has quite a harsh aftertaste – next attempt can be augmented with raisins, lemon peel, orange peel and cinnamon.
  • Get some proper pastry cutters!

 

Mince Pies 2012 – Trial Run

Shortcrust pastry is 2 parts flour to 1 part fat with a pinch of salt.

  • 300g flour (sifted)
  • 150g butter (cold)
  • Pinch of Salt
  • 3 tbsp water
  • Standard, ‘El Cheapo’ mincemeat

Combine the pastry ingredients in the food processor until ‘crumby’, add a few drops of water then bring pastry together with hands. Cling film and refrigerate for 30 minutes. Roll out on a floured surface to 2mm thickness. Cut bottoms using a 75mm serrated cutter and tops using a 60mm serrated cutter. Build pies without over-filling, brush water between top and bottom to seal. Dust with caster sugar. Bake for 20 to 25 minutes at 200C.

Le Lievre’s have run out of pastry cutters (D’Oh!), so I’ve improvise cutters from a biscuit tin and a glass.

 

 

Pain d’Epi

  • 275g Strong White Flour
  • 175ml warm water
  • 1 packet instant yeast
  • 1 tsp salt

Simply mix all the ingredients, then knead for 10 minutes. Shape into a baguette, place on a floured tray covered with oiled cling film and leave to rise in a warm place for 30-45 minutes. Shape by cutting 3/4 way through with scissors at a 45 degree angle, then pulling each section to the side, alternating left then right. Bake at 180 for 25 minutes – use steam for a more satisfying crust.

 

 

Arrow Keys In Vim Edit Mode – Funky Characters

Problem

Whilst in vim edit mode, attempting to use arrow keys to navigate within the text results in funky characters appearing in the text.

Explanation

 :help compatible  reveals the following information:

  •  *'compatible'* *'cp'* *'nocompatible'* *'nocp'* boolean  (default on, off when a |vimrc| or |gvimrc| file is found) This option has the effect of making Vim either more Vi-compatible, or make Vim behave in a more useful way.

Solution 1

If you have no .vimrc file, Vim runs in compatibility mode by default. Copy the example .vimrc file into your home directory…

(N.B. Your example vimrc may be somewhere else!)

 cp /usr/share/vim/vimrc.example ~/.vimrc 

 

Solution 2

If you have an existing .vimrc file, compatibility must be switched on in that file.

Find the line in your .vimrc that switches compatibility on, and change it to:  compatible off 

If no such line exists, add the line  compatible off  to your .vimrc file.

W3C Standards – Interpretation for CMS Procurement

Here is my interpretation of the W3C specs for procurement of a content management system in late 2010 – Any supplier of a web based system should be able to tick all the following boxes:

Keywords indicating requirement levels follow RFC 2119 at http://www.faqs.org/rfcs/rfc2119.html.

The latest W3C recommendations (standards) are referenced using the wording mandated by W3C.

XHTML / CSS

The system MUST adhere to the Principles, Constraints and Good Practice defined in W3C Architecture of the World Wide Web, Volume One at http://www.w3.org/TR/2004/REC-webarch-20041215/

The output of the system MUST be strictly conforming XHTML 1.1 Documents as defined at http://www.w3.org/TR/2001/REC-xhtml11-20010531/

All presentation style sheets MUST conform to CSS Level 2.1 as defined at http://www.w3.org/TR/2009/CR-CSS2-20090908/

Accessibility

The system MUST demonstrate conformance with the Web Content Accessibility Guidelines (WCAG) 2.0 at http://www.w3.org/TR/2008/REC-WCAG20-20081211/ to Level AA and SHOULD demonstrate conformance to Level AAA.

All output SHOULD also be available in printable format as strictly conforming XHTML 1.1 Documents as defined at http://www.w3.org/TR/2001/REC-xhtml11-20010531/ and MAY be available as conforming XHTML-Print 1.0 Documents as defined at http://www.w3.org/TR/2006/REC-xhtml-print-20060920/

Mobile devices

The system SHOULD implement the Best Practices defined in Mobile Web Best Practices 1.0 at http://www.w3.org/TR/2008/REC-mobile-bp-20080729/#d0e2183

The system SHOULD demonstrate W3C mobileOK Basic conformance as defined at http://www.w3.org/TR/2008/REC-mobileOK-basic10-tests-20081208/

N.B. if mobile use of the system is a requirement, change SHOULD to MUST.

Piano Booster for OSX – 0.6.4 OSX 10.6 Universal Binary

PianoBooster is an open source (GPL) application to teach piano, much like an interactive typing tutor… From the PianoBooster website:

PianoBooster is a fun way of playing along with a musical accompaniment and at the same time learning the basics of reading musical notation. The difference between playing along to a CD or a standard midi file is that PianoBooster listens and follows what you are playing on a midi piano keyboard.

I am determined to learn the piano to regain some of my neglected musical ability. But Piano Booster has no up to date OSX binary release, so I decided to spend a weekend creating one!

Here is the Universal Binary for OSX 10.6 (Snow Leopard) – compiled during March 2010. pianobooster-0.6.4-mac-osx-universal.dmg.zip

There is a bug with this version on my MacBook Pro 17 unibody – here is a video of the mysterious shifting fonts, there was a discussion on the piano booster forum to get to the root of the problem. The suggested fix was to build a snapshot from the SVN trunk… Unfortunately I ran out of time to build it, but I hope to help out Louis B (creator of Piano Booster) again sometime by creating a snapshot build (as soon as I have some spare time!).