Linux command
Information on Linux command
ls -als // list all files
mkdir titi // make directory "titi"
rmdir -rf titi // remove all file on the "titi" directory
cd // Go to your home directory
cd // Go to the upper directory
sudo apt-get update //update all the package on your distribution
sudo atp-get upgrade //upgrade all package installed on your distribution
sudo apt-get install gimp //exemple to install gimp software for example you can replace gimp by other software....
sudo apt-get remove gimp //remove gimp software for example. You can replace gimp by other software for removing....
sudo apt-get install libffi6=3.2.1-6 //specify a version of the librairy
iwconfig //see status of wireless card.
ifconfig //see adress ip of each network card.
sudo iwlist scan //scan les connexion wifi
//arret demmarage carte wifi
sudo ifconfig wlp5s0 up //connexion de la carte wlp5s0
sudo ifconfig wlp5s0 down //deconnexion de la carte wlp5s0
sudo nano /etc/network/interfaces //edit the network conf file.
config example
STATIC
iface wlp5s0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254
wpa-psk "replace by your wpa password securit"
wpa-driver wext
wpa-key-mgmt WPA-PSK
wpa-proto WPA2
wpa-ssid "replace by your SSID"
auto wlp5s0
DYNAMIC
iface wlp5s0 inet dhcp
auto wlp5s0
After saving file run these commands :
sudo service networking force-reload
sudo service networking restart
sudo iwconfig //for controlling if your connexion was OK
sudo nano /etc/resolv.conf
add dns as well :
nameserver 212.27.40.240
sudo rmmod iwl3945 //Software disconnect the wifi board
sudo modprobe iwl3945 //Software reconnect the wifi board
install rdesktop
sudo apt-get install rdesktop
Run rdesktop with rdp to IP.IP.IP.IP adress with screen size 1440x900 with 16bits color and sound stay on the distant computer.
rdesktop -r sound:remote -k fr -g 1440x900 -a 16 IP.IP.IP.IP
rdesktop -k fr -a 8 IP.IP.IP.IP //color 8bit full screen keyboard FR
ssh user@IP.IP.IP.IP //run ssh connexion with user "user" at adress IP.IP.IP.IP
ssh -X user@IP.IP.IP.IP //run ssh with server X.
nc -lk 2112 >/dev/null //run on the remote computer 10.10.10.1
dd if=/dev/zero bs=16000 count=625 | nc -v 10.10.10.1 2112 //transfert 10MB to the remote computer and evaluate the bandwith.
Response example on the local computer :
Connection to 10.10.10.1 2112 port [tcp/*] succeeded!
625+0 enregistrements lus
625+0 enregistrements écrits
10000000 bytes (10 MB, 9,5 MiB) copied, 4,08256 s, 2,4 MB/s
sudo blkid //To know informations concerning hard drive.
sudo hdparm -C /dev/sda //See the hard drive status
sudo hdparm -y /dev/sda //Put the hard drive sda in standby mode
sudo hdparm -S 1 /dev/sda //le chiffre 1 correspond au temps par multiples de 5 secondes.
sudo hdparm -S 120 /dev/sda1 //put the disk in standby mode after 120*5s=10 minutes
sudo hdparm -I /dev/sda | grep level //To verify if the hard drive support low power management. If the disk support low power you will see 254 by default.
Delete specific line
history -d 505 // delete ligne 505 in the istory command
or edit the local bash history
nano ~/.bash_history
List of USB device :
lsusb
List aof audio device :
aplay -l
Edit /etc/asound.conf
Modify as well :
pcm.!default {
type hw
card 0
device 0
}
ctl.!default {
type hw
card 0
device 0
}
Nota : if the local file ~/.asoundrc exist, it have more priority.
Place an icon in PNG format on the home directory of the user.
Rename it to .face
That's all.
Edit the file /etc/motd
sudo nano /etc/motd
You can use this link to form special text message :http://www.patorjk.com/software/taag
After modify your motd (Message Of The Day) file when you log in ssh with your terminal, the new text message appears.
You can use this command for file up to 500Mo
sudo find /PATH/ -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Run MYSQL : sudo mysql
// add user
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
// add grand permission
mysql> GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
// relaod privilege
mysql> FLUSH PRIVILEGES;
For resolve this problem, it is necessary to disconnect the power save of the wifi connexion.
It is important to do this manipulation for each wifi network.
cd /etc/NetworkManager/system-connections/
ls
sudo nano your_wifi_network
Add "powersave=2" on the wifi section, save the file and reboot the system
To see if the configuration was ok run : iwconfig and watch if you see “Power Management:off”
List of linux commands use the wiki for informations
tail -n 10 /var/log/auth.log
If auth.log is empty, you can restart the log service.
sudo /etc/init.d/rsyslog restart
last -n 1
List of command for installing email server at home.
sudo apt-get install bind9-host
for testing
host -t MX
Example :
host -t MX google.com
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
For erasing the content of a file, you can send this command :
echo > filename.txt
with this command it is not necessary to delete file and recreate it.
du -h // for list size directory
du -sh /etc //total size of etc directroy
Lien IONOS.FR : https://www.ionos.fr/digitalguide/serveur/configuration/installer-un-serveur-vpn-via-raspberry-pi-et-openvpn/
Choix version python 3 : exemple 3.9.1 defaut
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 0
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.9 1
Choix python 3 au lieu de python 2 :
//controle version
python --version
//desactivation python 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 0
//activation python 3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
//controle version
python --version
install package debian
sudo dpkg -i package_name.debconda activate yolov5
cd yolov5
python detect_mqtt_nowifi.py --line-thickness 1 --conf-thres 0.85 --iou-thres 0.4 --img 640 480 --nosave --weights ./w
eights/20230309_best_orin_50eph_new_light.pt --source 0
Note : sur le portable la carte graphique a 4G de mémoire si on utilise des modele large il faut reduire le batch size.
conda activate yolov5
cd yolov5
python train.py --img 640 --batch 16 --epochs 100 --data data/poste_intelligent_order.yaml --weights yolov5l.pt
python train.py --hyp hyp.no-augmentation.yaml
python train.py --img 640 --epochs 3 --data coco128.yaml --weights yolov5s.pt
//high resolution
python train.py --img 1280 --epochs 3 --batch-size 2 --data ./datasets/bat18650.yaml --hyp ./dataset/hyp.no-augmentatio
n.yaml --weights yolov5m6.pt
python train.py --img 1280 --epochs 500 --batch-size 1 --data ./datasets/bat18650_3.yaml --hyp ./datasets/hyp.no-augmen
tation.yaml --weights yolov5l6.pt
https://icon.kitchen/
https://askubuntu.com/questions/141229/how-to-add-a-shell-script-to-launcher-as-shortcut
https://linuxconfig.org/how-to-create-desktop-shortcut-launcher-on-ubuntu-20-04-focal-fossa-linux
Protocol :
Create *.desktop file, location depends on if it is for personal use or all users. If these directories do not exist, create them.
For personal use , ~/.local/share/applications
gedit ~/.local/share/applications/name.desktop
For all users, /usr/local/share/applications/ (or /usr/share/applications/ depending upon your system).
sudo -i gedit /usr/share/applications/name.desktop
Paste below text
[Desktop Entry]
Type=Application
Terminal=true
Name=unmount-mount
Icon=/path/to/icon/icon.svg
Exec=/path/to/file/mount-unmount.sh
edit Icon= and Exec= and Name=
Also Terminal=True/false determines whether the terminal opens a window and displays output or runs in the background
Put this in unity panel by dragging it from files manager
yolo mark
./yolo_mark x64/Release/data/img x64/Release/data/train.txt x64/Release/data/obj.names
astuce yolomark
<- prev_img
-> next_img
c - clear_marks
n - one_object_per_img
0-9 - obj_id
m - show coords
ESC - exit”,
w - line width
k - hide obj_name
p - copy previous
o - track objects
r - delete selected
R-mouse - move box”
h - disable help”
h - show help”
For finalize the annotation of your dataset
Pour augmenter la taille du swap sous Ubuntu, voici les étapes à suivre :
D’abord, vérifiez la taille actuelle de votre partition ou fichier de swap avec la commande suivante :
swapon --show
Vous pouvez aussi vérifier l’espace total avec :
free -h
Avant de modifier ou de créer un nouveau fichier de swap, désactivez le swap actuel :
sudo swapoff -a
Supposons que vous souhaitiez créer un nouveau fichier de swap de 4 Go. Voici comment le faire :
sudo fallocate -l 4G /swapfile
Si fallocate n’est pas disponible, utilisez dd :
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
Assurez-vous que seuls les utilisateurs root peuvent lire et écrire dans le fichier :
sudo chmod 600 /swapfile
Formatez le fichier en tant qu’espace swap avec la commande suivante :
sudo mkswap /swapfile
Pour activer le nouveau fichier swap :
sudo swapon /swapfile
Vérifiez si le swap est bien actif et s’il a la taille désirée :
swapon --show
free -h
Pour rendre le changement persistant après redémarrage, ajoutez cette ligne au fichier /etc/fstab :
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Vous pouvez ajuster l’utilisation du swap par le système en modifiant le paramètre swappiness (0 signifie presque jamais utiliser le swap, 100 signifie l’utiliser agressivement) :
sudo sysctl vm.swappiness=10
Pour le rendre persistant, ajoutez cette ligne à /etc/sysctl.conf :
vm.swappiness=10
Ces étapes permettent d’augmenter ou de redimensionner le swap sous Ubuntu selon vos besoins.
1- Prepare your data with this new annotated picture
2- Run the inference with the first model generated with synthetic images.
Ouvrez un terminal et tapez :
lsblk
Notez le nom de votre partition principale (par exemple, /dev/mmcblk0p1).
⚠️ Attention : Assurez-vous d’avoir une sauvegarde de vos données importantes avant de continuer, car toute erreur peut rendre le système inutilisable.
Lancez fdisk :
sudo fdisk /dev/mmcblk0
Une fois dans fdisk, suivez les étapes suivantes pour supprimer et recréer la partition sans perdre de données.
Redémarrez votre Jetson Nano :
sudo reboot
Une fois redémarré, utilisez resize2fs pour redimensionner le système de fichiers afin qu’il occupe toute la partition :
sudo resize2fs /dev/mmcblk0p1
Utilisez df -h pour vérifier que la partition principale utilise maintenant toute la carte SD :
df -h