newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monthly Archives: January 2015

Smart Fridges Demand a Standard for Food Expiry

It would be a simple and helpful effort if supermarkets agreed upon a barcode strategy for food expiry.

Imagine if every product had a barcode with a standard text string such as:

product:Tesco Milk;expiry:2015-01-31

The website barcode-generator.org was used to generate the QR bar code:

Milk Expiry QR Code

Milk Expiry QR Code

Such labelled products could potentially be scanned as you place them in your fridge – with your fridge reminding you of what products are soon to be expired – and alerting you to products already expired.

Hopefully a simple standard could be agreed upon across manufacturers. Already expiry dates are printed on all food products – it would not be too far a stretch to add computer-readable bar codes describing this information as well.

Linestorm IR-380 Infrared Thermometer

I recently ordered a Linestorm IR-380 Infrared Thermometer in the UK.

I chose this model because the price was very reasonable (£15.60) and, in particular, it is powered by two AAA batteries – most of the other cheap models are powered by 9V batteries and I much prefer using AA or AAA batteries.

The specification was:

  • temperature reading: -50 – 380 Celsius
  • accuracy: +/- 2 Celsius or 2%
  • settings: Celsius or Fahrenheit
  • display: 0.1 Celsius or Fahrenheit
  • operating temperature: 10 – 40 Celsius
  • storage temperate: -10 – 40 Celsius
  • response time: < 0.8 seconds
  • distance to spot ratio: 12:1
  • emissivity setting: 0.1 – 0.99 (default value ratio 0.95)
  • batteries: 2 x AAA (1.5V)
  • battery life: 12 hours
  • screen back light
  • automatic switch off after 10 seconds of non-use

It is powered on by pressing the measurement button (trigger).

To measure one just points at an object and presses the measurement button (trigger) for a single measurement, or hold down the measurement button (trigger) for a constant scan measurement – when you release the last displayed temperature will remain displaying for a while.

The thermometer will automatically switch off after 10 seconds since last operation.

The emissivity for most organic, painted, or oxidised materials is 0.95 but some metal surfaces is lower than 0.95 and then the testing value will not be accurate. To change the emissivity setting make sure device is OFF, then press and hold the laser beam button followed by the measurement button (trigger) at the same time for 3 seconds. The sigma icon will display and you can press the laser beam button to decrease a digit and the backlight button to increase a digit. The mode button will advance to the next digit.

If you see a battery icon it is time to replace the batteries.

To turn on laser pointer assist turn on the device (by pressing the measurement button/trigger) and press the laser button. Press the laser button again to turn it off. Note that the laser beam must never be directed towards eyes.

The mode button switches between displaying the lowest recorded temperature (MIN) and the maximum recorded temperature (MAX).

Emissivity

Material Emissivity
aluminium 0.30
asbestos 0.95
asphalt 0.95
brass 0.50
brick 0.90
carbon 0.95
concrete 0.95
copper 0.95
freeze food 0.90
hot food 0.93
glass 0.85
ice 0.98
iron 0.70
lead 0.50
oil 0.94
paint 0.93
skin 0.98
plastic 0.95
rubber 0.95
snow 0.90
stainless steel 0.80
paper 0.95
water 0.93
wood 0.94

Splunk: How Does One Use A JSON Field In Eval?

Today I observed an unusual property of a Splunk search: the JSON fields appeared to be hidden in the eval command, that is none of the JSON fields seemed accessible in the eval command.

Then I hit upon this post. And Splunk’s eval reference page which states:

If the expression references a field name that contains non-alphanumeric characters, it needs to be surrounded by single quotes; for example, new=count+’server-1′.

Basically, to access a JSON field in an eval function, they should be referenced with single quotes around them.

search |eval myval='record.delay'

You may want to use the tostring() or tonumber() functions, e.g.:

search |eval excessive=if( tonumber('record.delay') > 10, "Y", "N" )

Note that if you use double quotes you will get the literal string not the value of the JSON record you probably wanted.

SSL Intermediate Certificate Order for Comodo Positive SSL

Applications like Dovecot and Exim require the intermediate certificates concatenated into one file along with your site’s certificate. Apache also requires the intermediate certificates in one file, too.

The Comodo Positive SSL certificate appears to be one of the cheapest available at gogetssl.com.

When you get a Comodo Positive SSL certificate you get your site certificate and three other “intermediate” certificate authority files bundled in your zip file, the three extra files are:

Filename Type Distance from Root
AddTrustExternalCARoot.crt Intermediate 0
COMODORSAAddTrustCA.crt Intermediate 1
COMODORSADomainValidationSecureServerCA.crt Intermediate 2
your_site.crt Site Certificate 3

For Apache you need to put the three certificate authority intermediate certificates into one file in order of decreasing distance from the root.

cat COMODORSADomainValidationSecureServerCA.crt  \
  COMODORSAAddTrustCA.crt \
  AddTrustExternalCARoot.crt \
  >intermediate.crt

and then add the following to your virtual server configuration:

SSLCertificateFile /etc/apache2/ssl/gogetssl/your_site.crt
SSLCertificateKeyFile /etc/apache2/ssl/gogetssl/your_site.key
SSLCertificateChainFile /etc/apache2/ssl/gogetssl/intermediate.crt

For Dovecot/Exim you need to put all four certificates including your site certificate into one file in order of decreasing distance from the root:

cat your_site.crt \
  COMODORSADomainValidationSecureServerCA.crt \
  COMODORSAAddTrustCA.crt \
  AddTrustExternalCARoot.crt \
  >your_site.comodo+intermediate.crt

and then add the following to your exim4.conf:

tls_certificate = CONFDIR/ssl/gogetssl/your_site.comodo+intermediate.crt
tls_privatekey = CONFDIR/ssl/gogetssl/your_site.key

and in dovecot.conf:

ssl_cert = </etc/dovecot/ssl/gogetssl/your_site.comodo+intermediate.crt
ssl_key = </etc/dovecot/ssl/gogetssl/your_site.key

How Long Does It Take a UK Citizenship Application to be Approved?

I took the posts in this forum topic and processed them to produce the below graph that illustrates the number of days various people have had to wait between having the UK Border Agency (UKBA) acknowledge receipt of their application, and approve their application.

Please note this is just a sampling of citizenship applications. The data source is by no means reliable. And my process may have been erroneous. Use this information for entertainment purposes only – it is not to be relied upon!

2011 to 2014 UK naturalisation application approval times

2011 to 2014 UK naturalisation application approval times

Improving Your Success Rate By Re-Taking A Test

I was reading that the pass rate for a particular test was 60%. That doesn’t sound very high – and if I take that exam I have a 40% chance of failing that test.

But what if I retry? Or retry two times? What are my odds of passing in that situation?

Let’s take the example where the average pass rate of an exam is 60%.

Description Math
Let Ppass be the probability of passing Ppass = 0.6
Probability of failing first time is Pfail Pfail = 1 – Ppass = 0.4
Probability of failing two times is Pfail2 Pfail_twice = Pfail * Pfail = 0.4 * 0.4 = 0.16
Probability of not failing two times in a row 1 – Pfail_twice = 1 – 0.16 = 0.84
Probability of not failing is the probability of succeeding 0.84

So if you budgeted to take a test two times, not just once, then the probability you pass the first or second time is a much higher 84%!

You could also calculate what your probability of success is if you took an exam three times!

Here’s a table of exams and what your success rate would be if you undertook exams a different number of times:

Description 10% 20% 30% 40% 50% 60% 70% 80% 90%
one attempt 10% 20% 30% 40% 50% 60% 70% 80% 90%
two attempts 19.0% 36.0% 51.0% 64.0% 75.0% 84.0% 91.0% 96.0% 99.0%
three attempts 27.1% 48.8% 65.7% 78.4% 87.5% 93.6% 97.3% 99.2% 99.9%
four attempts 34.4% 59.0% 76.0% 87.0% 93.8% 97.4% 99.2% 99.8% 100%

The moral of the story is: don’t fear a tough-looking exam with a mere 60% success rate. Know that if you budget the time and expense for taking the test twice you increase your odds of passing to a much higher 84%!

What Is The Fee For A Citizenship Ceremony In The UK?

What is the fee for a citizenship ceremony in the United Kingdom? Turns out that it varies by council and can vary by day of the week, too. Then there are public and private ceremonies – where private ceremonies are often more expensive. In fact the Nationality Checking Service fees vary significantly, too, and the days and times you can do this also vary.

So, what do some councils charge? Note all information shown is best-effort and may be completely inaccurate, use at own risk only. This is not a comprehensive list and was compiled on 2015-01-01 from publicly available information from Council websites.

NCS is the Nationality Checking Service which you can use to submit your application via (they copy your documents so you can retain them).

Council Public Ceremony Private Ceremony NCS (Adult) Link Notes
Wandsworth unknown 100 50 link
Newham free 85 55 link
Hillingdon free unknown 60 link
Haringey free 100 50 link
Hounslow unknown unknown 60 link Group ceremonies are held on a weekly basis
Greenwich unknown 100 unknown link Public ceremonies are held every Thursday
Ealing free 100 50 Mon-Fri, 60 Sat link group ceremonies on Tuesdays 9.15am, 10.45am, 1.15pm and 3.00pm
Westminster unknown 110 57 link public group ceremonies every Monday morning
Kingston unknown unknown 60 link only 2 ceremonies per month
Richmond free varies between 54 and 428 unknown link
Croydon free 100 50 link
Kensington and Chelsea free 180 70 link Group ceremonies are held once a fortnight
Hammersmith and Fulham unknown unknown 45 link group ceremonies every Wednesday morning
Tower Hamlets free 90 55 link
Essex free 130 75 link Ceremonies are normally held every first and third Wednesday of the month
Merton unknown unknown unknown link ceremonies are sometimes available on a Saturday
Kent unknown 175 65 link
Hampshire free 150 70 link
Surrey unknown unknown 78 link
Leeds free unknown 80 link
Manchester free 100 unknown link
Wokingham unknown 120 63 link Group ceremonies are generally held once a month, on a week day, at 2.30pm
Oxfordshire unknown unknown 75 link
Slough unknown unknown 72 link Two group ceremonies are held each month
Wiltshire unknown unknown unknown link
Reading free 70 75 link