>NULL: April 2017

Sunday 30 April 2017

Raspberry Pi LCD Screen rotation

So you have your 7" Pi touch screen, but you have a case that mounts it upside down or need the connectors on the other side, what do you do?

Thankfully there is a very simple fix for this.

1, Edit the file /boot/config.txt
2, Insert the text 'lcd_rotate=2' at the top of the file.
3, Save and close then reboot.

This will also rotate the touch screen function to match the LCD panel.

Booting the Raspberry Pi from a USB hard disk or pen drive.

There are a number of Raspberry Pi SD card images which are pretty big, some as much as 128GB such as Hyperpie.

So do you spend £40 on a SD card which might end up being 1MB too small or do you use that old 256GB external USB drive you have in the cupboard. You use the HDD of course.

There are two ways to get the Pi to boot from a USB mass storage device, one is via a one-time setting which afaik cannot be changed back, I won't go near that.

The other option is so simple it's obviously the correct choice for most usages.

You will need an SD card to start the Pi and point it to the USB drive. This can be small, slow and old, it really does not make any difference.

So here's what I did (in Windows).

1, Use Etcher in Dangerous Mode to write your image to the external HDD in the same way you would to an SD card.

2, Mount the drive and copy all files from the Boot partition to the root of the SD card.

3, On the SD card, edit the file 'cmdline.txt'.
  You will see a line with the text 'root=/dev/mmcblk0p2' replace this with 'root=/dev/sda2'

4, Plug in and enjoy.

Tuesday 4 April 2017

Multiple VMs one public IP, port forwarding on Azure Resource Manager

If you want a single public IP with say port 80 going to VM1 and port 443 going to VM2 this is what you do.


The trick is to use an availability set. So when you create the servers they must all be added to the same Availability Set, yes I know you aren't doing load balancing, just add them. Don't add a Public IP on the VMs.

Now create a Load Balancer with a Public IP.
  Now create an Inbound NAT rule, selecting the Availability Set will now prompt you for the target VM and NIC.

Each new Inbound NAT Rule can point to a different Network Interface within the Availability Set.