pink colored images on Raspberry PI Noir V2 camera

Problem:
You detect that the Pi Noir V2 camera take pictures in a pink color mask for day pictures.

Solution:
It's fixed after execute the next command:
sudo vcdbg set awb_mode 0 

Source:
https://github.com/raspberrypi/firmware/issues/1167


wifi headless setup

Problem:
you need to setup the wifi connection and you don't have a display to do it trough graphic interface.

Solution:
You can plug the microSD card into a computer,a new Disk Unit will be available, there you can create a new file (wpa_supplicant.conf) for the wifi configuration file with the details example as you can see later in this same post.
If you have access to the command line ( you have a display ), you can do it using the command line tool once you are connected using ssh, just open the file wpa_supplicant.conf using the following commands:
# manual edition of the filesudo nano
  sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
# launch the config setup tool
 sudo raspi-config


Just edit the file with the correct SSID and password in the file that have to lloks like:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>
network={
 ssid="<Name of your wireless LAN>"
 psk="<Password for your wireless LAN>"
}

Source:
https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

Hardware:
For old raspberry PI, you will need an wifi USB key like this:
TP-Link TL-WN725N Adaptador WiFi USB inalámbrico Nano, Compatible con Raspberry Pi, N 150 Mbps, Botón WPS, AP soft Windows10/8.1/8/7/XP, Mac OS X 10.7-10.11, Linux, negro

list file content into text file with pyrhon

problem:
You need to add into a text file the name of all files in a folder, usually you can use the following command sudo ls *.jpg > stills.txt but you get an error:
"unable to execute /bin/ls: Argument list too long"
this is because the sentence is too long because linux can not hold all content in memory if the folder have an huge amount of data.

solution:
You can use python as a workarund, use the following code to create a text file fith the name of all files in a folder or directory.

import os
from os import listdir
from os.path import isfile, join
#folder that hold the files, in my case 70.000,00
dirName = '/media/USB128/SHARED/RingBell/pictures/'
#crete and array
fileNames=[f for f in listdir(dirName) if isfile(join(dirName, f))]
#empty the file is it was previouly filled
open('file.txt', 'w').close()
#loop and write line by ñine each filename
for file in os.listdir(dirName):
f = open("./stills.txt", "a+")
f.write("/media/USB128/SHARED/RingBell/pictures/"+file+"\n")
f.flush() 
f.seek(0)
f.close()

Change Time Zone on Raspberry Pi

Problem:
Beside you select the time zone correctly ( most of it ) trough command raspi-config, you detect that the system don't use the correct time, in some countries there is a gap in the time zone calculator of it can be possible to use diferents time zones in the same country.

Solution:
it's as simple as launch the next command and follow the instructions:
sudo dpkg-reconfigure tzdata

Source:

Remote access trought SSH

Problem:
You need to access to your local server from outside of local network using SSH from the command line.

Solution:
You need to map a port in your firewall to allow the firewall pass the remote access connectin from ou public IP access to your local server, for that search port forwarding configuration and map there you raspberry local IP, now you can create an external connection  to your raspberry if you user your public IP and the selected port.

Use the following steps to jump between any raspberry system:

1.- simple remote access connection using the same user.

sudo ssh hostname/ipaddress

2.- change the user

sudo ssh user@hostname

3.- close the session

sudo exit


Mount NFS Client

Problem:
You need to access to a Shared folder from other server from your raspberry PI, this folder is shared troncut the network using a NFS Server

Solution:
Follow the next commands to setup a NFS client in your Raspberry:


1.- Install the required software


sudo apt-get install nfs-common -y

2.- Create the local folder to associate the link between the current system and the remote folder


sudo mkdir -p /media/MyUSB/

3.- Add permission to NFS folder, change owner and group


sudo chown -R pi:pi /media/MyUSB/


4.- mount the folder

sudo mount serveripaddress:/remotefolder /media/MyUSB/
use "df" command to see if the folder is correctly mounted

5.- setup fstab

sudo nano /etc/fstab

add the next line to fstab file:

remoteserveripaddress:/remote/folder/   /media/MyUSB   nfs    rw  0  0
done, now reboot the system and then you will be able to see the shared content in the mounted drive /media/MyUSB

Notes:
- If you are able to see you NFS folder from other computer but you can't write to it, check that all users have the same ID and SGID than the owner for the shared folder in the server
- If you need to make any change, you can use sudo umount /dev/xxx  to unmount the unit and mount it again with the command sudo mount -a
- to list all mount units in the computer use the command df





Mount USB disk

Problem:
You need to use a USB disk with your Raspberry PI.

Solution:
Raspberry PI OS will recognize automatically your USB disk but you need to follow the next configuration steps to use it correctly.

1.- Check your current OS partitions.
sudo fdisk -l
2.- Create a shared forlder.
 sudo mkdir /media/MyUSB
 sudo chmod 777 /media/MyUSB

2.- Setup fstab file, this file store your mount configuration
sudo nano /etc/fstab
 Add one line to configure your USB disk, somethink like:
/dev/stda       /media/MyUSB    vfat    rw  0   0
/dev/stda    path to the USB sick
/media/MyUSB mount path where files are stored
vfat         FAT32 format



3.- Confirm an apply changes.
sudo mount -a
4.- Check current partition.
sudo df
Additional info:
To Remove the disk in save mode:
umount /dev/stda
Notes:
- Remember to change shared folder authorizations to 777, if not you will not be able to share it trough NFS or similar. 

Hardware:
In my test I use a 128 USB flash disk  from Philips and it works really well to manage file between the raspberry system. 

Remember that this will work not only with flash disk, also with external  USB hard disks.