Two raspberry command line every newbie has to know

1) pinout

This tool is provided by the GPIO Zero Python library, 

It allows you to know better the GPIO map of your raspberry. So GPIO number, which are for 5v/3.3v and which are for negatives

Installation

Before we can use the pinout tool, we need to first update the package list by running the following command.

sudo apt update

Then, we can install the package that will provide us with the pinout tool by using the command below.

sudo apt install python3-gpiozero

and finally

pinout

2) gpio readall

Basically the library name is WiringPi, and you can use it to manage many of the functionalities provided by the GPIO header: digital pins, SPI, I2C, UART, etc.

to installi it:

sudo apt-get install wiringpi

to check if the installation went ok:

gpio -v

Ok, now it’s the moment to show it in action:

gpio readall

you should get something like this:

it shows every pin of your raspberry boards and

  1. the numbering of the pin
  2. the voltage (in case of voltage pin)
  3. if it’s in use (1) or not (0)
  4. set High or Low voltage for each pin through command line (for example gpio -g write 33 1 give voltage to pin number 33 gpio -g write 33 0, remove voltage to that pin number 33)

Save username and password in git

Lately I started to work on a new environment and the first thing has been to install git.

The second thing has been to clone a repository and finally I started to pull and push things.

But! Every time I pulled and pushed something a very nasty little window started bothering me: insert username, insert password (because of course the repository was protected by a password)

And if initially I endured it, after the third time I started to hate it.

So…I decided to save locally my git username and password.

First I had to type this

git config --global credential.helper store

and then

git pull (or push)

You will be prompt (for the LAST TIME) the git username and password

They will be stored in a .git-credentials file in a clear format like:

https://username:password@repository

Normally this file is saved in your local [username] folder (in windows or linux OS)

There is the possibility to have a secure (and recommended) method using a ssh key. Alternatively you can use a caching timeout way of saving your credentials (just in memory for a limited period of time).

For a complete documentation please refer to:

https://git-scm.com/docs/git-credential-store

https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage