x

Yubico Yubikey 5C NFC setup on Ubuntu 21.04

11 Dec 2021 / Oscar F

TL;DR Terminal commands for Yubikey 5C NFC setup on Ubuntu 21.04

sudo add-apt-repository ppa:yubico/stable && sudo apt-get update
sudo apt install yubikey-manager
sudo apt install yubikey-personalization-gui
sudo apt install libpam-yubico
sudo apt install libpam-u2f
mkdir -p ~/.config/Yubico
pamu2fcfg > ~/.config/Yubico/u2f_keys

Touch the metal contact to confirm the association.

Backup devices

Insert your backup U2F Key

pamu2fcfg -n >> ~/.config/Yubico/u2f_keys

Touch the metal contact to confirm the association.

Require for Sudo

In /etc/pam.d/sudo below “@include common-auth” add

auth       required   pam_u2f.so

Require for Login

In /etc/pam.d/gdm-password below @include common-auth

auth       required   pam_u2f.so

References:

[1]:Installing Yubico Software on Linux Visited: 10-12-2021

[2]:Ubuntu Linux Login Guide - U2F Visited: 10-12-2021

Tech do links november 2021

15 Nov 2021 / Oscar F

/dev/null links oct 2021

30 Oct 2021 / Oscar F

Gouden Carolus Cuvée van de Keizer Imperial Dark (2021)

17 Oct 2021 / Oscar F

Type: Belgian Strong Dark Ale
ABV: 11 %
Flavor: Dark, sweet, raisins, prune, malty.
My rating: 4.25 / 5


It's dark, but not as dark as if it was from Mordor. It have a dark sweet fudge/chocolate taste with a hint of raisins and prune. It has a very good complement balance with malt. The overall flavour is almost in perfect balance, I'm just missing some carbonation. It's a typical Belgian ale, very well balanced.


Untappd

Remember PEP 8

12 Sep 2021 / Oscar F

How to remember PEP 8, the style guide for python code, with a song by lemonsaur.

Pep 8

TL;DR

Whit help from the lyrics of the song I made a short TL;DR.

Tabs or Spaces?

4 spaces.

Imports

Avoid wildcard imports.

Whitespace in expressions and statements

Basically write compact code.

When to Use Trailing Commas

Trailing commas go behind list items.

Comments

Correct comments are important.

Naming Conventions

Constants should be named all capital letters and camelCase is not for Python

Programming Recommendations

Never use a bare exception.

Conclusion

A Foolish Consistency is the Hobgoblin of Little Minds

As PEP 20 says, "Readability counts".


The PEP8 Song

I think this song can help you remember Pep 8.

The lyrics to the song can be found below the video on Youtube.

A songification of that most holiest of Python Enhancement Proposals, the PEP 8.
Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon Sandøy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal.
This version was inspired by the version released by Gary Jules.
🌎 Website: https://lemonsaur.us/​


References:

https://www.python.org/dev/peps/pep-0008/

https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

https://www.python.org/dev/peps/pep-0008/#imports

https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements

https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas

https://www.python.org/dev/peps/pep-0008/#comments

https://www.python.org/dev/peps/pep-0008/#naming-conventions

https://www.python.org/dev/peps/pep-0008/#programming-recommendations

https://www.youtube.com/watch?v=wNcobO-TAyY