Embedded Linux Gems

Serial Port Access for non-sudo User

Working with embedded devices often requires serial access. By default linux tty ports require super user access, so when running an application like a serial communications parser, you will want to give access to the user rather than require your application to have sudo powers.

Once you know which user(s) are to require access, add them to dialout ant tty.

sudo usermod -a -G dialout <serial-user>
sudo usermod -a -G tty <serial-user>

Dialout is a group, so the user changes will take effect after reboot.

Password Hash

Embedded devices will often need a password hash.

Use mkpasswd to generate a hash. First use the -m help option to see what hash algorithms are available.

$ mkpasswd -m help
Available methods:
sha512crypt     SHA-512
sha256crypt     SHA-256
md5crypt        MD5
descrypt        standard 56 bit DES-based crypt(3)

Then generate the hash.

$ mkpasswd -m sha512crypt
Password: 
$6$IPKp8j6a8R$2S1SZigM5x.mupPNX50y0/.mhoJ42LSEe80wszpI6L5jiq4oEUPH9A73zAyT3BqJQm1HIk1p9kI3H.eimTMxY.

Center Ubuntu/Gnome Background

If the image you set as your background does not fit into the screen layout, likely it will be stretched or cropped. To center the image, effectively shrinking it execute on command line

$ gsettings set org.gnome.desktop.background picture-options 'centered'

Explanation and details: https://askubuntu.com/questions/1111201/background-image-resize-in-ubuntu-18-04-1-lts