2018-01-09

Just Eat

I am not sure what to say?!

News is Takeaway food app Just Eat slammed for introducing new 'service charge' shortly before card fee ban comes into force

But surely this is entirely the spirit of the changes in legislation.

Previously a company could charge people more if they chose to use payment methods that caused them to have higher costs. That makes a lot of sense and is "fair". It means people choosing payment means that caused lower costs could have a lower price.

The change is to say that you can no longer do that, so you have to treat all payment methods the same. That is the whole point and spirit of the change in the law. It is not to make prices cheaper, it is to make all payment methods equal.

So now you charge people all the same, everyone has a "service charge" to cover those costs you have, even if they choose to use a payment method that costs you less. That is the WHOLE POINT of the change in the law. People can no longer choose one payment method over another to help the seller save costs and so pass on that saving to the customer.

The cynic in me says that is the point - encourage trackable cashless society.

But even, as some suggest, Just Eat could just up the charge they make to the restaurant the end result would be everyone, not just Just Eat, but walk-in and take-away, paying more to cover the extra costs. Even worse in terms of "fairness". This law is obviously and clearly not about being "fair" in any way at all.

What the hell am I missing here - surely that is the whole point of the change in the law?

Seriously if you had before "you can change people more if they use a payment method that costs you more" and you to change to "you have to charge people the same", the result is "all people pay more and nobody has the option to choose a cheaper payment method to get a lower price". That is the whole point of the change in the law, is it not?

Fake News

For a change I am not actually having a go at churches or religion on this post, but pondering how the recent apparent moves to clamp down on "fake news" could impact them...

Religion is fake news!

Sorry if this sounds like I am having a go, I am not. Religion is about presenting unverifiable information as fact. That is what it is - I am not saying if that is good or bad, or if there is a god or not, just that this is how religion works, simple as that. Even if I was religious, I would recognise that a church is expecting me to have "faith" to believe unverifiable facts, that is the point, I think.

Firstly, if the information was not presented "as fact", I seriously doubt a religion would continue. This is just my opinion, but if saying "you may go to heaven but nobody knows" is not going to cut it. I have been to churches (mostly for weddings and funerals) and been shocked by the unequivocal statements made, the "you can be certain he has gone to heaven and is with Jesus now", etc. Certainly the Christian churches I have ever been to make statements "as fact", and I suspect most religions do the same for obvious reasons. If not, then great, let me know.

Secondly, the statements are unverifiable. This has to be the case. If the statements were verifiable then they would not be a religion but a scientist or researcher or teacher and there would be no faith involved in accepting the statements made. We would not call such an organisation a church or a religion in such cases. Indeed, religions make a point of the fact that the statements are unverifiable as a positive thing - that you have to have "faith" to believe the unverifiable, and this is somehow a good thing.

To be a religion the statements have to be made "as fact" and be "unverifiable", which is pretty much the definition of "fake news", surely?

What is fake news?

To be news something has to be presented as "fact". That is what differentiates it from fiction and hence not news.

To be fake, it has to basically be unverifiable or has to be verifiably false. Religions make verifiably false statements too.

So what happens if fake news is banned?

Well, for a start, it can't really be banned anywhere that allows "freedom or expression" and "free speech" I expect, but maybe that can be curbed where "presented as fact" when unverifiable, perhaps? I can see that being hard to manage. It can however happen on private platforms like Facebook and twitter if they so wish.

There will have to be exceptions for satire. This is arguably not "presented as fact" though - it is "presented in the style of actual news" but from a source that is clearly stated as satirical. So probably OK. The tricky bit here is that a lot of recent "real" news is so whacky you cannot tell satire from reality these days, which is quite scary when you think about it.

But what of religions and churches? Will they have an exception to allow them to continue to push fake news. Will they want one, as it is admitting that they push "fake news" if they ask for one?

If that is the case, how long before newspapers, and even Facebook, register as a religion / church? That would allow publication of whatever the hell they like (worse than now) under the cover of religious freedom. Indeed, I am almost surprised that has not already happened.

P.S. I like the Pastafarians, and of all religions I have heard of, Buddhists seem the most sane... Though I like the Norse gods if I had to choose... Thankfully I can choose "none of the above", which is a right I have that so many did not for so many centuries.

2018-01-08

Why can't people make workable laws, FFS

So I blogged on lack of card surcharges. Someone asked if it applied to B2B (Business to Business) transactions, and it does...

Except....

A payee must not charge a payer any fee in respect of payment by means of— (a) a payment instrument which—
(i) is a card-based payment instrument as defined in Article 2(20) of Regulation (EU) 2015/751 of the European Parliament and of the Council of 29th April 2015 on interchange fees for card-based payment transactions; and
(ii) is not a commercial card as defined in Article 2(6) of that Regulation

So, you can charge for use of a "commercial card" (at up to your costs). This is not down to whether B2B or not, it is the type of card...

"commercial card’ means any card-based payment instrument issued to undertakings or public sector entities or self-employed natural persons which is limited in use for business expenses where the payments made with such cards are charged directly to the account of the undertaking or public sector entity or self-employed natural person;

OK, some of that is definitive - charged to the business/self employed account. That is a simple matter of fact and the banks could have card prefix ranges for "commercial cards" that are so charged to company accounts, and so allow retailers to charge a surcharge in such cases, except...

This is the unworkable bit of law: "limited in use for business expenses", because that is down to company policy. If a small company wants to not be paying card charges for B2B using its "commercial card", all it has to have is a company policy that states "company cards used for non business expenses will have the amount deducted from salary payments or repaid to the company within 30 days if greater". Now the card can be used for non business expenses and so is not "limited" to such use, so the exception no longer applies and surcharges cannot be charged.

That means the company no longer has to pay any surcharges for use of the card, bingo!

The fun thing is that companies that issue staff with purchasing cards for expenses always have such a clause to allow them to recharge for abuse or simple mistakes, obviously. The card itself is not "limited", none of them are.

Hence the magic, and long winded, exception in that law is pointless and unworkable, so why the fuck do they bother?

P.S. My guess is that "commercial card" is a term in the industry and someone managed to lobby for an exception for commercial cards, but the legal definition got muffed to include the "limited in use for business expenses" making it a definition that depends on unknown company policy and not on simple facts. My expectation is some people will try and charge for use of a commercial card - if they try it with us (as the customer), they'll have an argument on their hands.

Financial Ombudsman and PGP

PGP (or GPG) is a system for digitally encrypting and signing information, and can be used to send and handle emails securely. It is used by lots of people all the time. A&A, for example, sign emails (so you can read them anyway but know they are actually from us if you check) and encrypt emails to people that ask us to. We are, however, a tad unusual in doing so. I find few companies that have a clue on this, though my lawyer does, which is good.

I was a tad surprised by the Financial Ombudsman service, as they tried replying to me, but sent a very long email on setting up a pass phrase with a link to their site so they could send me secure emails. It was a long and complicated email, and I had not spotted the bit about PGP right at the end to be honest. They fail in making the email so long to be honest, but are clearly trying to cater for people that have no clue on PGP first, hence fooling me slightly. I wonder if it can be a tad more concise and still be effective.

I replied saying basically that my PGP is on key servers, the key ID, and attaching my public key to the email. That was over two weeks ago (well, we had Christmas I guess).

Today I get an encrypted and signed email! This is where it gets slightly amusing as the email says :-

I've heard back from our IT department today who have said they're unable to open the attachment in the format it's been sent.

Well, the attachment was my PGP public key which, err, they are now using to send me the encrypted email.

After some email exchanges it is becoming apparent that the people you are emailing with don't see the PGP, they see plain text that says it was signed, for example. They get a tad confused by attachments it seems. They do not realise they are sending signed and encrypted emails. When I said "well done" for using my key, they are confused... I tried to explain.

So second slight failing is that they could do with a bit more training for the people that use the system.

However, top marks for a system that considers the financial information being exchanged by email to be sensitive and making use of existing encryption systems like PGP (and possibly some others by the look of it, hence the long initial email). This is a good sign...

No more card charges

As I am sure most people know, from 13th Jan, you cannot be charged a surcharge for paying for something by card. This even applies to small corner shops. It is because of the The Payment Services Regulations 2017

What does that mean exactly?

Shops can still operate a minimum spend. Whereas before they may have said a charge only for transactions under, say £5, they may instead simply refuse to take cards for purchases under £5 for example. This creates more inconvenience for shoppers. This may however be a matter of the contract they have with the card processing company which may require the shop to treat cards the same as cash. You are not a party to that contract though, and it is probably not a trading standards issue either.

Yes the shop keeper pays to handle cards. The card processing companies still charge the shops for handling cards.

They may put up prices. This was commented by someone as a "way around the new law", which I find odd. The law is simply to encourage a more easily trackable cashless society, not to save anyone money (the cynicism is strong in me today). If a business has increased costs then obviously increasing prices is likely to happen. The shops have costs to process cards, and the use of cards is likely to increase because of this change. Obviously increased prices is a logical outcome - it is what you would expect, of course, and not a "way around" the law, sorry.

No, they cannot do a "discount for cash". This would be the same as a surcharge for paying by card.

No, they don't have to take cards, or take all types of card. It is generally up to the shop keeper to decide if they take cards and which cards. This may however be a matter of the contract they have with the card processing company. At present many shops do not take Amex due to high costs, it is possible some shops will no longer accept credit cards but only debit cards for the same reasons.

Yes, they can charge admin or booking fees. As long as they are not charging for payment by card, there can be other fees, e.g. on-line cinema ticket sales may have a "booking fee" still.

Yes it applies to Apple Pay even though it is not an actual "card". Anything that allows a card payment to be instigated, so probably even applies to using PayPal.

This is not world wide. This is an EU based change, so on-line shops selling things and changing cards in other countries may not have the same rules.

If they try to charge a fee, report to local trading standards. Card processing companies are telling their clients this, so they should know!

2018-01-05

Making pre-loaded Raspberry Pi image

If you want to install a Raspberry Pi for some purpose, you will end up putting an image on an SD card and installing in the Pi. You can get pre-loaded SD cards even.

SD cards die!

You can get industrial SD cards! These have more write cycles, wide temperature range, and even have S.M.A.R.T. They are more expensive. The one thing I hear all the time with anyone using Pis is that the SD cards die. There are many good ways to reduce this - turn off some logging, log to a RAM disk, remote logging, not ever running mysql on it, and so on. But a good SD card is also a good start and I think probably worth it.

Installing an image.

So you download an image, the stretch lite is a start. I renamed to pi.img for the following examples.

Now, you install it on a memory card. The instructions for Mac are simple, and involve using a dd command. Important, on a Mac, is use the /dev/rdiskN not /dev/diskN as it is massively faster (character and block device versions of the raw disk access). You have to eject/unmount it before you can do the dd, and once you have finished...

sudo dd if=pi.img of=/dev/rdisk4

You end up with a bootable Debian image on you Pi. Yay!

Making a custom image?

There are ways to make a customer image, e.g. www.pibakery.org which allow you to make the image you want to start with, but there may be further tweaks you want to the image itself, and the following shows a way to do that.

You cannot ssh to it!

This is a pain, you have to find a monitor, HDMI cable, keyboard, and faff about. I want an image I can ssh to. I understand why it is not the default, but if you are making something headless you need to be able to ssh to it.

The trick here is changing the image. However, as this is a complete "disk" image with partition table and boot and main partitions, you cannot simply mount it, you have to mount part of it.

First off, find the partitions. There are normally two - a boot and a linux partition.

excalibur:/tmp# fdisk -l pi.img
Disk pi.img: 1.7 GiB, 1858076672 bytes, 3629056 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x37665771

Device     Boot Start     End Sectors  Size Id Type
pi.img1          8192   93236   85045 41.5M  c W95 FAT32 (LBA)
pi.img2         94208 3629055 3534848  1.7G 83 Linux

To allow booting you are going to want to mount the boot partition and add a file to it.. You need the start and size of the boot partition. As they are in sectors multiple by 512.

excalibur:/tmp# bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
8192*512
4194304
85045*512
43543040

And then you can mount...

excalibur:/tmp# mkdir boot
excalibur:/tmp# mount -v -o offset=4194304,sizelimit=43543040 -t vfat pi.img boot
mount: /dev/loop0 mounted on /tmp/boot.

Then all you have to do is create a file called ssh in the boot partition.

excalibur:/tmp# touch boot/ssh

And unmount

excalibur:/tmp# umount boot

Now you have an image that will boot and allow ssh, yah...

Pre-installing some stuff...

I also wanted to change the default password, add ssh keys, update the Debian install, and pre-install a few things. Now, you can do this on a Pi, i.e. install the image, ssh in, and do stuff, but then how do you make an image of that to put on the next Pi? Well, you could image your SD, but that can be 8G, 16G or 32G or whatever, and also ends up not working on another SD some of the time. What I wanted was a clean (small) image that I could install on an SD with some pre-installed stuff.

The trick is very much as above, mount the image, but to do anything you have to be running on a Pi, so I ended up with a running Pi, and loading the image on to that Pi itself, and then on the Pi I mounted the image. Yes, Russian dolls come to mind.

This time we just need the start of the linux partition.

excalibur:/tmp# bc

bc 1.06.95

Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
94208*512
48234496

And then you mount.

excalibur:/tmp# mkdir pi

excalibur:/tmp# mount -v -o offset=48234496 -t ext4 pi.img pi

mount: /dev/loop0 mounted on /tmp/pi.

Then you chroot in to it

excalibur:/tmp# chroot pi

At this point you are running in a new root file system. You can run commands like passwd, and
apt-get and so on as normal. When you have finished, simply exit the chroot and unmount...

excalibur:/tmp# umount pi

And now you have an image that has stuff pre-installed, with the right password or ssh keys as you have installed, all ready to go.

2018-01-02

Bootlace Crimp Ferrules

As promised, a review of using Bootlace Crimp Ferrules for the first time.

I have been using screw terminals one way or another since I was a kid, and they have not changed much, but oddly I have never heard of bootlace crimp ferrules. I blogged recently about how annoyed I was with screw terminals, and they were recommended.

Turns out they are very common, sold in electrical stores, RS, Farnell, even Maplin. I ordered from RS, and got the recommended crimp tool. I then did some re-wiring of an alarm system and used them.

Summary: I like bootlace crimp ferrules and will use them - but get the right crimp tool.

They are simple, a metal tube and a plastic shoulder/sleeve. You poke the wire in, and crimp.


I used the RS crimp tool, this one...


The result was a tad unexpected. The crimp was crimped to the wire by alternating flattening of the crimp at 90 degree angles...


This made the ferrule weaker, and likely to snap - it can even happen trying to remove from the crimp tool itself!


Whilst it is well connected and crimped, this can make it a pain to try and push in to a screw terminal.

Even so, I continued, and found I massively prefer using these to not. But I thought I would investigate more, and found a different crimp tool - this one (also from RS)...


The end moves so you can crimp on the end or the side, which is a nice touch, but the crimps it makes are much much nicer...


This does not snap or bend, and is securely crimped. Stripping the wires very long like this ensures the wire is all the way through, and as it happens the crimps (you can buy different lengths) were slightly too long, so you clip them down to fit once crimped...


The only thing that needs slightly more planning is when putting two wires in, for that you use a double ferrule which is wider and a bigger tube. It means planning ahead slightly more, but well worth it.


And they work really well.


And as promised, here is the video...



P.S. This crimp tool is awesome...


See it in action...



Actually, very fine wires don't crimp perfectly, but AWG22 is fine. The other Weidmüller crimp works even on very small wires...


QR abuse...

I'm known for QR code stuff, and my library, but I have done some abuse of them for fun - I did round pixels  rather than rectangular, f...