This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cannot start session without errors in phpMyAdmin | |
# https://stackoverflow.com/questions/5013118/cannot-start-session-without-errors-in-phpmyadmin | |
[root@centos ~]# cd /var/lib/php/ | |
[root@centos php]# ll | |
total 12 | |
drwxrwx---. 2 root apache 4096 Jan 30 16:23 opcache | |
drwxrwx---. 2 root apache 4096 Feb 5 20:56 session | |
drwxrwx---. 2 root apache 4096 Jan 30 16:23 wsdlcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Funzione per rimuovere le virgolette singole dal percorso | |
sanitize_path() { | |
echo "$1" | sed "s/^'//;s/'$//" | |
} | |
# Chiedi il percorso di origine | |
read -p "Inserisci il percorso della directory di origine (default: ./): " DIR | |
DIR=$(sanitize_path "${DIR:-"."}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clone con indicazione utente | |
git clone [email protected]{USERNAME}:{GIT-PATH}.git | |
fix remote | |
git remote set-url origin [email protected]{USERNAME}:{GIT-PATH}.git | |
undo last commit before push | |
alias revert-commit="git reset --soft HEAD~1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Colorize Shell | |
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pip install adafruit-circuitpython-neopixel | |
sudo pip install rpi-ws281x | |
# https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/issues/43 | |
#sudo python3 -m pip install --force-reinstall adafruit-blinka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -al ~/.ssh | |
# Lists the files in your .ssh directory, if they exist | |
# Check the directory listing to see if you already have a public SSH key. | |
# By default, the filenames of supported public keys for GitHub are one of the following. | |
# id_rsa.pub | |
# id_ecdsa.pub | |
# id_ed25519.pub | |
ssh-keygen -t ed25519 -C "email" # This creates a new SSH key, using the provided email as a label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RESCUE WINDOWS RAW DISK (D:) | |
chkdsk D: /F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
from dotenv import load_dotenv | |
def get_variable(var_name: str) -> bool: #semplificazione lettura bools .env | |
TRUE_=('true', '1', 't') # Add more entries if you want, like: `y`, `yes`, ... | |
FALSE_=('false', '0', 'f') | |
value = os.getenv(var_name, 'False').lower() # return `False` if variable is not set. To raise an error, change `'False'` to `None` | |
if value not in TRUE_ + FALSE_: | |
raise ValueError(f'Invalid value `{value}` for variable `{var_name}`') | |
return value in TRUE_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo chown $USER /path/dir* | |
# | |
# blkid | |
# nano /etc/fstab | |
# UUID=******* /path/dir1 ext4 auto,defaults 0 0 | |
# UUID=******* /path/dir2 ntfs-3g rw 0 0 | |
# | |
# sudo mount -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mp4 -map 0 -map_metadata -1 -c copy output.mp4 |
NewerOlder