Rotate Pi touchscreen

For 90 degree rotation of the display

sudo nano /boot/config.txt

add line (#1: 90; 2: 180; 3: 270)

display_rotate=1

For 90 degree rotation of the touchscreen

sudo apt-get install xserver-xorg-input-libinput
sudo mkdir /etc/X11/xorg.conf.d
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf

In the touchscreen block, add (90 degree: Option “CalibrationMatrix” “0 1 0 -1 0 1 0 0 1”, 180 degree: Option “CalibrationMatrix” “-1 0 1 0 -1 1 0 0 1”, 270 degree: Option “CalibrationMatrix” “0 -1 1 1 0 0 0 0 1” )

Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"


sudo reboot

Setup an SSH key, and add SSH info to your config

Let’s say your ssh username is exampleUsername and your remote url is exampleSite.com
So typically when you ssh to that server, you do

$ ssh exampleUsername@exampleSite.com

Then you are prompted for your password, and then you are successfully logged into the server.

Let’s clean this up and make the process more efficient.

Create local SSH keys

This creates a local public and private key.  Both will be located in ~/.ssh
Public key- ~/.ssh/is_rsa.pub
Private key- ~/.ssh/is_rsa

$ ssh-keygen -t rsa

Fill out the prompts, or leave them blank.

Copy your SSH public key to the remote server

$ ssh-copy-id exampleUsername@exampleSite.com

 

Setup SSH config

Open ~/.ssh/config
If it does not exist, create it and add the following.

    Host exampleSiteName
        Hostname exampleSite.com
        Port 7822
        User exampleUsername
        ServerAliveInterval 240
        ServerAliveCountMax 2

Line 1-Replace “exampleSiteName” with the friendly name you want to connect to this site through ssh
Line 2- Replace “exampleSite.com” with the ssh url/ip
Line 3- Replace 7822 with the port.  if you do not have a port, remove this whole line
Line 4- Replace “exampleUsername” with your username.  This is the username you connect to ssh with and the same username as the key you copied to the server.
Line 5 + 6- These lines will keep your connection alive.  Remove these lines if you do not want that.

Test your new setup!

You should now be able to connect to your server like this

$ ssh exampleSiteName

This should connect to the remote server. You should not be prompted for a password if you copied your public key to the remote server.

14.04 –> 16.04 failed; apt (>= 1.0.1ubuntu2.13)’ is not installed

“14.04 –> 16.04 failed; apt (>= 1.0.1ubuntu2.13)’ is not installed” during do-release-upgrade.
This occurs when trying to upgrade Ubuntu from 14.04 to 16.04.

sudo apt update
sudo apt dist-upgrade
sudo dpkg -i apt*.deb
sudo apt update
sudo do-release-upgrade