security

It’s important to set the permissions on .ssh folder. If you allow too much access your connection will be refused. If you don’t have enough permissions you may lock yourself out.

The below script works for setting the folder and private/public key pairs in the folder:

chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/any_other_private_key
chmod 644 ~/.ssh/any_other_public_key.pub

Resources

network

Sometimes it makes sense to tunnel all traffic through VPN. With UFW it is simple to achieve on a Linux box with the following commands:

sudo ufw allow in to 192.168.1.0/24
sudo ufw allow out to 192.168.1.0/24
sudo ufw default deny outgoing
sudo ufw default deny incoming
sudo ufw allow out on tun0 from any to any
sudo ufw allow in on tun0 from any to any

Disable IPv6

As IPv6 doesn’t do very good with VPN disable it by the following steps:

  1. Edit /etc/sysctl.conf

     sudo nano /etc/sysctl.conf
    

    and add the following lines:

     net.ipv6.conf.all.disable_ipv6=1
     net.ipv6.conf.default.disable_ipv6=1
     net.ipv6.conf.lo.disable_ipv6=1
    
  2. Edit /etc/default/ufw

     sudo nano /etc/default/ufw
    

    and set IPV6 to “no”

Finally enable UFW:

sudo ufw enable

Troubleshooting

On Raspberry Pi UFW doesn’t start automatically after reboot. To fix that issue:

  1. Edit /lib/systemd/system/ufw.service

     sudo nano /lib/systemd/system/ufw.service
    
  2. Add the following line to the [Unit] section:

     After=netfilter-persistent.service
    

Reboot Raspberry Pi and type

sudo ufw status

It should show status as Active and the rules we defined earlier.

Resources

hobby

Right next to my laptop I have a Raspberry Pi 4 with a touchscreen connected to it. The screen sits idly for most of the time so I thought I could make some use of it and decided turn it into a digital picture frame using its screensaver.

I have Raspbian Buster with Recommended Software version installed on the Pi but it didn’t have screensaver installed. It can be easily installed though:

sudo apt-get install xscreensaver

The next step is to install slideshow add-on for the screensaver:

sudo apt-get install xscreensaver-gl-extra

Then I uploaded some pictures to the pi from my laptop:

scp -r /Local/Path/To/Pictures  pi@1.2.3.4:/home/pi/Pictures/PhotoDB

Then on the Pi I opened screensaver options and pointed to /home/pi/Pictures/PhotoDB folder. After fiddling with the time settings to my liking my picture frame was up and running:

Another option is to use Gnome Desktop’s tool called eog which first should be installed

sudo apt-get install eog

Then can be run as

eog --slide-show /path/to/picture_directory

But this program lacks options that XScreenSaver has.

Resources