first commit

This commit is contained in:
piccihud
2023-02-04 16:03:52 +01:00
commit 4afe898720
94 changed files with 4663 additions and 0 deletions

126
Alias-Bash.md Normal file
View File

@@ -0,0 +1,126 @@
# Alias
In un sistema GNU/Linux è possibile personalizzare la shell impostando degli `alias`, cioè delle scorciatoie per i comandi lunghi utilizzati frequentemente. Ad esempio, digitando il comando
```bash
ls -a --color=auto
```
in un terminale otteniamo l"elenco delle cartelle e dei file (ls), compresi i file nascosti (-a), il tutto reso mediante una colorazione che automaticamente differenzia gli elementi (--color=auto). Con la definizione di un alias per il comando ls si può fare in modo che venga eseguito completo dei parametri senza bisogno di specificarli.
## Creazione di alias in Bash
La creazione di alias in bash è molto semplice. La sintassi è la seguente:
```bash
alias alias_name="command_to_run"
```
Quindi, riprendendo l"esempio precedente:
```bash
alias lsc="ls -a --color=auto"
```
Ora, se si digita il comando `lsc` sulla console, si otterrà lo stesso output che si avrebbe digitando `ls -a --color=auto`.
## Creare alias permanenti
L"alias sarà disponibile solo nella sessione di shell corrente: se si esce dalla sessione o si apre una nuova sessione da un altro terminale, l"alias non sarà utilizzabile.
Per rendere persistente l"alias è necessario dichiararlo nel file `~/.bash_profile` o `~/.bashrc`.
Aprire il file `~/.bashrc` e aggiungere i propri alias:
```bash
nano ~/.bashrc
...
# Aliases
# alias alias_name="command_to_run"
# color ls
alias ll="ls -la"
```
Una volta fatto, salvare e chiudere il file. Per rendere disponibili gli alias nella sessione corrente digitare:
```bash
source ~/.bashrc
```
## Creazione di alias Bash con argomenti (funzioni)
A volte potrebbe essere necessario creare un alias che accetta uno o più argomenti, ecco dove le funzioni bash sono utili.
La sintassi per creare una funzione bash è molto semplice. Possono essere dichiarati in due diversi formati:
```bash
function_name () {
[commands]
}
```
Oppure:
```bash
function function_name {
[commands]
}
```
Per passare un numero qualsiasi di argomenti alla funzione bash, si deve inserirli subito dopo il nome della funzione, separati da uno spazio. I parametri passati sono $1, $2, $3 , ecc, dove il numero indica la posizione del parametro dopo il nome della funzione. La variabile $0 è riservata per il nome della funzione.
Ecco una semplice funzione bash che creerà una directory e poi si sposterà in essa:
```bash
mkcd ()
{
mkdir -p -- "$1" && cd -P -- "$1"
}
```
Come per gli alias, bisogna aggiungere la funzione al file `~/.bashrc` ed eseguire il comando `source ~/.bashrc` per ricaricare il file.
Quindi, invece di utilizzare `mkdir` creare una nuova directory e il comando `cd` spostarsi in quella directory, è possibile digitare:
`mkcd nuova_cartella`
## List all Alias
Per vedere gli alias presenti, basta il seguente comando:
```bash
alias
```
## Alias che potrebbero tornare utili
```bash
## Terminal shortcuts
alias ..="cd ../"
alias ...="cd ../../"
alias ....="cd ../../../"
alias .....="cd ../../../../"
alias ll="ls -alhF --color=auto"
alias lc="ls -l --color=auto"
alias lsd="exa -lha --icons"
alias update="sudo apt update ; sudo apt -y upgrade ; sudo apt -y autoremove ; flatpak upgrade -y; flatpak uninstall --unused -y; sudo pkcon refresh ; sudo pkcon -y update"
alias install="sudo apt install -y"
alias reboot="sudo /sbin/reboot"
alias poweroff="sudo /sbin/poweroff"
alias grep="grep --color=auto"
alias egrep="egrep --color=auto"
## Github shortcuts
alias repo="gh repo create"
alias gi="git init"
alias ga="git add -A"
alias gc="git commit -m"
```
## Collegamenti
- [https://guide.debianizzati.org/index.php/Alias](https://guide.debianizzati.org/index.php/Alias)
- [https://noviello.it/come-creare-alias-bash-su-linux/](https://noviello.it/come-creare-alias-bash-su-linux/)

157
Bash_PS1.md Normal file
View File

@@ -0,0 +1,157 @@
# Personalizzare Bash
Il prompt di default della riga comandi di Linux può essere personalizzato facilmente modificando la variabile di ambiente PS1.
`PS1="[stringa]"`
La composizione della stringa nel comando PS1 determina come apparirà il prompt.
## Come visualizzare la stringa del prompt corrente
Pe vedere la configurazione attuale del prompt basta digitare sulla riga comandi
`ECHO $PS1`
Sullo schermo viene visualizzata la stringa corrente, quella che definisce l'aspetto attuale del prompt. Ad esempio:
```bash
echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
```
## Le principali opzioni
Le principali opzioni per comporre la stringa sono le seguenti:
- `\d` visualizza la data formato "Giorno-della-settimana Mese Data" ("Tue May 26");
- `\H` visualizza il nome dell'host;
- `\t` visualizza l'ora nel formato a 24 ore ( HH:MM:SS);
- `\A` visualizza l'ora nel formato a 24 ore ( HH:MM );
- `\u` visualizza il nome dell'utente corrente;
- `\w` visualizza il nome della directory corrente o la tilde nel caso della directory $HOME;
- `\$` visualizza il simbolo $ per gli utenti normali o # per l'utente root;
- `\\` visualizza un singolo backslash;
- `\n` il carattere "newline";
- `\r` il carattere "carriage return";
- `\s` il nome della shell, il nome base di $0;
- `\!` il numero cronologico (history number) di questo comando;
- `\[` comuncia una sequenza di caratteri non stampabili, che potrebbero essere usati per inserire una sequenza di controllo del terminale nel prompt;
- `\]` termina la sequenza di caratteri non stampabili.
Si possono anche utilizzare colori, icone e altri elementi grafici utilizzando codici di colore ANSI e icone speciali. Il formato è
`\[\033[CODICE;COLOREm\]`
## Modificare la variabile $PS1
Per modificare la variabile PS1 si può usare il comando
`export PS1="nuova stringa di prompt"`
ad esempio
`export PS1="\u@\h:\w$ "`
visualizzerà il nome dell'utente, il nome del host e la directory corrente.
### Salvare le modifiche
Per rendere permanenti le modifiche alla variabile PS1 si può aggiungere il comando export alla fine del file `.bashrc` presente nella home dell'utente.
```bash
# codici dei colori
DEFAULT="\[\033[0m\]"
RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
EBLACK="\[\033[1;30m\]"
PURPLE="\[\033[35m\]"
YELLOW="\[\033[1;33m\]"
CYAN="\[\033[1;36m\]"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
export PS1="$GREEN[\A \d]$CYAN\u$BLUE@\h $DEFAULT(\!):$YELLOW\w $PURPLE\n\$(parse_git_branch)$DEFAULT > "
```
Riavviare il terminale o eseguire il comando `source ~/.bashrc` per rendere effettive le modifiche.
La funzione `parse_git_branch` è una funzione personalizzata che consente di visualizzare il nome della branch corrente del repository git sulla riga di comando.
In particolare:
- `git branch 2> /dev/null`: esegue il comando git branch e reindirizza l'output di errore in `/dev/null`, in modo che non venga visualizzato alcun messaggio di errore se non si è in un repository git;
- `sed -e '/^[^*]/d'`: utilizza sed per eliminare tutte le righe che non iniziano con un asterisco;
- `-e 's/* \(.*\)/\1/'`: utilizza sed per sostituire la riga restante con solo il contenuto dopo l'asterisco (che è il nome della branch corrente).
La funzione utilizzando questi comandi, restituirà solo il nome della branch corrente del repository git.
```bash
[23:05 lun gen 16]davide@laptop (2000):~/Documenti/Appunti.wiki
master >
```
## Come avere una lunghezza indefinita della history
```bash
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=-1
HISTFILESIZE=-1
```
Basta impostare a `-1` questi valori nel file `.bashrc`.
## Ricerca nella history
Per ricercare aventi e indietro nella cronologia dei comandi, mentre questi vengono digitati, tramite i tasti PAGUP e PAGDOWN, aggiungere il seguente testo nel file `~/.inputrc`:
```bash
"\e[5~": history-search-backward
"\e[6~": history-search-forward
```
I tasti `\e[5` e `\e[6` sono proprio PAGUP e PAGDOWN.
In ogni caso, la pressione dei tasti CTRL+R permette di effettuare la ricerca ricorsiva dei comandi precedentemente digitati.
### Hstr
`hstr` è un comando che aiuta a navigare in maniera più efficace nella history. Per installarlo basta digitare questo semplice comando:
```bash
sudo apt install hstr
```
Ora, con la combinazione `CTRL+r` si accederà alla ricerca dei comandi.
Hstr può essere configurato per fornire suggerimenti di ricerca durante la digitazione, simile ai suggerimenti che vengono visualizzati in genere in un browser Web e in altre applicazioni.
Suggerisce i comandi utilizzati più spesso e li mantiene in cima alla lista. È inoltre possibile aggiungere manualmente i comandi ai preferiti per un accesso facile e veloce.
Aggiungere il testo seguente al file `.bashrc` per la configurazione:
```bash
# HSTR configuration - add this to ~/.bashrc
alias hh=hstr # hh to be alias for hstr
export HSTR_CONFIG=monochromatic # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
# ensure synchronization between bash memory and history file
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
```
## Collegamenti
- [https://linuxhint.com/bash-ps1-customization/](https://linuxhint.com/bash-ps1-customization/)
- [http://www.megalab.it/5827/8/come-cambiare-il-prompt-di-bash](http://www.megalab.it/5827/8/come-cambiare-il-prompt-di-bash)
- [http://www.pluto.it/sites/default/files/ildp/HOWTO/Bash-Prompt-HOWTO/Bash-Prompt-HOWTO-2.html](http://www.pluto.it/sites/default/files/ildp/HOWTO/Bash-Prompt-HOWTO/Bash-Prompt-HOWTO-2.html)
- [https://linuxhint.com/hstr-command-history-browser-in-linux/](https://linuxhint.com/hstr-command-history-browser-in-linux/)

178
ClamAV.md Normal file
View File

@@ -0,0 +1,178 @@
# ClamAV e scansioni automatiche
ClamAV è un antivirus multipiattaforma.
## Installazione
```bash
sudo apt install clamav
```
## Utilizzo
### Aggiornare il database dei virus
Per aggiornare il database dei virus digitare il seguente comando in un terminale:
```bash
sudo freshclam
```
Nel caso si riscontrasse il seguente errore:
```bash
ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!
```
bisogna uccidere il processo che utilizza il file freshclam.org
```bash
sudo lsof /var/log/clamav/freshclam.log
lsof: WARNING: can't stat() fuse.portal file system /run/user/19201007/doc
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
freshclam 217908 clamav 3wW REG 253,0 5565 1444631 /var/log/clamav/freshclam.log
```
Quindi uccidere il processo col comando:
```bash
sudo kill -9 ${PID}
```
Ora è possibile aggiornare il database:
```bash
sudo freshclam
Sat Dec 31 16:14:18 2022 -> ClamAV update process started at Sat Dec 31 16:14:18 2022
Sat Dec 31 16:14:18 2022 -> daily.cld database is up-to-date (version: 26767, sigs: 2014726, f-level: 90, builder: raynman)
Sat Dec 31 16:14:18 2022 -> main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
Sat Dec 31 16:14:18 2022 -> bytecode.cvd database is up-to-date (version: 333, sigs: 92, f-level: 63, builder: awillia2)
```
Altre possibili soluzioni:
```bash
sudo /etc/init.d/clamav-freshclam stop
sudo freshclam
sudo /etc/init.d/clamav-freshclam start
sudo service clamav-freshclam stop
sudo freshclam
sudo service clamav-freshclam start
sudo systemctl stop clamav-freshclam.service
```
In ogni caso, riavviare il servizio:
```bash
sudo systemctl start clamav-freshclam.service
```
### Aggiornamento automatico
Per impostare l'aggiornamento automatico ogni giorno del database delle definizioni si può usare il comando:
```bash
sudo freshclam -d -c 1
```
## Scansione da Terminale
La sintassi predefinita per utilizzare la scansione di file e cartelle è la seguente:
```bash
clamscan <opzione> /cartella/da/scansionare
```
Pertanto per scansionare l'intera home dell'utente (tutti i file, cartelle e sotto cartelle presenti) digitare in un terminale:
```bash
clamscan -r /home
```
Questo l'output finale:
### Alcune opzioni utili:
- `-i`: Mostra nel terminale solo i file risultati positivi alla scansione;
- `--log=clamavlog.txt`: Crea il file clamavlog.txt nella propria home contenente il resoconto della scansione. I file risultati positivi alla scansione saranno indicati con la scritta FOUND;
- `--exclude-dir='/percorso/da/escludere'`: Esclude una cartella dalla scansione;
- `-r`: Scansione ricorsiva;
- `--move=/patch/to/folder`: Sposta/Copia tutti i file infetti della cartella scansionata in una directory dedicata per poterli controllare successivamente.
Ecco un esempio di comando:
```bash
clamscan -ir /$HOME --log=clamavlog.txt --move=$HOME/quarantine/
```
Creare la directory `~/quarantine`.
## Creazione cronjob
```bash
crontab -e
```
ed inserire il seguenti job:
```bash
0 9,13,18 * * * nice -n 19 clamscan -ir /$HOME --log=clamavlog.txt --move=/$HOME/quarantine/ 2>&1
```
Ogni giorno, alle ore 9, 13 e alle ore 18, viene eseguita la scansione.
`nice`: il comando nice serve per eseguire un processo con una priorità differente da quella standard. La priorità può essere impostata con valori fra -20 e 19, dove -20 è la priorità più alta e 19 la più bassa. Il valore di nice è un “suggerimento” al sistema sulla priorità del processo, che il sistema può prendere in considerazione o ignorare.
### Verificare l'esecuzione
Per verificare se i crontab sono stati eseguiti, leggere i log di cron:
```bash
tail /var/log/cron
Nov 30 23:30:00 mioserver crond[18340]: (root) CMD (/bin/sh /root/mybackup.sh &)
Dec 1 00:03:00 mioserver crond[20399]: (pippo) CMD (/bin/sh /root/myscript.sh &)
```
Il log contiene le seguenti informazioni:
- `Timestam`: la data di esecuzione del cron job;
- `Hostname`: il nome host del server su cui è eseguito il cron;
- Il demone cron e, tra parensi quadre, il PID del processo;
- `Username`: il nome utente che esegue il cron job, tra parentesi tonde;
- `CMD`: il comando/script da eseguire.
Oppure guardando il file di log nella home directory:
```bash
cat clamavlog.txt
-------------------------------------------------------------------------------
----------- SCAN SUMMARY -----------
Known viruses: 8646692
Engine version: 0.103.7
Scanned directories: 3043
Scanned files: 50608
Infected files: 0
Total errors: 4
Data scanned: 4794.27 MB
Data read: 3542.08 MB (ratio 1.35:1)
Time: 524.361 sec (8 m 44 s)
Start Date: 2022:12:31 16:34:03
End Date: 2022:12:31 16:42:48
-------------------------------------------------------------------------------
----------- SCAN SUMMARY -----------
Known viruses: 8646692
Engine version: 0.103.7
Scanned directories: 3070
Scanned files: 50963
Infected files: 0
Data scanned: 4831.48 MB
Data read: 3560.17 MB (ratio 1.36:1)
Time: 510.803 sec (8 m 30 s)
Start Date: 2022:12:31 17:36:01
End Date: 2022:12:31 17:44:32
```

209
Crontab.md Normal file
View File

@@ -0,0 +1,209 @@
## Crontab
Nei sistemi operativi GNU-Linux, il comando `crontab` consente di pianificare l'esecuzione automatica e periodica di attività o script.
Ogni attività è chiamata `cron job`.
## Sintassi
Ogni riga presenta una sequenza di campi, divisi da uno spazio, come in questo esempio
```bash
0 23 * * * /root/mybackup.sh
```
Questo il significato: al minuto 0 delle ore 23, tutti i giorni del mese, tutti i mesi, tutti i giorni della settimana, esegui lo script "/root/mybackup.sh" .
In poche parole, esegue lo script tutti i giorni alle ore 23.00.
Ecco il dettaglio tutti i possibili valori di questi campi, in ordine di inserimento:
|Campo|Valore|
|---|---|
|Minuti|0 - 59|
|Ore|0 - 23|
|Giorno del mese|1 - 31|
|Mese|1 - 12|
|Giorno della settimana|0 - 7|
```txt
.---------------- [m]inute: minuto (0 - 59)
| .------------- [h]our: ora (0 - 23)
| | .---------- [d]ay [o]f [m]onth: giorno del mese (1 - 31)
| | | .------- [mon]th: mese (1 - 12) OPPURE jan,feb,mar,apr...
| | | | .---- [d]ay [o]f [w]eek: giorno della settimana (0 - 7) (la domenica vale 0 o 7) OPPURE sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * comando da eseguire
```
- `*` l'operatore asterisco indica qualsiasi valore. Se il simbolo asterisco è presente nel campo Hour, significa che l'attività verrà eseguita ogni ora;
- `,` l'operatore virgola consente di specificare un elenco di valori. Ad esempio, se si dispone 1,3 nel campo Hour, l'attività verrà eseguita all'1:00 e alle 03:00;
- `-` l'operatore trattino consente di specificare un intervallo di valori. Se è presente 1-5 nel campo Day of a week, l'attività verrà eseguita tutti i giorni feriali (dal lunedì al venerdì).
- `/` l'operatore backslash consente di specificare valori che verranno ripetuti in un determinato intervallo. Ad esempio, se è presente `*/4` nel campo Hour, significa che l'azione verrà eseguita ogni quattro ore. È lo stesso che specificare 0,4,8,12,16,20.
## Impostare un'attività
Per aggiungere/modificare/eliminare le attività, dare il seguente comando:
```bash
crontab -e
```
Digitare quindi il carattere `i` (insert) per editare il file di crontab.
Per visualizzare le attività nel file crontab:
```bash
crontab -l
```
Per rimuovere il file crontab corrente:
```bash
crontab -r
```
## Variabili d'ambiente
Le variabili ambientali utilizzano la seguente forma:
`NOME = valore`
Per motivi di leggibilità, dovrebbero essere inserite in testa al file generato dal comando crontab.
Le variabili a cui è possibile assegnare un valore sono:
- `SHELL`: se non assegnata viene impostata automaticamente da Cron a /bin/sh. Altrimenti impostare la variabile ambientale SHELL in maniera conforme all'interprete utilizzato, ad esempio: `SHELL=/bin/bash`
Questa modifica potrebbe essere necessaria nel caso in cui si voglia eseguire attraverso Cron uno script Bash.
- `MAILTO`: se questa variabile è impostata, il demone Cron invierà un'email, con l'output del/dei comando/comandi specificati in crontab, all'utente specificato. È possibile specificare più utenti separandoli con una virgola. Se la variabile è impostata a `""`, allora non verranno inviate email.
Ovviamente, affinché Cron possa inviare con successo le email, bisogna avere un MTA installato e funzionante sulla propria macchina.
## Alcuni esempi pratici
```bash
*/20 * * * * /root/mybackup.sh
#Lo script viene eseguito ogni 20 minuti
0 23 * * * /root/mybackup.sh
#Lo script viene eseguito alle ore 23.00 tutti i giorni
0 9,23 * * * /root/mybackup.sh
#Lo script viene eseguito alle ore 09.00 e alle ore 23.00 tutti i giorni
0 7 * * 0 /root/mybackup.sh
#Lo script viene eseguito alle ore 07.00 della domenica
0 7 * 5 6 /root/mybackup.sh
#Lo script viene eseguito alle ore 07.00 ogni sabato del mese di maggio
15 7 * 5 6 /root/mybackup.sh
#Lo script viene eseguito alle ore 07.15, ogni sabato di maggio
* * * * * /root/mybackup.sh
#Lo script viene eseguito ogni minuto
*/5 * * * * /root/mybackup.sh
#Lo script viene eseguito ogni 5 minuti
0 17 * * 1,5 /root/mybackup.sh
#Lo script viene eseguito alle ore 17.00 di lunedì e domenica
0 */5 * * * /root/mybackup.sh
#Lo script viene eseguito ogni 5 ore (05.00, 10.00, ...)
* * * * * sleep 30; /root/mybackup.sh
#Lo script viene eseguito ogni 30 secondi
```
**Alias**
```bash
0 * * * * /root/mybackup.sh
#oppure
@hourly /root/mybackup.sh
#Lo script viene eseguito ogni ora
0 0 * * * /root/mybackup.sh
#oppure
@daily /root/mybackup.sh
#Lo script viene eseguito ogni giorno alle 00.00
0 0 * 0 0 /root/mybackup.sh
#oppure
@weekly /root/mybackup.sh
#Lo script viene eseguito ogni settimana (alle 00.00 di ogni domenica)
0 0 1 * * /root/mybackup.sh
#oppure
@monthly /root/mybackup.sh
#Lo script viene eseguito il primo di ogni mese (alle 00.00)
```
**Lanciare più script**
È possibile lanciare più script contemporaneamente, separandoli con il ";"
```bash
0 0 * * * /root/mybackup.sh; /home/myscript.sh
#I due script vengono eseguiti ogni giorno alle ore 00.00
```
**Lanciare uno script all'avvio del sistema**
```bash
@reboot /root/backup.sh
```
**Verificare l'esecuzione**
Per verificare se i crontab sono stati eseguiti, leggere i log di cron:
```bash
$ tail /var/log/cron
Nov 30 23:30:00 mioserver crond[18340]: (root) CMD (/bin/sh /root/mybackup.sh &)
Dec 1 00:03:00 mioserver crond[20399]: (pippo) CMD (/bin/sh /root/myscript.sh &)
```
Il log contiene le seguenti informazioni:
- *Timestamp*: la data di esecuzione del cron job;
- *Hostname*: il nome host del server su cui è eseguito il cron;
- Il *demone cron* e, tra parensi quadre, il *PID* del processo;
- *Username*: il nome utente che esegue il cron job, tra parentesi tonde;
- *CMD*: il comando/script da eseguire.
## Backup e ripristino
### Esportare un file crontab
Se si volesse salvare il proprio crontab per esportarlo su un'altra macchina o semplicemente per farne una copia di backup, la procedura è semplicissima:
```bash
crontab -l > mycrontab
```
in questo modo il file crontab verrà salvato nel file mycrontab.
### Importare un file crontab
Questa procedura è utile per importare un file in cui si è precedentemente salvato il contenuto di un file crontab oppure per importare un file editato a mano attraverso un qualsiasi altro editor, testuale o grafico:
```bash
crontab mycrontab
```
**Attenzione**: il file crontab, se presente, verrà sovrascritto!
## Collegamenti
- [https://noviello.it/come-pianificare-scheduling-cron-jobs-con-crontab-su-linux/](https://noviello.it/come-pianificare-scheduling-cron-jobs-con-crontab-su-linux/)
- [https://howto.webarea.it/linux/utilizzo-di-crontab-per-schedulare-processi-con-esempi-sotto-linux_1](https://howto.webarea.it/linux/utilizzo-di-crontab-per-schedulare-processi-con-esempi-sotto-linux_1)
- [https://guide.debianizzati.org/index.php/Utilizzo_del_servizio_di_scheduling_Cron](https://guide.debianizzati.org/index.php/Utilizzo_del_servizio_di_scheduling_Cron)

0
DD.md Normal file
View File

152
Database.md Normal file
View File

@@ -0,0 +1,152 @@
# Database
## Installazione PostgreSQL
```bash
sudo apt install postgresql
service postgresql start
service postgresql status
```
### Console di PostgreSQL
```bash
\l lista database
\d lista tabelle
\du lista utenti
```
### Configurazione per accesso da remoto
Il server PostgreSQL è configurabile mediante tre file:
- postgresql.conf
- pg_hba.conf
- pg_ident.conf
che si trovano in `/etc/postgresql/x.y/main/`
Per applicare le modifiche va fatto il *restart* del server.
Per consentire a tutti gli indirizzi IP di connettersi al server PostgreSQL, si devono modificare i file di configurazione precedenti.
#### Configurare postgresql.conf
Aprire il file e apportare alcune modifiche per consentire la connessione remota.
```bash
sudo nano /etc/postgresql/xx/main/postgresql.conf
```
Nel file cercare "listen_addresses" e aggiungere la seguente riga:
```bash
#listen_addresses = 'localhost'
listen_address = '*'
```
Ciò cambia l'indirizzo di ascolto da localhost a "*", che consentirà a qualsiasi indirizzo IP di connettersi al server del database. Oppure se si desidera specificare alcuni IP particolari, è possibile digitarli con spazi tra ciascun indirizzo IP.
#### Configurare pg_hba.conf
Per consentire ad utenti particolari di essere collegati al database, bisogna apportare modifiche al file *pg_hba.conf* . Questo file sarà disponibile nella stessa directory di cui sopra.
```bash
sudo nano /etc/postgresql/xx/main/pg_hba.conf
```
Nel file aggiungere le seguenti righe:
```bash
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5
host all all :/0 md5
```
Salvare il file di configurazione. Ora, riavviare il database eseguendo il comando indicato di seguito:
```bash
service postgresql restart
```
Infine, aprire la porta **5432** nel firewall col comando:
```bash
sudo ufw allow 5432
```
Altre info: [https://noviello.it/come-configurare-postgresql-per-consentire-le-connessioni-remote/](https://noviello.it/come-configurare-postgresql-per-consentire-le-connessioni-remote/)
## User
### Create user
```bash
sudo su postgres
psql
CREATE USER <name> SUPERUSER CREATEDB;
```
Se l'utente esistesse già:
```bash
ALTER USER <name> WITH PASSWORD <password>;
```
Altre info: [https://phoenixnap.com/kb/postgres-create-user](https://phoenixnap.com/kb/postgres-create-user)
### Drop user
```bash
DROP USER <name>;
```
## Database
### Create Database
```bash
CREATE DATABASE <database_name>
WITH
[OWNER = role_name]
[ALLOW_CONNECTIONS = true | false]
```
Altre info: [https://www.postgresql.org/docs/12/sql-createdatabase.html](https://www.postgresql.org/docs/12/sql-createdatabase.html)
### Backup manuale
```bash
pg_dump <database_name> > <file.sql>
```
### Restore
```bash
Da shell
:w
psql <database_name> < <file.sql>
```
Altre info: [https://www.tecmint.com/backup-and-restore-postgresql-database/](https://www.tecmint.com/backup-and-restore-postgresql-database/)
### Auto Backup PostgreSQL
```bash
$ mkdir -p ~/databases
$ crontab -e
0 0 * * * pg_dump -U postgres <db_name> > ~/databases/<db_name.sql>
```
L'automatismo partirà ogni giorno alle 24.00
## Estensione VSCodium
[https://github.com/cweijan/vscode-database-client](https://github.com/cweijan/vscode-database-client)
ID: cweijan.vscode-mysql-client
## Collegamenti
- [https://noviello.it/come-installare-postgresql-su-debian-10/](https://noviello.it/come-installare-postgresql-su-debian-10/)

185
Debian.md Normal file
View File

@@ -0,0 +1,185 @@
# Debian KDE
Come prima cosa, occorre scaricare la .iso della distro in questione:
[https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/11.6.0-live+nonfree/amd64/iso-hybrid/](https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/11.6.0-live+nonfree/amd64/iso-hybrid/)
Nell'esempio, `Debian 11 KDE`.
Al termine del download, creare la chiavetta con la live, al fine di poter intraprendere l'installazione.
## Balena Etcher
Come prima cosa, importare i repository:
```bash
curl -1sLf 'https://dl.cloudsmith.io/public/balena/etcher/setup.deb.sh' | sudo -E bash
```
Quindi procedere con l'installazione:
```bash
sudo apt update ; sudo apt install balena-etcher-electron -y
```
Adesso è possibile avviare il programma, seleziore l'.iso scaricata precedentemente, il supporto corretto ed avviare la procedura.
## Installazione di Debian
Avviare la live e da qui procedere con l'installazione guidata, cliccando sull'icona. Rispetto al 'graphic installer' del menù, è decisamente più semplice.
## Modificare i repository
Al fine di avere una distribuzione con pacchetti più aggiornati, occorre modificare il file `/etc/apt/source.list`.
[https://guide.debianizzati.org/index.php/Repository_ufficiali](https://guide.debianizzati.org/index.php/Repository_ufficiali)
Se si vuole restare sempre con la versione testing di Debian, a prescindere dai rilasci di Debian, scegliere questa configurazione:
```bash
# Debian testing
deb http://deb.debian.org/debian/ testing main
deb-src http://deb.debian.org/debian/ testing main
# Aggiornamenti di sicurezza
deb http://security.debian.org/debian-security testing-security main
deb-src http://security.debian.org/debian-security testing-security main
# Gli aggiornamenti raccomandati per testing (testing-updates) sono disabilitati
```
Quindi procedere con l'aggiornamento dei pacchetti:
```bash
sudo apt update ; sudo apt -y upgrade ; sudo apt autoremove -y ; sudo apt autoclean -y ; pkcon refresh ; pkcon update -y
```
## Bismuth
```bash
echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list > /dev/null
wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null
sudo apt update && sudo apt install kwin-bismuth
```
Tramite `Bismuth`, uno script per KDE, è possibile avere semplicemente un tiling window manager.
[https://github.com/Bismuth-Forge/bismuth](https://github.com/Bismuth-Forge/bismuth)
![bismuth](./asset/debian/debian/bismuth.png 'Bismuth')
## Papirus Icon
[https://github.com/PapirusDevelopmentTeam/papirus-icon-theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme)
Il miglior icon pack per Gnu/Linux!
```bash
sudo apt update ; sudo apt install papirus-icon-theme -y
```
![papirus](./asset/debian/papirus.png 'Papirus icon pack')
### Papirus Theme for LibreOffice
[https://sourcedigit.com/23703-install-papirus-theme-for-libreoffice-papirus-libreoffice-theme/](https://sourcedigit.com/23703-install-papirus-theme-for-libreoffice-papirus-libreoffice-theme/)
```bash
wget -qO- https://raw.githubusercontent.com/PapirusDevelopmentTeam/papirus-libreoffice-theme/master/install-papirus-root.sh | sh
```
In questo modo si installa il tema per LibreOffice, indipendentemente dalla distro.
![Papirus Theme](./asset/debian/libreoffice1.png 'Opzioni')
![Papirus Theme](./asset/debian/libreoffice2.png 'Vista')
## Firefox
Per installare la versione normale, non quella ESR (Extended Release Support), di Firefox su Debian Testing, seguire questa guida:
[https://wiki.debian.org/it/Firefox](https://wiki.debian.org/it/Firefox)
Basta scaricare il file .deb e procedere con l'installazione:
[https://packages.debian.org/sid/amd64/firefox/download](https://packages.debian.org/sid/amd64/firefox/download)
```txt
davide@piccihud:~/Scaricati$ ls -1lh
totale 88M
-rw-r--r-- 1 davide davide 57M 24 set 14.11 firefox_105.0-1_amd64.deb
sudo apt install ./firefox_105.0-1_amd64.deb
sudo apt purge -y firefox-esr
sudo rm firefox_105.0-1_amd64.deb
```
> NOTA: in questo modo l'applicazione si aggiornerà solo manualmente
![Firefox](./asset/debian/firefox.jpeg 'Firefox')
## Rofi
Installare Rofi e poi procedere con le sue configurazioni: ![Rofi](https://gitea.it/PicciHud/Appunti/wiki/Rofi)
```bash
sudo apt update && sudo apt install -y rofi
```
## .NET
[https://learn.microsoft.com/it-it/dotnet/core/install/linux-debian](https://learn.microsoft.com/it-it/dotnet/core/install/linux-debian)
## Brave Browser
[https://brave.com/linux/#nightly-channel-installation](https://brave.com/linux/#nightly-channel-installation)
## Newsboat : RSS/Atom feedreader
Si tratta di un lettore RSS testuale. Si installa direttamente dai repo ufficiali di Debian:
```bash
sudo apt update ; sudo apt install newsboat
```
Per le varie configurazioni, seguire la documentazione ufficiale:
[https://newsboat.org/releases/2.29/docs/newsboat.html](https://newsboat.org/releases/2.29/docs/newsboat.html)
Per aggiungere un feed, basta inserirle URL in questo file:
```bash
~/.newsboat/urls
```
Oppure è possibile importare un file OPML con il seguente comando:
```bash
newsboat -i file.opml
```
I comandi base:
- `Shift+R`: download degli articoli dai feed inseriti;
- `/`: ricerca all'interno di tutti i files;
- `A`: marca il feed come letto;
- `Q`: chiude Newsboat;
- `O`: apre l'articolo nel browser;
- `Q`: permette di ritornare nel terminale.
### Fluent Reader
Una valida alternativa:
[https://hyliu.me/fluent-reader/](https://hyliu.me/fluent-reader/)
## Collegamenti
- [https://wiki.debian.org/it/SourcesList](https://wiki.debian.org/it/SourcesList)
- [https://www.debian.org/devel/testing](https://www.debian.org/devel/testing)
- [https://it.linux-console.net/?p=348#gsc.tab=0](https://it.linux-console.net/?p=348#gsc.tab=0)

0
Epson_WF2510.md Normal file
View File

184
Fairphone4.md Normal file
View File

@@ -0,0 +1,184 @@
# Liberare il Fairphone 4
Per installare una custom rom su un qualsiasi cellulare, il primo passo è quello di **sbloccarne il bootloader**, il programma che, nella fase di avvio (boot) del computer, carica il kernel del sistema operativo dalla memoria secondaria (ad esempio un hard disk) alla memoria primaria (generalmente la RAM), permettendone l'esecuzione da parte del processore e il conseguente avvio del sistema.
Prima di procedere, è necessario installare **adb** (Android Debug Bridge), uno strumento compreso all'interno del software SDK (Software Develompent Kit) e usato per mettere in comunicazione un dispositivo Android ed un computer, tramite un'interfaccia a riga di comando.
Su Debian basta lanciare il seguente comando:
```bash
sudo apt install android-tools-adb android-tools-fastboot
```
## Sbloccare il bootloader - parte 1
Si ricorda che, sbloccando il bootloader, saranno **cancellati tutti** i dati presenti nel cellulare.
Ogni telefono ha una procedura differente per lo sblocco. Quella del Fairphone è molto semplice e descritta ai seguenti link:
[https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader](https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader)
[https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/](https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/)
### Ottenere il codice di sblocco
Scollegare il cellulare dal computer, se precedentemente connesso.
1. Trovare il codice IMEI del telefono:
* **Impostazioni > Informazioni sul telefono > IMEI (slot SIM 1)**
!['IMEI'](./asset/fairphone/bootloader1.png)
2. Trovare il Serial Number (S/N) del dispositivo:
* **Impostazioni > Informazioni sul telefono > Modello > Numero di Serie**
!['S/N'](./asset/fairphone/bootloader2.png)
3. A [questo indirizzo](https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/) inserire il codice IMEI e il S/N per ottenere il codice di sblocco
!['Ottenere il codice di sblocco'](./asset/fairphone/unlock.png)
### Inserire il codice per lo sblocco
1. Abilitare la `modalità sviluppatore`
* **Impostazioni > Informazioni sul telefono > Numero build**
* Premere tante volte (di solito 7) finché non apparirà il messaggio `attivato le impostazioni di sviluppo`
!['Abilitare la modalità sviluppatore'](./asset/fairphone/bootloader3.png)
2. Abilitare lo sblocco del bootloader (OEM) e la modalità `debug USB`
* **Impostazioni > Sistema > Opzioni sviluppatore** e abilitare la voce `Sblocco EOM`, quindi inserire il codice precedentemente ottenuto, come da immagine:
|Inserire il codice||
|:---:|:---:|
|!['Sblocco OEM'](./asset/fairphone/bootloader4.png)|!['Sblocco OEM'](./asset/fairphone/bootloader5.png)|
1. Ora abilitare la voce `Debug USB`, affinché sia possibile impartire dei comandi tramite `adb`.
## Sbloccare il bootloader - parte 2
Collegare, tramite cavo USB, il cellulare al computer, nel quale sia stato precedentemente installato `adb` e aprire una shell dei comandi. Quindi digitare:
```bash
adb -l devices # Lista dei dispositivi connessi
List of devices attached
15b99cd8 device
```
Sul cellulare apparirà una notifica, quindi consentire il debug, cosicché il telefono sia rilevato e sia possibile lanciare i comandi:
!['Consentire il debug USB'](./asset/fairphone/allowdebug.webp)
Proseguire con i comandi seguenti per effettuare lo sblocco del bootloader dalla modalità `fastboot` ([https://en.wikipedia.org/wiki/Fastboot](https://en.wikipedia.org/wiki/Fastboot)):
```bash
abd reboot bootloader # Riavvia il telefono in modalità fastboot
fastboot flashing unlock
# Seguire le istruzioni a video e confermare.
# IMPORTANTE: verranno CANCELLATI TUTTI I DATI
```
Riavviare il cellulare ed entrare nuovamente in `fastboot mode`:
```bash
abd reboot bootloader
fastboot flashing unlock_critical
# Seguire le istruzioni a video e confermare lo sblocco
```
Riavviare il dispositivo.
Ora il bootloader è sbloccato ed è possibile installare una **custom rom**.
## Installazione DivestOS
Il Fairphone 4 ha a disposizione diverse custom rom ad oggi, fine 2022, come:
- CalyxOS ([https://calyxos.org/install/devices/FP4/linux/](https://calyxos.org/install/devices/FP4/linux/))
- DivestOS ([https://divestos.org/index.php?page=bootloader](https://divestos.org/index.php?page=bootloader))
- /e ([https://doc.e.foundation/devices/FP4/install](https://doc.e.foundation/devices/FP4/install))
- iodè ([https://gitlab.com/iode/ota](https://gitlab.com/iode/ota))
Nella guida procederemo con l'installazione di ` DivestOS 20.0 beta`, una custom rom basata su Android 13. Se si preferisce una versione più stabile, scaricare la versione `19.1`, basata su Android 12L.
**DivestOS** è un sistema operativo (SO) libero basato su Android. È un fork di LineageOS che mira ad aumentare la sicurezza e la privacy, il più possibile rimuovendo le componenti proprietarie di Android e includendo solo software libero.
Le build di DivestOS sono firmate, quindi il bootloader può essere ribloccato su molti dispositivi.
DivestOS include poche applicazioni predefinite, come F-droid, uno store per applicazioni FOSS, Mull, un fork di Firefox Mobile, Graphene Camera e poco altro. **NON INCLUDE LE GAPPS** e i servizi di Google (se per il dispositivo dovesse essere disponibile la recovery `TWRP` e venisse installata al posto della recovery stock di DivestOS, sarebbe possibile installarne il relativo pacchetto. Non risulta, al momento, disponibile per il Fairphone 4).
La sottostante procedura d'installazione, è identica, al netto di minime variazioni, per tutti i dispositivi supportati da DivestOS
Alla seguente pagina [https://www.divestos.org/index.php?page=devices&base=LineageOS&golden=false](https://www.divestos.org/index.php?page=devices&base=LineageOS&golden=false) scaricare la rom per il Fairphone 4, la `recovery` e il file `AVB Key`
!['Download'](./asset/fairphone/divest1.png)
e metterli nella stessa directory, per comodità.
```bash
mkdir ~/Scaricati/FP4
cd FP4/
wget -c https://www.divestos.org/mirror.php?base=LineageOS&f=fp4/divested-20.0-20221020-dos-FP4.zip
wget -c https://www.divestos.org/mirror.php?base=LineageOS&f=fp4/divested-20.0-20221020-dos-FP4-recovery.img
wget -c https://www.divestos.org/builds/LineageOS/fp4/avb_pkmd-fp4.bin
# Questa dovrebbe essere la situazione
ll
totale 1G
-rwxrwxrwx 1 piccihud piccihud 1,1K 4 nov 21.42 avb_pkmd-fp4.bin*
-rwxrwxrwx 1 piccihud piccihud 96M 4 nov 15.05 divested-20.0-20221020-dos-FP4-recovery.img*
-rwxrwxrwx 1 piccihud piccihud 875M 4 nov 15.04 divested-20.0-20221020-dos-FP4.zip*
```
Qui le istruzioni generiche per l'installazione:
[https://www.divestos.org/index.php?page=bootloader](https://www.divestos.org/index.php?page=bootloader)
Si ricorda che, per proseguire, è **obbligatorio** aver sbloccato il bootloader e riabilitato la modalità `Debug USB`.
1. Collegare il cellulare al PC e riavviare in modalità fastboot tramite il comando `adb reboot bootloader`
2. Se è disponibile a link precedente solamente il file `recovery.img `, come nel caso del Fairphone 4, e non il file `fastboot.zip`:
* flashare ('installare') la suddetta custom recovery: `fastboot flash recovery divested-version-date-dos-device-recovery.img`. Nel nostro caso: `fastboot flash recovery divested-20.0-20221020-dos-FP4-recovery.img` o versione successiva
3. Riavviare il telefono in `recovery mode` col comando `fastboot reboot recovery`, oppure usando i pulsanti 'Volume su' e 'Volume giù' per navigare tra le modalità e il tasto 'Power' per selezionare la modalità desiderata.
4. **Selezionare `Apply update` > `Apply from ADB`**, quindi lanciare da shell il comando `adb sideload divested-version-date-dos-device.zip` per flashare la custom rom. Nel esempio: `adb sideload divested-20.0-20221020-dos-FP4.zip` o versione successiva
5. Tornare ala schermata principale della Recovery e cliccare `factory reset`
6. Infine riavviare in modalità fastboot (tramite i pulsanti 'Volume su' e 'Volume giù' o il comandon `adb reboot bootloader`), quindi:
```bash
fastboot erase avb_custom_key
fastboot flash avb_custom_key avb_pkmd-fp4.bin
```
7. Riavviare in DivestOS
|Alcune immagini di DivestOS||
|:---:|:---:|
!['DivestOS'](./asset/fairphone/divest2.png)|!['DivestOS'](./asset/fairphone/divest3.png)|
!['DivestOS'](./asset/fairphone/divest4.png)|!['DivestOS'](./asset/fairphone/divest5.png)|
## Ribloccare il bootloader - opzionale
Per questioni di sicurezza, dopo aver provveduto ad installare una custom rom, sarebbe meglio ribloccare il bootloader.
Collegare il cellulare al Pc, abilitare il `Debug USB`, quindi:
```bash
adb reboot bootloader
fastboot flashing lock_critcal
# Riavviare, quindi ritornare nella modalità fastboot
adb reboot bootloader
fastboot flashing lock
```
Il tutto è descritto anche al seguente link:
[https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader](https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader)
## Collegamenti
* [https://it.wikipedia.org/wiki/Android_Debug_Bridge](https://it.wikipedia.org/wiki/Android_Debug_Bridge)
* [https://it.wikipedia.org/wiki/Boot_loader](https://it.wikipedia.org/wiki/Boot_loader)

313
Git.md Normal file
View File

@@ -0,0 +1,313 @@
# Git comandi principali
## Cos'è git?
Git è un software di *controllo versione distribuito* utilizzabile da interfaccia a riga di comando, creato da Linus Torvalds nel 2005. Git lavora con i repository, ognuno dei quali ha 4 stati di lavoro:
1. il primo stato è la *directory* corrente del progetto;
2. il secondo è l'*index* che fa da spazio di transito per i files (`git add *`);
3. il terzo è l'*head* che punta all'ultimo commit fatto (`git commit -m "messaggio"`);
4. l'ultimo è il *repository online* (`git push server`).
I repository online e locali possono essere divisi in ramificazioni o *branch*. I branch permettono di creare delle versioni alternative al codice presente nel ramo `master`, ovvero quello principale e stabile. Solitamente queste ramificazioni secondarie sono chiamate `dev`. Ciò permette la creazione di features o aggiornamenti in fase alpha che non vanno ad intaccare minimamente il codice del progetto. Finito la scrittura della ramificazione il branch dev verrà unito con il master.
Git permette anche di gestire i `tag`, le versioni del software in uso.
## Configurazioni di base di git
Configurare il git con le proprie credenziali:
```txt
git config --global user.name 'username'
git config --global user.email 'email@email.it'
```
### Creare un progetto
Ci son due modi per creare un progetto:
1. Inizializzare un progetto non esistente in locale:
```txt
git init
```
2. Inizializzare un progetto esistente su un server git (in remoto):
```txt
git clone serverURL.git
```
Esempio:
```txt
git clone https://gitea.it/PicciHud/Appunti.wiki.git
```
Git clone permette di copiare in locale il file .git del server e anche l'intero repository.
## Configurazione del server remoto
Con questo comando si visualizza la lista di server remoti salvati con il relativo url:
```txt
git remote -v
```
Di solito il server principale si chiama `origin`, ma è possibile specificare qualsiasi nome a gradimento.
### Aggiungere un un server remoto
```txt
git remote add identificatoreServerRemoto UrlServerRemoto
```
Esempio:
```txt
git remote add origin https://gitea.it/PicciHud/Appunti.wiki.git
```
## Lavorare nel progetto locale
### Aggiungere i file dalla directory del progetto all'index
```txt
git add nome_file
```
Si può utilizzare l'asterisco `*` per aggiungere tutti i file. Se si vuole escludere un file dalla selezione totale, basta creare un file denominato `.gitignore` e inserire all'interno i file o le directory che non devono essere aggiunte all'index.
```txt
git add *
```
### Aggiungere i file dell'index all'head
```txt
git commit -m "Messaggio del commit"
```
Annullamento dei commit:
```txt
git commit --amend
```
Il file ritorna allo stato precedente dellultimo commit:
```txt
git checkout -- nomeFile
```
## Lavorare con il server remoto
### Aggiornare il repository locale al commit più recente
```txt
git pull
```
### Upload dei commit
```txt
git push identificatoreServerRemoto nomeBranch
```
Esempio:
```txt
git push -u origin master
```
### Rinominare un file remoto
```txt
git remote rename identificatoreServerRemoto nomeFileVecchio nomeFileNuovo
```
### Eliminare un file remoto
```txt
git remote rm nomeFile
```
## Stato del progetto
Per vedere le modifiche del progetto:
```txt
git status
```
Per vedere i cambiamenti dei singoli files:
```txt
git diff
```
Vedere tutti i commit:
```txt
git log
```
## Gestire i tag
Per visualizzare tutte le versioni esiste il comando:
```txt
git tag
```
Per visualizzare tutte le versioni con un determinato numero:
```txt
git tag -l 1*
```
### Creazione di un tag
```txt
git tag -a versioneSoftware -m "nota sul tag"
```
Esempio:
```txt
git tag -a 1.2.3rc1 -m "aggiornato la navbar"
```
### Vedere tutte le modifiche di un tag
```txt
git show 1.2.3rc1
```
### Condividere i tag
```txt
git push identificatoreServerRemoto tagDaPubblicare
```
Esempio:
```txt
git push origin 1.2.3rc1
```
Condividere tutti i tag:
```txt
git push identificatoreServerRemoto --tag
```
Esempio:
```txt
git push origin --tag
```
## Gestire i Branch
Lista dei Rami:
```txt
git branch
```
### Creazione di un branch
```txt
git branch nomeBranch
```
Esempio:
```txt
git branch feature
```
Creare il ramo e passare a quel branch:
```txt
git checkout -b nomeBranch
```
Esempio:
```txt
git checkout -b feature
```
### Cambiare ramo
```txt
git checkout nomeBranch
```
Esempio:
```txt
git checkout feature
```
Per ritornare al branch originale digitare:
```txt
git checkout master
```
### Eliminare un ramo
```txt
git branch -d nomeBranch
```
Esempio:
```txt
git branch -d feature
```
### Unire il branch al master (fare un commit nel branch)
```txt
git checkout master
git merge feature
```
## Git Parameters
```txt
*** Inizializza l'area di lavoro ***
clone Clona un repository in una cartella
init Crea un git repository o ne inizializza uno
*** Lavorare nel progetto corrente ***
add Aggiungere i file nel INDEX
rm Rimuove i file dalla directory corrente e nel INDEX
*** Mostra la cronologia e lo stato ***
log Mostra i log
status stato del contenuto di un progetto
show Show various types of objects
*** Grow, mark and tweak your common history ***
branch Visualizza, crea e elimina ramo (branches)
checkout Cambia ramo (branches) o ripristina la struttura dell'area di lavoro
commit Registra le modifiche del repository
diff Confronta i commit
merge Unisce una o più cronologie di sviluppo
tag Crea, visualizza la lista, elimina o verifica il tag della versione del progetto
```
## Collegamenti
- http://rogerdudler.github.io/git-guide/index.it.html

138
Kde.md Normal file
View File

@@ -0,0 +1,138 @@
## Personalizzare KDE
Ecco alcuni temi molto interessanti compatibili in toto con KDE Plasma:
- [https://github.com/catppuccin/catppuccin](https://github.com/catppuccin/catppuccin)
- [https://draculatheme.com](https://draculatheme.com)
1. Clonare questo repository:
```bash
git clone https://github.com/catppuccin/KDE && cd KDE/kde-store-archives/global-theme
```
2. Installare il tema con questo comando:
```bash
kpackagetool5 -i catppuccin.tar.gz
```
![KDE](./asset/kde/kde.png 'KDE')
Un tema molto bello per le icone della barra di stato è **Materia Theme**, installabile con questo comando:
```bash
wget -qO- https://raw.githubusercontent.com/PapirusDevelopmentTeam/materia-kde/master/install.sh | sh
```
Qui maggiori informazioni:
[https://github.com/PapirusDevelopmentTeam/materia-kde](https://github.com/PapirusDevelopmentTeam/materia-kde)
![Status](./asset/kde/statusbar.png 'Barra di stato')
![Material](./asset/kde/material.png 'Material Theme')
Nelle impostazioni di KDE, impostare `#1f2430` come colore di sfondo delle finestre:
![1f2430](./asset/kde/1f2430.png '1f2430')
![Material](./asset/kde/material2.png 'Material Theme')
### Konsole
Per personalizzare la shell e il prompt dei comandi, si può utilizzare **Starship Shell**:
[https://github.com/starship/starship/blob/master/docs/it-IT/guide/README.md](https://github.com/starship/starship/blob/master/docs/it-IT/guide/README.md)
Questo è il link per la personalizzazione dello schema dei colori:
[https://github.com/catppuccin/konsole](https://github.com/catppuccin/konsole)
## Vim
[https://github.com/catppuccin/vim](https://github.com/catppuccin/vim)
Ecco delle impostazioni base per Vim:
```bash
davide@piccihud:~$ cat .vimrc
set number
colorscheme catppuccin_mocha
set spell spelllang=it
syntax enable
set termguicolors
```
Il tema viene installato in questo modo:
```bash
cd ~
git clone https://github.com/catppuccin/vim.git
mv colors/ .vim/
```
Inserire la seguente riga nel file `.vimrc`:
```vim
colorscheme catppuccin_mocha
```
## Firefox
Qui si trovano moltissimi temi CSS per Firefox:
[https://firefoxcss-store.github.io/](https://firefoxcss-store.github.io/)
Uno dei migliori:
[https://github.com/crambaud/waterfall](https://github.com/crambaud/waterfall)
![Firefox](./asset/kde/firefox.png 'Waterfall Theme')
### Dark Reader
[https://github.com/catppuccin/dark-reader](https://github.com/catppuccin/dark-reader)
> Mocha
```css
Background #1e1e2e
Text #cdd6f4
Selection #585b70
```
![Mocha](./asset/kde/reader.png 'Tema')
![Menù](./asset/kde/reader-menu.png 'Menù')
## Cambiare Display manager
[https://github.com/fairyglade/ly](https://github.com/fairyglade/ly)
Per prima cosa, bisogna installare le dipendenze:
```bash
sudo -i
apt install build-essential libpam0g-dev libxcb-xkb-dev
```
Quindi clonare il repository Git e seguire le istruzioni per l'installazione:
```bash
git clone --recurse-submodules https://github.com/fairyglade/ly
cd ly
make
make install installsystemd
systemctl enable ly.service
```
Maggiori informazioni alla pagina sopra elencata. Di seguito il risultato ottenuto:
![ly](./asset/kde/ly.png 'Display Manager')
Il file di configurazione si trova in `/etc/ly/config.ini`.

166
Markdown.md Normal file
View File

@@ -0,0 +1,166 @@
# Tutorial Markdown
## Headings
Gli headings si ottengono con il carattere `#`. Più cancelletti vengono inseriti, più piccolo sara l'heading.
```md
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
---
## Liste
Per le *liste ordinate*, si utilizzano i numeri, mentre per le *liste non ordinate* i simboli: `-` , `*` o `+`
```md
1. Primo elemento
2. Secondo elemento
3. Terzo elemento
- Elemento
- Elemento
- Elemento
```
## Elementi inline
Il *corsivo* si ottiene inserendo del testo tra un `*` o un `_`
```md
_testo in corsivo con underscore_
*testo in corsivo con asterisco*
```
Il **grassetto** si ottiene inserendo del testo tra due `**` o due `__`
```md
__testo in grassetto con due underscore__
**testo in grassetto con due asterischi**
```
## Le citazioni (Blockquote)
I blockquote o citazioni si ottengono con la parentesi angolare `>`
> Questa è una citazione. Rimango sulla stessa linea.
## Immagini
Le immagini vengono mostrate con la sintassi seguente:
```md
![Descrizione](https://gitea.it/avatars/7eeeb156c6a3d3e5e91b9d848d59165d?size=580 'piccihud')
```
![Descrizione](https://gitea.it/avatars/7eeeb156c6a3d3e5e91b9d848d59165d?size=580 'piccihud')
## Link
Ecco la sintassi per i link:
```md
[Collegamento a Wikipedia.it](https://wikipedia.it 'Vai su wikipedia')
```
[Collegamento a Wikipedia.it](https://wikipedia.it 'Vai su wikipedia')
## Tables
Nelle tabelle, le colonne sono separate dalla pipe `|`, mentre tra la riga d'intestazione e quelle sottostanti si inseriscono una fila `---` separati da pipe per ogni colonna:
```md
| Taglia | Colore |
| ------ | ------ |
| S | Giallo |
| M | Giallo |
| L | Giallo |
| XL | Blu |
```
| Taglia | Colore |
| ------ | ------ |
| S | Giallo |
| M | Giallo |
| L | Giallo |
| XL | Blu |
## Code snippets
Il codice può essere inserito inline o come blocco.
Per del codice inline basta inserire una o più parole tra backtick:
```md
La root dell'applicazione è nel file `App.js` nella cartella `src`
```
La root dell'applicazione è nel file `App.js` nella cartella `src`
Il codice in blocco può essere racchiuso tra tre backtick. È anche possibile specificare il linguaggio del blocco per una sintassi correttamente evidenziata:
```html
<div class="scrollmenu">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
<a href="#about">About</a>
...
</div>
```
## Editor MarkDown
Uno degli editor migliori per il Markdown è `VSCodium`. Questi i plugin necessari:
- [https://open-vsx.org/vscode/item?itemName=yzhang.markdown-all-in-one](https://open-vsx.org/vscode/item?itemName=yzhang.markdown-all-in-one)
- [https://open-vsx.org/vscode/item?itemName=yzane.markdown-pdf](https://open-vsx.org/vscode/item?itemName=yzane.markdown-pdf)
- [https://open-vsx.org/vscode/item?itemName=DavidAnson.vscode-markdownlint](https://open-vsx.org/vscode/item?itemName=DavidAnson.vscode-markdownlint)
- [https://open-vsx.org/vscode/item?itemName=marp-team.marp-vscode](https://open-vsx.org/vscode/item?itemName=marp-team.marp-vscode)
![MarkDown Plugin VSCodium](./asset/markdown/plugin.png 'Markdown')
Oppure si può utilizzare `Kate`, installando il seguente plugin per avere la preview del file:
[https://apps.kde.org/markdownpart/](https://apps.kde.org/markdownpart/)
```bash
sudo apt update ; sudo apt install -y markdownpart
```
![Preview](./asset/markdown/preview.png 'Preview')
## Collegamenti
- [https://it.m.wikibooks.org/wiki/Scrivere_in_modo_sostenibile_usando_il_testo_semplice_con_Pandoc_e_Markdown](https://it.m.wikibooks.org/wiki/Scrivere_in_modo_sostenibile_usando_il_testo_semplice_con_Pandoc_e_Markdown)
- [https://csrgxtu.github.io/2015/03/20/Writing-Mathematic-Fomulars-in-Markdown/](https://csrgxtu.github.io/2015/03/20/Writing-Mathematic-Fomulars-in-Markdown/)
- [https://gist.github.com/lukas-h/2a5d00690736b4c3a7ba](https://gist.github.com/lukas-h/2a5d00690736b4c3a7ba)
- [https://apps.kde.org/it/markdownpart/](https://apps.kde.org/it/markdownpart/)
- [https://www.markdownguide.org/basic-syntax/#images-1](https://www.markdownguide.org/basic-syntax/#images-1)

872
Neofetch.md Normal file
View File

@@ -0,0 +1,872 @@
# Neofetch
File di configurazione di Neofetch
![neofetch](./asset/neofetch/neofetch.png)
```bash
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
# info "Theme" theme
info "Icons" icons
# info "Terminal" term
# info "Terminal Font" term_font
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
info "GPU Driver" gpu_driver # Linux/macOS only
info "CPU Usage" cpu_usage
info "Disk" disk
info "Battery" battery
# info "Font" font
# info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
info "Local IP" local_ip
info "Public IP" public_ip
info "Users" users
# info "Locale" locale # This only works on glibc systems.
info cols
}
# Title
# Hide/Show Fully qualified domain name.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --title_fqdn
title_fqdn="off"
# Kernel
# Shorten the output of the kernel function.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --kernel_shorthand
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
#
# Example:
# on: '4.8.9-1-ARCH'
# off: 'Linux 4.8.9-1-ARCH'
kernel_shorthand="off"
# Distro
# Shorten the output of the distro function
#
# Default: 'off'
# Values: 'on', 'tiny', 'off'
# Flag: --distro_shorthand
# Supports: Everything except Windows and Haiku
distro_shorthand="off"
# Show/Hide OS Architecture.
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --os_arch
#
# Example:
# on: 'Arch Linux x86_64'
# off: 'Arch Linux'
os_arch="on"
# Uptime
# Shorten the output of the uptime function
#
# Default: 'on'
# Values: 'on', 'tiny', 'off'
# Flag: --uptime_shorthand
#
# Example:
# on: '2 days, 10 hours, 3 mins'
# tiny: '2d 10h 3m'
# off: '2 days, 10 hours, 3 minutes'
uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="on"
# Change memory output unit.
#
# Default: 'mib'
# Values: 'kib', 'mib', 'gib'
# Flag: --memory_unit
#
# Example:
# kib '1020928KiB / 7117824KiB'
# mib '1042MiB / 6951MiB'
# gib: ' 0.98GiB / 6.79GiB'
memory_unit="gib"
# Packages
# Show/Hide Package Manager names.
#
# Default: 'tiny'
# Values: 'on', 'tiny' 'off'
# Flag: --package_managers
#
# Example:
# on: '998 (pacman), 8 (flatpak), 4 (snap)'
# tiny: '908 (pacman, flatpak, snap)'
# off: '908'
package_managers="on"
# Shell
# Show the path to $SHELL
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --shell_path
#
# Example:
# on: '/bin/bash'
# off: 'bash'
shell_path="on"
# Show $SHELL version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --shell_version
#
# Example:
# on: 'bash 4.4.5'
# off: 'bash'
shell_version="on"
# CPU
# CPU speed type
#
# Default: 'bios_limit'
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
# Flag: --speed_type
# Supports: Linux with 'cpufreq'
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type="bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand="on"
# Enable/Disable CPU brand in output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_brand
#
# Example:
# on: 'Intel i7-6500U'
# off: 'i7-6500U (4)'
cpu_brand="on"
# CPU Speed
# Hide/Show CPU speed.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_speed
#
# Example:
# on: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'Intel i7-6500U (4)'
cpu_speed="on"
# CPU Cores
# Display CPU cores in output
#
# Default: 'logical'
# Values: 'logical', 'physical', 'off'
# Flag: --cpu_cores
# Support: 'physical' doesn't work on BSD.
#
# Example:
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
# off: 'Intel i7-6500U @ 3.1GHz'
cpu_cores="logical"
# CPU Temperature
# Hide/Show CPU temperature.
# Note the temperature is added to the regular CPU function.
#
# Default: 'off'
# Values: 'C', 'F', 'off'
# Flag: --cpu_temp
# Supports: Linux, BSD
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
# coretemp kernel module. This only supports newer Intel processors.
#
# Example:
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
cpu_temp="C"
# GPU
# Enable/Disable GPU Brand
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gpu_brand
#
# Example:
# on: 'AMD HD 7950'
# off: 'HD 7950'
gpu_brand="on"
# Which GPU to display
#
# Default: 'all'
# Values: 'all', 'dedicated', 'integrated'
# Flag: --gpu_type
# Supports: Linux
#
# Example:
# all:
# GPU1: AMD HD 7950
# GPU2: Intel Integrated Graphics
#
# dedicated:
# GPU1: AMD HD 7950
#
# integrated:
# GPU1: Intel Integrated Graphics
gpu_type="all"
# Resolution
# Display refresh rate next to each monitor
# Default: 'off'
# Values: 'on', 'off'
# Flag: --refresh_rate
# Supports: Doesn't work on Windows.
#
# Example:
# on: '1920x1080 @ 60Hz'
# off: '1920x1080'
refresh_rate="on"
# Gtk Theme / Icons / Font
# Shorten output of GTK Theme / Icons / Font
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --gtk_shorthand
#
# Example:
# on: 'Numix, Adwaita'
# off: 'Numix [GTK2], Adwaita [GTK3]'
gtk_shorthand="on"
# Enable/Disable gtk2 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk2
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Adwaita [GTK3]'
gtk2="off"
# Enable/Disable gtk3 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk3
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Numix [GTK2]'
gtk3="off"
# IP Address
# Website to ping for the public IP
#
# Default: 'http://ident.me'
# Values: 'url'
# Flag: --ip_host
public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Desktop Environment
# Show Desktop Environment version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --de_version
de_version="on"
# Disk
# Which disks to display.
# The values can be any /dev/sdXX, mount point or directory.
# NOTE: By default we only show the disk info for '/'.
#
# Default: '/'
# Values: '/', '/dev/sdXX', '/path/to/drive'.
# Flag: --disk_show
#
# Example:
# disk_show=('/' '/dev/sdb1'):
# 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
#
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name', 'dir', 'none'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
#
# none: 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
disk_subtitle="mount"
# Disk percent.
# Show/Hide disk percent.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --disk_percent
#
# Example:
# on: 'Disk (/): 74G / 118G (66%)'
# off: 'Disk (/): 74G / 118G'
disk_percent="on"
# Song
# Manually specify a music player.
#
# Default: 'auto'
# Values: 'auto', 'player-name'
# Flag: --music_player
#
# Available values for 'player-name':
#
# amarok
# audacious
# banshee
# bluemindo
# clementine
# cmus
# deadbeef
# deepin-music
# dragon
# elisa
# exaile
# gnome-music
# gmusicbrowser
# gogglesmm
# guayadeque
# io.elementary.music
# iTunes
# juk
# lollypop
# mocp
# mopidy
# mpd
# muine
# netease-cloud-music
# olivia
# playerctl
# pogo
# pragha
# qmmp
# quodlibet
# rhythmbox
# sayonara
# smplayer
# spotify
# strawberry
# tauonmb
# tomahawk
# vlc
# xmms2d
# xnoise
# yarock
music_player="auto"
# Format to display song information.
#
# Default: '%artist% - %album% - %title%'
# Values: '%artist%', '%album%', '%title%'
# Flag: --song_format
#
# Example:
# default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %album% - %title%"
# Print the Artist, Album and Title on separate lines
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --song_shorthand
#
# Example:
# on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger'
#
# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off"
# 'mpc' arguments (specify a host, password etc).
#
# Default: ''
# Example: mpc_args=(-h HOST -P PASSWORD)
mpc_args=()
# Text Colors
# Text Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --colors
#
# Each number represents a different part of the text in
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
#
# Example:
# colors=(distro) - Text is colored based on Distro colors.
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
colors=(distro)
# Text Options
# Toggle bold text
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bold
bold="on"
# Enable/Disable Underline
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --underline
underline_enabled="on"
# Underline character
#
# Default: '-'
# Values: 'string'
# Flag: --underline_char
underline_char="-"
# Info Separator
# Replace the default separator with the specified string.
#
# Default: ':'
# Flag: --separator
#
# Example:
# separator="->": 'Shell-> bash'
# separator=" =": 'WM = dwm'
separator=":"
# Color Blocks
# Color block range
# The range of colors to print.
#
# Default: '0', '15'
# Values: 'num'
# Flag: --block_range
#
# Example:
#
# Display colors 0-7 in the blocks. (8 colors)
# neofetch --block_range 0 7
#
# Display colors 0-15 in the blocks. (16 colors)
# neofetch --block_range 0 15
block_range=(0 15)
# Toggle color blocks
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --color_blocks
color_blocks="on"
# Color block width in spaces
#
# Default: '3'
# Values: 'num'
# Flag: --block_width
block_width=3
# Color block height in lines
#
# Default: '1'
# Values: 'num'
# Flag: --block_height
block_height=1
# Color Alignment
#
# Default: 'auto'
# Values: 'auto', 'num'
# Flag: --col_offset
#
# Number specifies how far from the left side of the terminal (in spaces) to
# begin printing the columns, in case you want to e.g. center them under your
# text.
# Example:
# col_offset="auto" - Default behavior of neofetch
# col_offset=7 - Leave 7 spaces then print the colors
col_offset="auto"
# Progress Bars
# Bar characters
#
# Default: '-', '='
# Values: 'string', 'string'
# Flag: --bar_char
#
# Example:
# neofetch --bar_char 'elapsed' 'total'
# neofetch --bar_char '-' '='
bar_char_elapsed="-"
bar_char_total="="
# Toggle Bar border
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bar_border
bar_border="on"
# Progress bar length in spaces
# Number of chars long to make the progress bars.
#
# Default: '15'
# Values: 'num'
# Flag: --bar_length
bar_length=15
# Progress bar colors
# When set to distro, uses your distro's logo colors.
#
# Default: 'distro', 'distro'
# Values: 'distro', 'num'
# Flag: --bar_colors
#
# Example:
# neofetch --bar_colors 3 4
# neofetch --bar_colors distro 5
bar_color_elapsed="distro"
bar_color_total="distro"
# Info display
# Display a bar with the info.
#
# Default: 'off'
# Values: 'bar', 'infobar', 'barinfo', 'off'
# Flags: --cpu_display
# --memory_display
# --battery_display
# --disk_display
#
# Example:
# bar: '[---=======]'
# infobar: 'info [---=======]'
# barinfo: '[---=======] info'
# off: 'info'
cpu_display="off"
memory_display="off"
battery_display="off"
disk_display="off"
# Backend Settings
# Image backend.
#
# Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend
image_backend="ascii"
# Image Source
#
# Which image or ascii file to display.
#
# Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source
#
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
# In ascii mode, distro ascii art will be used and in an image mode, your
# wallpaper will be used.
image_source="auto"
# Ascii Options
# Ascii distro
# Which distro's ascii art to display.
#
# Default: 'auto'
# Values: 'auto', 'distro_name'
# Flag: --ascii_distro
# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS",
# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs,
# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock,
# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD,
# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS,
# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover,
# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin,
# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary,
# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD,
# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo,
# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra,
# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion,
# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite,
# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva,
# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib,
# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner,
# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba,
# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD,
# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint,
# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix,
# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan,
# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific,
# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz,
# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS,
# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails,
# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio,
# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin,
# and IRIX have ascii logos
# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants.
# Use '{distro name}_old' to use the old logos.
# NOTE: Ubuntu has flavor variants.
# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME,
# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors.
# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu,
# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android,
# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola,
# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS,
# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian,
# postmarketOS, and Void have a smaller logo variant.
# Use '{distro name}_small' to use the small variants.
ascii_distro="tux"
# Ascii Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --ascii_colors
#
# Example:
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
ascii_colors=(distro)
# Bold ascii logo
# Whether or not to bold the ascii logo.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --ascii_bold
ascii_bold="on"
# Image Options
# Image loop
# Setting this to on will make neofetch redraw the image constantly until
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --loop
image_loop="off"
# Thumbnail directory
#
# Default: '~/.cache/thumbnails/neofetch'
# Values: 'dir'
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
# Crop mode
#
# Default: 'normal'
# Values: 'normal', 'fit', 'fill'
# Flag: --crop_mode
#
# See this wiki page to learn about the fit and fill options.
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
crop_mode="normal"
# Crop offset
# Note: Only affects 'normal' crop mode.
#
# Default: 'center'
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
# 'east', 'southwest', 'south', 'southeast'
# Flag: --crop_offset
crop_offset="center"
# Image size
# The image is half the terminal width by default.
#
# Default: 'auto'
# Values: 'auto', '00px', '00%', 'none'
# Flags: --image_size
# --size
image_size="auto"
# Gap between image and text
#
# Default: '3'
# Values: 'num', '-num'
# Flag: --gap
gap=3
# Image offsets
# Only works with the w3m backend.
#
# Default: '0'
# Values: 'px'
# Flags: --xoffset
# --yoffset
yoffset=0
xoffset=0
# Image background color
# Only works with the w3m backend.
#
# Default: ''
# Values: 'color', 'blue'
# Flag: --bg_color
background_color=
# Misc Options
# Stdout mode
# Turn off all colors and disables image backend (ASCII/Image).
# Useful for piping into another command.
# Default: 'off'
# Values: 'on', 'off'
stdout="off"
```

75
NextCloud.md Normal file
View File

@@ -0,0 +1,75 @@
# Sincronizzare con NextCloud
<!-- Nascondere i bordi della tabella -->
<style>
table, td, th, tr {
border: 0px !important;
margin: auto;
}
/*Ridurre dimensione delle immagini*/
img {
height: auto;
width: 80%;
}
</style>
`Nextcloud` è una suite libera di software client-server per file hosting, cloud storage, memorizzazione e sincronizzazione online.
Su Nextcloud i file sono archiviati in directory convenzionali, accessibili tramite `WebDAV`. *Web-based Distributed Authoring and Versioning*, abbreviato in WebDAV (in italiano traducibile come "*creazione e versionamento distribuiti di documenti sul web*"), è un protocollo di rete che consente di rendere disponibili e trasferire file tramite Internet. Si tratta di unestensione dell*Hypertext Transfer Protocol* (HTTP), responsabile unicamente della visualizzazione delle pagine web.
Per farla breve, NextCloud funziona proprio come un normale servizio di file hosting completamente installabile in autonomia su un proprio server. Ma Nextcloud va ben oltre il semplice hosting di file, essendo infatti una suite completa di tutto. Permette di sincronizzare i contatti, il calendario, le attività, di scrivere documenti, presentazioni e figli di calcolo online, condividere file di qualsiasi genere, di gestire gruppi di utenti coi relativi permessi...
## Accedere a NextCloud su Android
Nextcloud è un servizio nato per il *self-hosting*, però ci sono anche tantissime realtà che offrono il servizio già configurato e pronto per l'uso gratuitamente o a pagamento, a seconda dello spazio a disposizione. Eccone alcune molto valide:
- [webo.hosting](https://cloud.webo.hosting/)
- [Hetzner](https://www.hetzner.com/storage/storage-share)
- [Murena](https://murena.com/ecloud-subscriptions/): gratuitamente offrono 1GB di spazio
Dopo essersi iscritti a uno di questi servizi, scaricare le seguenti app per Android:
- [NextCloud](https://f-droid.org/en/packages/com.nextcloud.client/)
- [DavX5](https://f-droid.org/en/packages/at.bitfire.davdroid/): permette di sincronizzare contatti, eventi del calendario e attività
Avviare quindi l'applicazione di NextCloud ed accedere con l'indirizzo del proprio server. Nell'esempio sottostante è utilizzato [https://murena.io/](https://murena.io/):
|||
|:---:|:---:|
|![nextcloud2.png](./nextcloud/nextcloud2.png)|![nextcloud3.png](./nextcloud/nextcloud3.png)|
È stata abilitata l'autenticazione a due fattori, quindi inserire il codice OTP ed accedere al proprio account:
|||
|:---:|:---:|
|![nextcloud4.png](./nextcloud/nextcloud4.png)|![nextcloud5.png](./nextcloud/nextcloud5.png)|![nextcloud6.png](./nextcloud/nextcloud6.png)|
Una volta fatto ciò, si avrà accesso alla propria cartella radice su NextCloud.
## Sincronizzare i contatti
Una volta installata l'app [DavX5](https://f-droid.org/en/packages/at.bitfire.davdroid/), entrare nelle impostazioni dell'app di NextCloud e cliccare la voce `Sincronizza calendario e contatti`. Verrà quindi chiesto di accedere al proprio account sul server e di inserire, eventualmente, il codice OTP:
|||
|:---:|:---:|
|![dav1.png](./nextcloud/dav1.png)|![dav2.png](./nextcloud/dav2.png)|
|![dav3.png](./nextcloud/dav3.png)|![dav4.png](./nextcloud/dav4.png)|
Dopo aver effettuato l'accesso, abilitare la sincronizzazione dei contatti e del calendario in `DavX5` e nell'app del calendario:
|||
|:---:|:---:|
|![dav5.png](./nextcloud/dav5.png)|![dav6.png](./nextcloud/dav6.png)|
|![dav7.png](./nextcloud/dav7.png)|![dav8.png](./nextcloud/dav8.png)|
Ottima applicazione per il calendario è [Simple Calendar Pro](https://f-droid.org/packages/com.simplemobiletools.calendar.pro/)
## Collegamenti
- [https://it.wikipedia.org/wiki/Nextcloud](https://it.wikipedia.org/wiki/Nextcloud)
- [https://it.wikipedia.org/wiki/Web-based_Distributed_Authoring_and_Versioning](https://it.wikipedia.org/wiki/Web-based_Distributed_Authoring_and_Versioning)
- [https://www.lealternative.net/2020/06/04/nextcloud-lalternativa-a-google-drive/](https://www.lealternative.net/2020/06/04/nextcloud-lalternativa-a-google-drive/)
- [https://www.ionos.it/digitalguide/server/know-how/webdav/](https://www.ionos.it/digitalguide/server/know-how/webdav/)

91
Pull-Request.md Normal file
View File

@@ -0,0 +1,91 @@
# Git: la Pull Request
La *Pull Request* è una richiesta, fatta allautore originale di un sofware o di un documento, di includere le modifiche al suo progetto.
Dopo aver trovato un progetto, si deve cliccare sul tasto `Fork`, in alto a destra:
![Fork](./pull-request/fork1.png 'Fork di un progetto')
## Forkare un progetto
Il tasto `fork` creerà una copia del progetto sul nostro profilo personale di GitHub, Gitea o simili. Di questa copia non potrà essere toccato il ramo `master`, perchè appartiene agli sviluppatori originari del progetto, tuttavia è possibile creare un ramo secondario, ove apportare le dovute modifiche.
Nell'esempio, viene forkato il seguente progetto:
[https://github.com/wsdfhjxc/virtual-desktop-bar](https://github.com/wsdfhjxc/virtual-desktop-bar)
## Clonare il progetto
Ora basterà copiare il collegamento `ssh` al nostro progetto e clonarlo in locale, tramite i seguenti comandi:
```bash
git clone git@github.com:PicciHud/virtual-desktop-bar.git
```
![Clone](./pull-request/clone.png 'Clonare un progetto')
Per la creazione delle chiavi `SSH`, seguire la precedente guida: [SSH](https://gitea.it/PicciHud/Appunti/wiki/SSH 'Creazione chiavi SSH')
## Creare un nuovo branch
Per apportare delle modifiche, occorre creare un ramo secondario, di sviluppo:
```bash
git branch dev
```
dove `dev` indica il nome del ramo.
È quindi possibile spostarsi nel nuovo ramo tramite il comando:
```bash
git checkout dev
```
## Apportare modifiche
Adesso è possibile apportare qualsiasi modifica al progetto, creando nuovi files, cartelle, o qualsiasi cosa si ritenga opportuna.
Nell'esempio, abbiamo modificato il file `install-applet.sh`, correggendo il `$PATH` del file `build-applet.sh`, oltre ad aver creato l'installer per Debian
![Modifiche](./pull-request/mod.png 'Modifiche')
In pratica è stato risolto questo bug:
![Issue](./pull-request/bug.png 'Issue')
Una volta terminato, aggiungere le modifiche alla *staging area*:
```bash
git add .
```
quindi il comando
```bash
git commit -a -m nome modifiche
```
salva la nuova versione del documento.
Infine il comando
```bash
git push set-upstream -origin dev
```
invia il nuovo ramo di sviluppo al nostro repository su GitHub o simili.
Si tratta di un comando abbastanza complicato da ricordare a memoria. Git però viene in aiuto, basterà quindi semplicemente ricordare il comando classico `git push` per ricevere da git un messaggio di errore che contiene lindicazione sulla sintassi esatta del comando da usare.
## Pull request
Su GitHub cliccare sul pulsante *Compare & Pull request* per avviare agli sviluppatori originari del progetto una richiesta di integrazione del nostro ramo con le nostre integrazioni e modifiche. Descriviamo i cambiamenti che abbiamo fatto e inviamo la Pull Request.
![Pull Request](./pull-request/pullrequest1.png 'Pull Request')
Per approfondire i comandi di Git, si veda la seguente guida: [Git](https://gitea.it/PicciHud/Appunti/wiki/Git 'Comandi Git')
## Collegamenti
- [https://marcolombardo.com/blog/open/source/2019/03/13/iniziare-con-git-e-github-la-pull-request.html](https://marcolombardo.com/blog/open/source/2019/03/13/iniziare-con-git-e-github-la-pull-request.html)

39
README.md Normal file
View File

@@ -0,0 +1,39 @@
## Welcome to my Wiki
![Piccihud](https://gitea.it/avatars/7eeeb156c6a3d3e5e91b9d848d59165d?size=580)
> "Spezzate, spezzate, ve ne prego, le antiche tavole, uomini della consocenza!"
Così parlò Zarathustra, Nietzsche
> “Non è da uomo saggio dire «Vivrò». Vivere domani è già troppo tardi: vivi oggi"
> "Potersi sentire soddisfatto della propria vita significa vivere due volte"
Marziale
```
\ SORRY /
\ /
\ This page does /
] not exist yet. [ ,'|
] [ / |
]___ ___[ ,' |
] ]\ /[ [ |: |
] ] \ / [ [ |: |
] ] ] [ [ [ |: |
] ] ]__ __[ [ [ |: |
] ] ] ]\ _ /[ [ [ [ |: |
] ] ] ] (#) [ [ [ [ :===='
] ] ]_].nHn.[_[ [ [
] ] ] HHHHH. [ [ [
] ] / `HH("N \ [ [
]__]/ HHH " \[__[
] NNN [
] N/" [
] N H [
/ N \
/ q, \
/ \
```

218
Rofi.md Normal file
View File

@@ -0,0 +1,218 @@
# Rofi
Rofi non è solo un lanciatore di applicazioni, ma permette di fare molte più cose, tra cui:
- aprire file;
- eseguire comandi bash;
- navigare tra le finestre aperte;
- ...
## Modalità
Rofi ha diverse modalità integrate che implementano casi d'uso comuni e possono essere estese da vari script o plugin.
Di seguito è riportato un elenco delle diverse modalità:
- **run**: permette di lanciare eseguibili nel terminale, a partire dal loro `$PATH`;
- **drun**: avvia le applicazioni installate nel sistema;
- **window**: permette di passare tra le varie finestre aperte;
- **ssh**: avvia il collegamento a un host remoto via ssh;
- **combi**: combina più modalità.
## Installazione su Debian e derivate
```bash
sudo apt update && sudo apt install -y rofi
```
## Configurazione
Per generare il file di configurazione predefinito:
```bash
mkdir -p ~/.config/rofi
rofi -dump-config > ~/.config/rofi/config.rasi
```
Questo comando crea un file chiamato `config.rasi` nel seguente percorso: `~/.config/rofi/`. È possibile modificare questo file per personalizzare rofi, anche graficamente con dei temi personalizzati.
Eccone un esempio: [config.rasi](./rofi/config.rasi)
### Abilitare le varie modalità
È sufficiente specificare un elenco ordinato e separato da virgole delle modalità da abilitare. Ecco un esempio, con abilitate solo le modalità `run` e `ssh`:
```bash
rofi -modes "run,ssh" -show run
```
Per ottenere una visione combinata di due o più modalità:
```bash
rofi -show combi -combi-modes "window,run,ssh" -modes combi
```
## Temi personalizzati
Qui si trovano moltissimi temi:
[https://github.com/adi1090x/rofi](https://github.com/adi1090x/rofi)
Dopo aver installato `rofi`, clonare il precedente repository:
```bash
git clone --depth=1 https://github.com/adi1090x/rofi.git
cd rofi
chmod 755 setup.sh
./setup.sh
```
Quindi, per scegliere lo stile, modificare il file `~/.config/rofi/launchers/type-X/launcher.sh`, dove `X` è un numero da 1 a 7, inserendo lo stile prescelto.
Nell'esempio:
```bash
theme='style-10'
```
Ecco il file in questione:
```
davide@piccihud:~$ cat ~/.config/rofi/launchers/type-4/launcher.sh
#!/usr/bin/env bash
## Author : Aditya Shakya (adi1090x)
## Github : @adi1090x
#
## Rofi : Launcher (Modi Drun, Run, File Browser, Window)
#
## Available Styles
#
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
dir="$HOME/.config/rofi/launchers/type-4"
theme='style-10'
## Run
rofi \
-show drun \
-theme ${dir}/${theme}.rasi
```
Come prima, per cambiare i colori predefiniti del tema, modificare il seguente file:
```bash
davide@piccihud:~$ cat ~/.config/rofi/launchers/type-4/shared/colors.rasi
/**
*
* Author : Aditya Shakya (adi1090x)
* Github : @adi1090x
*
* Colors
*
* Available Colors Schemes
*
* adapta catppuccin everforest navy paper
* arc cyberpunk gruvbox nord solarized
* black dracula lovelace onedark yousai
*
**/
/* Import color-scheme from `colors` directory */
@import "~/.config/rofi/colors/dracula.rasi" #Inserire il colore prescelto
```
Questo è tutto. Ora basta inserire nel file `config.rasi` la seguente riga, una volta scelto lo stile del tema:
```bash
davide@piccihud:~$ cat .config/rofi/config.rasi
@theme "~/.config/rofi/launchers/type-4/style-10.rasi"
```
![Rofi](./rofi/rofi.png 'Rofi')
### Alcune aggiunte al tema
`~/.config/rofi/launchers/type-4/style-10.rasi`
```bash
10 /*****----- Configuration -----*****/
11 configuration {
12 modi: "drun,window,run"; /*aggiunte alcune modalità, come quella per mostrare le finestre attive o per eseguire comandi da terminale*/
13 show-icons: true; /*le icone sono visibili*/
14 display-drun: " Apps";
15 display-run: "";
16 display-filebrowser: "";
17 display-window: "";
18 /* drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]"; */
19 drun-display-format: "{name}"; /*solo il nome dell'applicazione diventa visibile, senza descrizione, come sopra*/
20 window-format: "{w} · {c} · {t}";
21 }
[..]
53 /*****----- Main Window -----*****/
54 window {
55 /* properties for window widget */
56 transparency: "real";
57 location: south; /*rofi è posizionato in basso*/
58 anchor: south;
59 fullscreen: false;
60 width: 100%;
61 x-offset: 0px;
62 y-offset: 0px;
```
Quindi modificare il file `.config/rodi/config.rasi`:
```bash
1 configuration {
3 terminal: "konsole";
4 run-command: "{cmd}";
5 run-list-command: "";
6 run-shell-command: "{terminal} -e {cmd}"; /*Questa è la sintassi del comando*/
7 kb-select-1: "Super+1";
8 kb-select-2: "Super+2";
9 kb-select-3: "Super+3";
10 kb-select-4: "Super+4";
11 kb-select-5: "Super+5";
12 kb-select-6: "Super+6";
13 kb-select-7: "Super+7";
14 kb-select-8: "Super+8";
15 kb-select-9: "Super+9";
16 kb-select-10: "Super+0";
17 }
18 @theme "~/.config/rofi/launchers/type-4/style-10.rasi"
```
In questo modo, è possibile lanciare comandi bash direttamente da rofi, tramite la seguente sintassi:
```bash
terminal_name command
konsole ncdu
```
oppure passare tra le finestre attive, infine selezionare i risultati con delle scorciatoie (`Alt+X`), dove `X` indica un numero maggiore o uguale a 1, corrispondente al risultato dell'applicazione che si desidera avviare.
Il risultato finale:
![Rofi](./rofi/final.png 'Rofi')
### Gestire le connessioni di rete
Rofi può essere esteso tramite plugin. Eccone uno per poter controllare la connessione ad intenet:
```bash
git clone https://github.com/ericmurphyxyz/rofi-wifi-menu.git
cd rofi-wifi-menu
mv rofi-wifi-menu.sh ~/bin
```
È possibile richiamare lo script dopo aver assegnato una scorciatoria da tastiera: `$HOME/bin/rofi-wifi-menu.sh`
![WiFi](./rofi/wifi.png)
## Collegamenti
- [https://github.com/davatorium/rofi](https://github.com/davatorium/rofi)
- [https://github.com/adi1090x/rofi](https://github.com/adi1090x/rofi)
- [https://github.com/adi1090x/rofi/blob/master/files/config.rasi](https://github.com/adi1090x/rofi/blob/master/files/config.rasi)

138
Rsync.md Normal file
View File

@@ -0,0 +1,138 @@
## Rsync
`Rsync` può essere utilizzato per il mirroring dei dati (in locale o remoto), i backup incrementali, la copia di file tra i sistemi e come un sostituto per i comandi scp, sftpe cp.
## Installare Rsync
`Rsync` è preinstallato nelle maggiori distribuzioni GNU/Linux, ma si può sempre verificare che sia presente nel sistema col seguente comando:
```bash
rsync --version
```
Se non fosse installato, si può installare facilmente usando il gestore pacchetti della distribuzione.
Per esempio su Debian e derivati:
```bash
sudo apt install rsync
```
## Sintassi
Local to Local: `rsync [OPTION]... [SRC]... DEST`
Local to Remote: `rsync [OPTION]... [SRC]... HOST:DEST`
Remote to Local: `rsync [OPTION]... HOST:SRC... [DEST]`
dove:
`SRC` - Directory sorgente o di origine;
`DEST` - Directory di destinazione;
`HOST` - Hostname remoto o indirizzo IP.
`Rsync` fornisce una serie di opzioni che controllano ogni aspetto del suo comportamento. Le opzioni più utilizzate sono:
-`n`, avvia come simulazione, ovvero mostra solo quello che farebbe senza modificare realmente alcunché. Quest'opzione è FONDAMENTALE, in quanto permette di identificare eventuali comportamenti e/o risultati anomali e quindi di correggere il comando. Si ricordi che un errore nella definizione del comando può comportare la perdita dei dati nella cartella di destinazione o anche in quella sorgente se per esempio si invertono accidentalmente le due. Chiaramente una volta verificato il risultato della sincronizzazione quest'opzione andrà eliminata in modo da far effettivamente sincronizzare le directory;
-`r`, sincronizza anche le sottodirectory e tutti i relativi file;
-`t`, aggiorna anche la data di "Ultima modifica" dei file copiati nella cartella di destinazione;
-`p`, imposta per i file nella cartella di destinazione lo stesso `schema di permessi` di quelli sorgenti;
-`o`, imposta per i file nella cartella di destinazione lo stesso `proprietario` di quelli sorgenti, ove possibile;
-`g`, imposta per i file nella cartella di destinazione lo stesso `gruppo` di quelli sorgenti, ove possibile;
-`a`, (modalità archivio) è equivalente a impostare tutte le opzioni precedenti (`-rtpog`), e inoltre mantiene link simbolici, file speciali e (solo se eseguito come root) file dispositivo. Si possono invece trasformare tutti i link simbolici nei file a cui puntano con l'opzione i `-L`;
-`v`, aumenta il numero di informazioni stampate a video (verbose);
`-P` o `--progress`, mostra un indicatore percentuale del progresso delle operazioni. Implica l'opzione -v, pertanto se si specifica --progress è ridondante specificare anche -v;
`--delete`, elimina nella directory di destinazione tutti i file che non sono presenti nella directory sorgente;
`--exclude-from`, specifica il percorso di un file contenente un elenco di file e cartelle da non includere nelle operazioni di sincronizzazione. Maggiori informazioni nell'apposita sezione.
-`z`, --compress. Questa opzione forzerà `Rsync` a comprimere i dati;
## Utilizzo di base di Rsync
Per copiare un singolo file `localmente` è necessario eseguire il comando seguente:
```bash
rsync -az /opt/filename.zip /tmp/newfilename.zip
```
Se la directory di destinazione non esiste verrà creata.
Vale la pena ricordare che, aggiungendo `/` alla directory di origine, verrà copiato solo il contenuto della directory nella directory di destinazione. Se omessa, `Rsync` copierà la directory di origine all'interno della directory di destinazione.
## Utilizzare Rsync per sincronizzare i dati da e verso una macchina remota
Quando si utilizza `Rsync` per il trasferimento remoto, deve essere installato sia sul computer di origine che su quello di destinazione. Le nuove versioni di `Rsync` sono configurate per utilizzare SSH come shell remota predefinita.
Nel seguente esempio, vine trasferita una directory da un computer locale a un computer remoto:
```bash
rsync -a /opt/media/ host_or_ip:/opt/media/
```
Se non è impostato un accesso SSH senza password al computer remoto, verrà chiesto di inserire la password dell'utente.
Se si desidera trasferire i dati da un server remoto a un computer locale, è *necessario utilizzare la posizione remota* come sorgente:
Se SSH sull'host remoto è in ascolto su una porta diversa dalla 22, è possibile specificare la porta utilizzando l'opzione `-e`:
```bash
rsync -a -e "ssh -p 2322" /opt/media/ host_or_ip:/opt/media/
```
Quando si trasferiscono grandi quantità di dati, si consiglia di eseguire il comando `Rsync` all'interno di `screen` o di utilizzare l'opzione `-P`.
## Escludere file e directory
Esistono due opzioni per escludere file e directory. La prima opzione è utilizzare l'argomento `--exclude` e specificare i file e le directory.
Nel seguente esempio, vengono escluse le directory `node_modules` e `tmp` che si trovano all'interno di `src_directory`:
```bash
rsync -a --exclude=node_modules --exclude=tmp /src_directory/ /dst_directory/
```
La seconda opzione è usare l'argomento `--exclude-from` e specificare i file e le directory che si desidera escludere in un file.
```bash
nano exclude-file.txt
node_modules
tmp
```
Quindi:
```bash
rsync -a --exclude-from='/exclude-file.txt' /src_directory/ /dst_directory/
```
## Backup locale
Ecco un esempio di come utilizzare `Rsync` per un backup locale:
```bash
rsync -aPz --delete --exclude-from='~/exlude.txt' ~/.config ~/bk_config
```
## Collegamenti
- [https://guide.debianizzati.org/index.php/Rsync](https://guide.debianizzati.org/index.php/Rsync)
- [https://wiki.ubuntu-it.org/AmministrazioneSistema/BackupDelSistema/Rsync](https://wiki.ubuntu-it.org/AmministrazioneSistema/BackupDelSistema/Rsync)
- [https://noviello.it/come-usare-Rsync-per-trasferire-file-locali-e-remoti-su-linux/](https://noviello.it/come-usare-`Rsync`-per-trasferire-file-locali-e-remoti-su-linux/)
- [https://wiki.ubuntu-it.org/AmministrazioneSistema/BackupDelSistema/Rsync](https://wiki.ubuntu-it.org/AmministrazioneSistema/BackupDelSistema/Rsync)

153
SSH.md Normal file
View File

@@ -0,0 +1,153 @@
# Creazione e gestione chiavi SSH
**SSH** è un protocollo client / server utilizzato per i login remoti. Utilizzando la crittografia per l'autenticazione, SSH fornisce un metodo
crittografato per accedere al server o ad un'altra macchina.
## Installazione SSH
```bash
sudo apt install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh #Abilita SSH all'accensione della macchina
```
## Creazione chiave SSH
Il protocollo SSH utilizza una tecnica di crittografia chiamata crittografia asimmetrica. Fondamentalmente, la crittografia asimmetrica è un sistema che usa una coppia di chiavi, cioè la *chiave pubblica* e quella *privata*.
La chiave pubblica può essere condivisa con chiunque, avendo come scopo principale quello di criptare i dati, convertendo il messaggio in un codice segreto. Questa chiave viene solitamente inviata ad altri sistemi, per esempio i server, per criptare i dati prima di inviarli su Internet.
Daltra parte, la chiave privata è quella che deve rimanere segreta e viene usata per decifrare i dati crittografati con la chiave pubblica. Senza di essa, è impossibile decodificare le informazioni criptate.
Questo metodo permette al client e al server di mantenere un canale di comunicazione sicuro.
Ecco cosa succede in background quando si avvia una connessione SSH ad un server:
- Il client invia la chiave pubblica al server;
- Il server chiede al client di firmare un messaggio casuale criptato con la chiave pubblica usando la chiave privata;
- Il client firma il messaggio e inoltra il risultato al server;
- Viene stabilita una connessione sicura tra il client e il server.
La coppia di chiavi viene creata sulla propria macchina (client) in questo modo:
```bash
→ ssh-keygen -t ed25519 -C "<commento>"
```
- dove `ed25519` indica lalgoritmo utilizzato per creare la firma digitale della coppia di chiavi. Se il sistema lo supporta, ed25519 è il miglior algoritmo per creare coppie di chiavi SSH;
- il flag `-C` è utilizzato per fornire un *commento* personalizzato alla fine della chiave pubblica, che di solito è lemail o lidentificazione del creatore della coppia di chiavi.
Ecco un esempio:
```bash
piccihud@WORKSTATION03:~
→ ssh-keygen -t ed25519 -C "piccihud"
Generating public/private ed25519 key pair.
Enter file in which to save the key (~/.ssh/id_ed25519): ~/.ssh/<file_name>
```
- <file_name> indica il nome del file in cui sarà salvata la chiave.
Poi verrà chiesta una *passphrase* da aggiungere alla coppia di chiavi. Questo aggiunge un ulteriore livello di sicurezza se, in qualsiasi momento, il vostro dispositivo viene compromesso. Non è obbligatorio aggiungere una passphrase, ma è sempre raccomandato.
Questo comando genera due file nella directory selezionata (comunemente ~/.ssh):
- la chiave pubblica con lestensione `.pub`;
- e quella privata senza estensione.
La chiave pubblica può essere vista con un semplice comando:
```bash
piccihud@WORKSTATION03:~
→ cat /home/piccihud/.ssh/<file_name>.pub
```
## Caricamento della chiave SSH nella macchina remota (server)
L'output del comando precedente deve essere copiato nel file **.ssh/authorized_keys** presente sulla macchina remota.
Per prima cosa, Si accede tramite SSH alla macchina remota:
```bash
→ ssh user@indirizzo_ip
piccihud@WORKSTATION03:~
→ ssh root@10.21.81.138 -p 1220 (per una porta differente dalla 22)
[15:33:25]root@server:~
cd .ssh
[15:33:31]root@server:~/.ssh
echo ssh-ed25519 ******************************************************* piccihud >> authorized_keys
```
Oppure, se si preferisce, si può utilizzare Nano ovvero Vim. Tramite il comando `cat .ssh/authorized_keys` o `less .ssh/authorized_keys` è possibile vedere la propria chiave nel file di configurazione.
### Configurazione SSH sulla macchina locale
Nel file di configurazione locale, va indicato come raggiungere l'host remoto:
```bash
piccihud@WORKSTATION03:~
→ vim .ssh/config
host <key_name> #il nome della macchina remota alla quale si accederà
hostname 10.21.81.138 #indirizzo ip della macchina remota
user root
IdentityFile ~/.ssh/<file_name> #indicare il percorso della chiave ssh privata
TCPKeepAlive yes
port 22
```
### Accedere alla macchina remota
Per accedere a una macchina server tramite SSH è necessario conoscere l'indirizzo ip di questa macchina e il nome dell'utente. Ciò è possibile scoprirlo con questi semplici comandi:
```bash
→ hostname -I
192.168.0.115
→ whoami
piccihud
```
In assenza della chiave, quindi si può sempre accedere in questo modo:
```bash
→ ssh piccihud@192.168.0.115
```
Altrimenti, per accedere alla macchina basta digitare:
`→ ssh <key_name>`
Ad esempio:
```bash
piccihud@WORKSTATION03:~
→ ssh mnt-bbb
```
## Aggiungere la Chiave SSH allAccount Git
Nelle impostazioni del proprio account, aggiungere la propria chiave pubblica nel campo `SSH and GPG keys`.
![SSH](./asset/git/gitea-ssh.png)
Quindi, configurare il file .ssh/config nella macchina locale:
```bash
# host gitea.it/piccihud
# hostname 10.97.57.55
user <name>
IdentityFile /home/user/.ssh/<file>
TCPKeepAlive yes
port 22
```
Modificare le impostazioni di `git`:
`git config --global --edit`
## Collegamenti
- [https://linuxhint.com/enable-ssh-server-debian/](https://linuxhint.com/enable-ssh-server-debian/)
- [https://wiki.debian.org/it/SSH](https://wiki.debian.org/it/SSH)
- [https://docs.github.com/en/authentication/connecting-to-github-with-ssh](https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
- [https://kinsta.com/it/blog/generare-chiavi-ssh/](https://kinsta.com/it/blog/generare-chiavi-ssh/)

0
Screen.md Normal file
View File

32
Script.md Normal file
View File

@@ -0,0 +1,32 @@
# Script Bash
Qui un elenco di semplici funzioni o script in Bash.
## Rinominare immagini
Ecco come rinominare una lunga serie di file in maniera progressiva, nel formato `imgXXX`:
```bash
j=1 ; for i in * ; do mv "$i" ${i//*./img$(printf "%03d\n" $j).} ; let j=j+1 ; done
```
Per ogni parametro, questo viene rinominato nel formato `imgXXX`, mantenendo inalterata l'estensione del file.
In pratica questo comando permette di rinominare tutti i file di una directory in un formato specifico "img001, img002, img003, ecc."
## Creare un utente da terminale
```bash
sudo useradd -m -u 6667 -G sudo,lp,lpadmin $user
```
Dove l'opzione:
- m: crea anche la home directory associata all'utente;
- u: permette di specificare l'UID dell'utente;
- G: gruppi ulteriori a cui viene aggiunto l'utente
Ricordarsi di impostare una password per il nuovo utente, altrimenti non potrà loggarsi nel sistema:
```bash
passwd $user
```

14
Syncthing.md Normal file
View File

@@ -0,0 +1,14 @@
## Syncthing
```bash
sudo apt-get install syncthing
systemctl --user start syncthing
systemctl --user enable syncthing
```
## Collegamenti
- [https://www.lffl.org/2020/12/guida-syncthing-p2p-sharing.html](https://www.lffl.org/2020/12/guida-syncthing-p2p-sharing.html)
- [https://gist.github.com/zentralwerkstatt/b94ab44938fbdc8b957c674bf9261954](https://gist.github.com/zentralwerkstatt/b94ab44938fbdc8b957c674bf9261954)

5
SystemD.md Normal file
View File

@@ -0,0 +1,5 @@
## SystemD
## Collegamenti
- [https://www.lffl.org/2020/03/guida-systemctl-systemd.html](https://www.lffl.org/2020/03/guida-systemctl-systemd.html)

702
Vim.md Normal file
View File

@@ -0,0 +1,702 @@
# Vim
Vim è un editor di testo molto potente, che può essere ampliato ulteriormente tramite **plugin** vari.
Prima, però, ecco una configurazione base che aggiunge varie funzionalità:
```vim
" IMPOSTAZIONI ----------------------------------------------------------- {{{
colorscheme catppuccin_mocha
set spell spelllang=it,en
syntax on " Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype off " Enable plugins and load plugin for the detected file type.
set nocompatible " be iMproved, required
filetype plugin indent on " required
filetype plugin on " Load an indent file for the detected file type.
filetype indent on
set foldenable
set autoindent
set ruler " Shows the rulers
set showcmd " Shows current cursor info
set autoindent " Automatically guesses the indentation given the previous one
set hlsearch " Automatically highlights search results, to hide them run :noh
set incsearch " Searches incrementally as you type.
set ignorecase " Ignores cases when searching
set noswapfile " Disables swap files
set undofile " Enable keeping history across sessions, don't forget to mkdir
set undodir=~/.vim/undo/
set nofixeol " Do not insert a new line at the end of the file automatically
set backspace=indent,eol,start " Enable backspace key to delete stuffs properly
set termguicolors
set number " Add numbers to each line on the left-hand side.
set relativenumber
set clipboard=unnamedplus
set cursorline " Highlight cursor line underneath the cursor horizontally.
set cursorcolumn " Highlight cursor line underneath the cursor vertically.
set nobackup " Do not save backup files.
set nowrap " Do not wrap lines. Allow long lines to extend as far as the line goes.
set incsearch " While searching though a file incrementally highlight matching characters as you type.
set ignorecase " Ignore capital letters during search.
set smartcase " This will allow you to search specifically for capital letters.
set showmode " Show the mode you are on the last line.
set showmatch " Show matching words during a search.
set hlsearch " Use highlighting when doing a search.
set wildmenu " Enable auto completion menu after pressing TAB.
set wildmode=list:longest " Make wildmenu behave like similar to Bash completion.
set foldenable
set foldmethod=indent
set ttyfast " Speed up scrolling in Vim
set encoding=UTF-8
set nobackup " Neoclide
set nowritebackup
set updatetime=300
set signcolumn=yes
" }}}
```
## Plugin Manager
Per poter installare dei plugin è necessario installare prima un plugin-manager.
### Vundle
```bash
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
```
Dopo aver clonato Vundle sulla propria macchina, inserire le seguenti righe di testo nel file `.vimrc`
```vimrc
" PLUGINS ---------------------------------------------------------------- {{{
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
" All of your Plugins must be added before the following line
"
call vundle#end() " required
" }}}
```
## Installazione plugin
Installare un plugin è molto semplice, basta aggiungerlo nel file `.vimrc`, come da codice sottostante:
```vim
" PLUGINS ---------------------------------------------------------------- {{{
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
" All of your Plugins must be added before the following line
"
Plugin 'preservim/nerdtree'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'sheerun/vim-polyglot'
Plugin 'alvan/vim-closetag'
Plugin 'mattn/emmet-vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ryanoasis/vim-devicons'
Plugin 'frazrepo/vim-rainbow'
Plugin 'mg979/vim-visual-multi', {'branch': 'master'}
Plugin 'itchyny/lightline.vim'
Plugin 'voldikss/vim-floaterm'
Plugin 'neoclide/coc.nvim', {'branch': 'release'}
Bundle 'https://github.com/prashanthellina/follow-markdown-links'
Plugin 'itchyny/calendar.vim'
Plugin 'mracos/mermaid.vim'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'bbrtj/vim-vorg-md'
call vundle#end() " required
" }}}
```
Una volta salvato il file, digitare `:PluginInstall`.
Quando l'installazione è completata, è buona norma cancellare la cache del buffer digitando il comando `:bdelete`.
È possibile ricercare plugin nel Web oppure tramite il comando `:PluginSearch`. Per aggiornare l'elenco locale dei plugin dal sito vimscripts digitare:
`:PluginSearch!`
### Alcuni plugin utili
- [https://github.com/preservim/nerdtree](https://github.com/preservim/nerdtree)
- [https://github.com/VundleVim/Vundle.vim](https://github.com/VundleVim/Vundle.vim)
- [https://github.com/sheerun/vim-polyglot](https://github.com/sheerun/vim-polyglot)
- [https://github.com/alvan/vim-closetag](https://github.com/alvan/vim-closetag)
- [https://github.com/mattn/emmet-vim](https://github.com/mattn/emmet-vim)
- [https://github.com/ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons)
- [https://github.com/nopecha-ai/nopecha-extension](https://github.com/nopecha-ai/nopecha-extension)
- [https://github.com/thameera/vimv](https://github.com/thameera/vimv)
- [https://github.com/voldikss/vim-floaterm#requirements](https://github.com/voldikss/vim-floaterm#requirements)
- [https://github.com/akrawchyk/awesome-vim](https://github.com/akrawchyk/awesome-vim)
- [https://github.com/neoclide/coc.nvim](https://github.com/neoclide/coc.nvim)
- [https://github.com/fannheyward/coc-marketplace](https://github.com/fannheyward/coc-marketplace)
- [https://github.com/OmniSharp/omnisharp-vim](https://github.com/OmniSharp/omnisharp-vim)
- [https://github.com/ncm2/ncm2](https://github.com/ncm2/ncm2)
- [https://github.com/prashanthellina/follow-markdown-links](https://github.com/prashanthellina/follow-markdown-links)
- [https://github.com/itchyny/calendar.vim](https://github.com/itchyny/calendar.vim)
- [https://github.com/mracos/mermaid.vim](https://github.com/mracos/mermaid.vim)
- [https://github.com/bbrtj/vim-vorg-md](https://github.com/bbrtj/vim-vorg-md)
- [https://github.com/rderik/vim-markdown-toc](https://github.com/rderik/vim-markdown-toc)
Nel caso di `neoclide`, da installare i seguenti moduli:
```vim
CocInstall coc-cmake coc-css coc-cssmodules coc-docker coc-emmet coc-explorer coc-flutter coc-highlight coc-html coc-htmlhint coc-html-css-support coc-json coc-ltex coc-markdown-preview-enhanced coc-markdownlint coc-omnisharp coc-prettier coc-python coc-sh coc-sql coc-svelte coc-svg coc-vimlsp coc-xml coc-yaml coc-markdown-preview-enhanced coc-webview
```
## .vimrc
```vim
" IMPOSTAZIONI ----------------------------------------------------------- {{{
colorscheme catppuccin_mocha
set spell spelllang=it,en
syntax on " Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype off " Enable plugins and load plugin for the detected file type.
set nocompatible " be iMproved, required
filetype plugin indent on " required
filetype plugin on " Load an indent file for the detected file type.
filetype indent on
set foldenable
set autoindent
set autoindent " Automatically guesses the indentation given the previous one
set hlsearch " Automatically highlights search results, to hide them run :noh
set incsearch " Searches incrementally as you type.
set ruler " Shows the rulers
set showcmd " Shows current cursor info
set ignorecase " Ignores cases when searching
set noswapfile " Disables swap files
set undofile " Enable keeping history across sessions, don't forget to mkdir
set undodir=~/.vim/undo/
set nofixeol " Do not insert a new line at the end of the file automatically
set backspace=indent,eol,start " Enable backspace key to delete stuffs properly
set termguicolors
set number " Add numbers to each line on the left-hand side.
set relativenumber
set clipboard=unnamedplus
set cursorline " Highlight cursor line underneath the cursor horizontally.
set cursorcolumn " Highlight cursor line underneath the cursor vertically.
set nobackup " Do not save backup files.
set nowrap " Do not wrap lines. Allow long lines to extend as far as the line goes.
set incsearch " While searching though a file incrementally highlight matching characters as you type.
set ignorecase " Ignore capital letters during search.
set smartcase " This will allow you to search specifically for capital letters.
set showmode " Show the mode you are on the last line.
set showmatch " Show matching words during a search.
set hlsearch " Use highlighting when doing a search.
set wildmenu " Enable auto completion menu after pressing TAB.
set wildmode=list:longest " Make wildmenu behave like similar to Bash completion.
set foldenable
set foldmethod=indent
set ttyfast " Speed up scrolling in Vim
set encoding=UTF-8
set nobackup " Neoclide
set nowritebackup
set updatetime=300
set signcolumn=yes
" }}}
" PLUGINS ---------------------------------------------------------------- {{{
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"
" All of your Plugins must be added before the following line
"
Plugin 'preservim/nerdtree'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'sheerun/vim-polyglot'
Plugin 'alvan/vim-closetag'
Plugin 'mattn/emmet-vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ryanoasis/vim-devicons'
Plugin 'frazrepo/vim-rainbow'
Plugin 'mg979/vim-visual-multi', {'branch': 'master'}
Plugin 'itchyny/lightline.vim'
Plugin 'voldikss/vim-floaterm'
Plugin 'neoclide/coc.nvim', {'branch': 'release'}
Bundle 'https://github.com/prashanthellina/follow-markdown-links'
Plugin 'itchyny/calendar.vim'
Plugin 'mracos/mermaid.vim'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'bbrtj/vim-vorg-md'
call vundle#end() " required
" }}}
" MAPPINGS --------------------------------------------------------------- {{{
" Mappings code goes here.
" }}}
" VIMSCRIPT -------------------------------------------------------------- {{{
" This will enable code folding.
" zo per aprire una singola piega sotto il cursore.
" zc per chiudere la piega sotto il cursore.
" zR per aprire tutte le pieghe.
" zM per chiudere tutte le pieghe.
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" More Vimscripts code goes here.
" }}}
" NERD-TREE ------------------------------------------------------------- {{{
"
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p"
"
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif"
"
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
"
" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
" }}}
" MD-FOLDING ------------------------------------------------------------- {{{
"
let g:markdown_folding = 1
"
"zo open current fold
"zO recursively open current fold
"zc close current fold
"zC recursively close current fold
"za toggle current fold
"zA recursively open/close current fold
"zm reduce foldlevel by one
"zM close all folds
"zr increase foldlevel by one
"zR open all folds
" }}}
" MARK-DOWN-PREVIEW ----------------------------------------------------- {{{
" https://github.com/iamcco/markdown-preview.nvim
"
" set to 1, nvim will open the preview window after entering the markdown buffer
" default: 0
let g:mkdp_auto_start = 0
" set to 1, the nvim will auto close current preview window when change
" from markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 1
" set to 1, the vim will refresh markdown when save the buffer or
" leave from insert mode, default 0 is auto refresh markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0
" set to 1, the MarkdownPreview command can be use for all files,
" by default it can be use in markdown file
" default: 0
let g:mkdp_command_for_global = 0
" set to 1, preview server available to others in your network
" by default, the server listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0
" use custom IP to open preview page
" useful when you work in remote vim and preview on local browser
" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
" default empty
let g:mkdp_open_ip = ''
" specify browser to open preview page
" for path with space
" valid: `/path/with\ space/xxx`
" invalid: `/path/with\\ space/xxx`
" default: ''
let g:mkdp_browser = ''
" set to 1, echo preview page url in command line when open preview page
" default is 0
let g:mkdp_echo_preview_url = 0
" a custom vim function name to open preview page
" this function will receive url as param
" default is empty
let g:mkdp_browserfunc = ''
" options for markdown render
" mkit: markdown-it options for render
" katex: katex options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: if disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
" middle: mean the cursor position alway show at the middle of the preview page
" top: mean the vim top viewport alway show at the top of the preview page
" relative: mean the cursor position alway show at the relative positon of the preview page
" hide_yaml_meta: if hide yaml metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
" content_editable: if enable content editable for preview page, default: v:false
" disable_filename: if disable filename header for preview page, default: 0
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {},
\ 'content_editable': v:false,
\ 'disable_filename': 0,
\ 'toc': {}
\ }
" use a custom markdown style must be absolute path
" like '/Users/username/markdown.css' or expand('~/markdown.css')
let g:mkdp_markdown_css = ''
" use a custom highlight style must absolute path
" like '/Users/username/highlight.css' or expand('~/highlight.css')
let g:mkdp_highlight_css = ''
" use a custom port to start server or empty for random
let g:mkdp_port = ''
" preview page title
" ${name} will be replace with the file name
let g:mkdp_page_title = '「${name}」'
" recognized filetypes
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']
" set default theme (dark or light)
" By default the theme is define according to the preferences of the system
let g:mkdp_theme = 'dark'
" }}}
" VIM-TAG --------------------------------------------------------------- {{{
"
" filenames like *.xml, *.html, *.xhtml, ...
" These are the file extensions where this plugin is enabled.
"
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
" filenames like *.xml, *.xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx'
" filetypes like xml, html, xhtml, ...
" These are the file types where this plugin is enabled.
"
let g:closetag_filetypes = 'html,xhtml,phtml'
" filetypes like xml, xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filetypes = 'xhtml,jsx'
" integer value [0|1]
" This will make the list of non-closing tags case-sensitive (e.g. `<Link>` will be closed while `<link>` won't.)
"
let g:closetag_emptyTags_caseSensitive = 1
" dict
" Disables auto-close if not in a "valid" region (based on filetype)
"
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ 'typescriptreact': 'jsxRegion,tsxRegion',
\ 'javascriptreact': 'jsxRegion',
\ }
" Shortcut for closing tags, default is '>'
"
let g:closetag_shortcut = '>'
" Add > at current position without closing the current tag, default is ''
"
let g:closetag_close_shortcut = '<leader>>'
" }}}
" EMMET-PLUGIN --------------------------------------------------------- {{{
let g:user_emmet_settings = {
\ 'variables': {'lang': 'ja'},
\ 'html': {
\ 'default_attributes': {
\ 'option': {'value': v:null},
\ 'textarea': {'id': v:null, 'name': v:null, 'cols': 10, 'rows': 10},
\ },
\ 'snippets': {
\ 'html:5': "<!DOCTYPE html>\n"
\ ."<html lang=\"en\">\n"
\ ."<head>\n"
\ ."\t<meta charset=\"${charset}\">\n"
\ ."\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n"
\ ."\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."</html>",
\ },
\ },
\}
" }}}
" RAINBOW PARENTHESES -------------------------------------------------- {{{
" https://github.com/frazrepo/vim-rainbow
let g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta']
"}}}
" MULTI-CURSOR --------------------------------------------------------- {{{
" https://github.com/mg979/vim-visual-multi
"To make a basic selection, use the Ctrl+N keystroke in normal mode, followed by a motion:
"c change text.
"I insert at start of range.
"A insert at end of range.
let g:multi_cursor_use_default_mapping=0
" Default mapping
let g:multi_cursor_start_word_key = '<C-n>'
let g:multi_cursor_select_all_word_key = '<A-n>'
let g:multi_cursor_start_key = 'g<C-n>'
let g:multi_cursor_select_all_key = 'g<A-n>'
let g:multi_cursor_next_key = '<C-n>'
let g:multi_cursor_prev_key = '<C-p>'
let g:multi_cursor_skip_key = '<C-x>'
let g:multi_cursor_quit_key = '<Esc>'
"}}}
" VIM-LIGHTLINE --------------------------------------------------------- {{{
" https://github.com/itchyny/lightline.vim
let g:lightline = {
\ 'colorscheme': 'wombat',
\ }
" }}}
" COC-NEOCLIDE ---------------------------------------------------------- {{{
" https://github.com/neoclide/coc.nvim
" https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions
" Use tab for trigger completion with characters ahead and navigate
" NOTE: There's always complete item selected by default, you may want to enable
" no select by `"suggest.noselect": true` in your configuration file
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s)
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying code actions to the selected code block
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying code actions at the cursor position
nmap <leader>ac <Plug>(coc-codeaction-cursor)
" Remap keys for apply code actions affect whole buffer
nmap <leader>as <Plug>(coc-codeaction-source)
" Apply the most preferred quickfix action to fix diagnostic on the current line
nmap <leader>qf <Plug>(coc-fix-current)
" Remap keys for applying refactor code actions
nmap <silent> <leader>re <Plug>(coc-codeaction-refactor)
xmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
nmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
" Run the Code Lens action on the current line
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> to scroll float windows/popups
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges
" Requires 'textDocument/selectionRange' support of language server
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
" }}}
```
## Comandi utili
| Comando | Funzione |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `gx` | Apre il link sotto al cursore nel browser |
| `:m +/-n` | Sposta la riga sopra o sotto di *n* posizioni |
| `"+y` | In Visual Mode, copia il testo selezionato nella clipboard del SO |
| `vimv` | Da terminale, permette di rinominare cartelle e file coi comandi di Vim ([https://github.com/thameera/vimv](https://github.com/thameera/vimv)) |
| `:args` | Seleziona dei file come argomenti. È possibile utilizzare i caratteri jolly |
| `:argdo` | Permette di eseguire un comando su n files |
Ad esempio:
```vim
:argdo %s/stringToBeReplaced/replacementString/g | update
```
`update` serve per salvare le modifiche automaticamente.
## Collegamenti
- [https://irian.to/blogs/how-to-search-and-replace-string-across-multiple-files-in-vim/](https://irian.to/blogs/how-to-search-and-replace-string-across-multiple-files-in-vim/)
- [https://linuxhint.com/vim-copy-text-system-clipboard/](https://linuxhint.com/vim-copy-text-system-clipboard/)

70
Xfreerdp.md Normal file
View File

@@ -0,0 +1,70 @@
# XfreeRDP
`FreeRDP` è l'implementazione libera del protocollo RDP, rilasciato sotto licenza Apache 2.0.
RDP (Remote Desktop Protocol) è un protocollo di rete proprietario sviluppato da Microsoft, che permette la connessione remota da un computer a un altro utilizzando l'interfaccia grafica (GUI) di Windows, usando di default la porta TCP e UDP 3389.
L'applicazione (che usa il protocollo in oggetto) compresa in Microsoft Windows si chiama `Connessione Desktop remoto`.
## Installazione
Su Debian e derivate:
```bash
sudo apt update ; sudo apt install -y freerdp2-x11
```
## Sintassi
```bash
xfreerdp [file] [options] [/v:<server>[:port]]
```
Ecco un esempio:
```bash
xfreerdp /v:[IP_MACCHINA_REMOTA]:[PORTA] /u:[UTENTE] /t:[TITOLO_FINESTRA] /bpp:32 +window-drag +clipboard /cert-ignore /size:1800x1000 /rfx /dynamic-resolution /gfx /encryption-methods:128 /d:[DOMINIO]
```
dove:
`/v`: ip macchina remota : porta (facoltativa);
`/u`: Utente;
`/t`: Titolo della finestra;
`/f`: Fullscreen mode;
`/p`: Password (in chiaro);
`+compression`: (default:off) Compressione;
`/bpp:32`: Serve a specificare l'intensità del colore per una sessione remota o la profondità di
colore. 32bit indica la qualità più alta;
+window-drag Permette il trascinamento dell'intera finestra;
`+clipboard`: Attivare il copia/incolla;
`cert-ignore`: Ignora il certificato;
`/size:1800x1000`: Dimensioni in pixel della finestra;
`/rfx`: Microsoft RemoteFX è una tecnologia che migliora l'esperienza visiva;
`/dynamic-resolution`: Invia aggiornamenti della risoluzione quando la finestra viene ridimensionata;
`-encryption` (default:on)
`/encryption-methods`: [40] [56] [128] Selezionare 128bit i dati vengono crittografati utilizzando una chiave di crittografia a 128 bit. Questo tipo di crittografia potrebbe essere incompatibile con alcuni sistemi;
`/drive:<sharename>,<path>`: reindirizza <path> come cartella condivisa <sharename>;
`/d`: Dominio facoltativo
## Collegamenti
- [https://it.wikipedia.org/wiki/Remote_Desktop_Protocol](https://it.wikipedia.org/wiki/Remote_Desktop_Protocol)
- [https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown](https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown)
- [https://github.com/FreeRDP/FreeRDP/wiki/CommandLineInterface](https://github.com/FreeRDP/FreeRDP/wiki/CommandLineInterface)
- [https://www.freerdp.com/](https://www.freerdp.com/)

BIN
asset/debian/bismuth.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 KiB

BIN
asset/debian/firefox.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
asset/debian/papirus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

BIN
asset/fairphone/divest1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
asset/fairphone/divest2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
asset/fairphone/divest3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

BIN
asset/fairphone/divest4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 KiB

BIN
asset/fairphone/divest5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

BIN
asset/fairphone/unlock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
asset/git/gitea-ssh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
asset/kde/1f2430.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
asset/kde/firefox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
asset/kde/kde.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
asset/kde/ly.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
asset/kde/material.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
asset/kde/material2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

BIN
asset/kde/reader-menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
asset/kde/reader.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

BIN
asset/kde/statusbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

299
asset/logseq/config.edn Normal file
View File

@@ -0,0 +1,299 @@
{:meta/version 1
;; Currently, we support either "Markdown" or "Org".
;; This can overwrite your global preference so that
;; maybe your personal preferred format is Org but you'd
;; need to use Markdown for some projects.
;; :preferred-format ""
;; Preferred workflow style.
;; Value is either ":now" for NOW/LATER style,
;; or ":todo" for TODO/DOING style.
:preferred-workflow :now
;; The app will ignore those directories or files.
;; E.g. :hidden ["/archived" "/test.md" "../assets/archived"]
:hidden []
;; When creating the new journal page, the app will use your template if there is one.
;; You only need to input your template name here.
:default-templates
{:journals ""}
;; Whether to enable hover on tooltip preview feature
;; Default is true, you can also toggle this via setting page
:ui/enable-tooltip? true
;; Enable Block timestamp
:feature/enable-block-timestamps? false
;; Enable remove accents when searching.
;; After toggle this option, please remember to rebuild your search index by press (cmd+c cmd+s).
:feature/enable-search-remove-accents? true
;; Disable Built-in Scheduled and deadline Query
;; :feature/disable-scheduled-and-deadline-query? true
;; Specify the date on which the week starts.
;; Goes from 0 to 6 (Monday to Sunday), default to 6
:start-of-week 6
;; Specify a custom CSS import
;; This option take precedence over your local `logseq/custom.css` file
;; You may find a list of awesome logseq themes here:
;; https://github.com/logseq/awesome-logseq#css-themes
;; Example:
;; :custom-css-url "@import url('https://cdn.jsdelivr.net/gh/dracula/logseq@master/custom.css');"
;; Set Bullet indentation when exporting
;; default option: tab
;; Possible options are for `:sidebar` are
;; 1. `:eight-spaces` as eight spaces
;; 2. `:four-spaces` as four spaces
;; 3. `:two-spaces` as two spaces
;; :export/bullet-indentation :tab
;; When :all-pages-public? true, export repo would export all pages within that repo.
;; Regardless of whether you've set any page to public or not.
;; Example:
;; :publishing/all-pages-public? true
;; Specify default home page and sidebar status for Logseq
;; If not specified, Logseq default opens journals page on startup
;; value for `:page` is name of page
;; Possible options for `:sidebar` are
;; 1. `"Contents"` to open up `Contents` in sidebar by default
;; 2. `page name` to open up some page in sidebar
;; 3. Or multiple pages in an array ["Contents" "Page A" "Page B"]
;; If `:sidebar` is not set, sidebar will be hidden
;; Example:
;; 1. Setup page "Changelog" as home page and "Contents" in sidebar
;; :default-home {:page "Changelog", :sidebar "Contents"}
;; 2. Setup page "Jun 3rd, 2021" as home page without sidebar
;; :default-home {:page "Jun 3rd, 2021"}
;; 3. Setup page "home" as home page with multiple pages in sidebar
;; :default-home {:page "home" :sidebar ["page a" "page b"]}
;; Tell logseq to use a specific folder in the repo as a default location for notes
;; if not specified, notes are stored in `pages` directory
;; :pages-directory "your-directory"
;; Tell logseq to use a specific folder in the repo as a default location for journals
;; if not specified, journals are stored in `journals` directory
;; :journals-directory "your-directory"
;; Set this to true will convert
;; `[[Grant Ideas]]` to `[[file:./grant_ideas.org][Grant Ideas]]` for org-mode
;; For more, see https://github.com/logseq/logseq/issues/672
;; :org-mode/insert-file-link? true
;; Setup custom shortcuts under `:shortcuts` key
;; Syntax:
;; 1. `+` means keys pressing simultaneously. eg: `ctrl+shift+a`
;; 2. ` ` empty space between keys represents key chords. eg: `t s` means press `s` follow by `t`
;; 3. `mod` means `Ctrl` for Windows/Linux and `Command` for Mac
;; 4. use `false` to disable particular shortcut
;; 4. you can define multiple bindings for one action, eg `["ctrl+j" "down"]`
;; full list of configurable shortcuts are available below:
;; https://github.com/logseq/logseq/blob/master/src/main/frontend/modules/shortcut/config.cljs
;; Example:
;; :shortcuts
;; {:editor/new-block "enter"
;; :editor/new-line "shift+enter"
;; :editor/insert-link "mod+shift+k"
;; :editor/hightlight false
;; :ui/toggle-settings "t s"
;; :editor/up ["ctrl+k" "up"]
;; :editor/down ["ctrl+j" "down"]
;; :editor/left ["ctrl+h" "left"]
;; :editor/right ["ctrl+l" "right"]}
:shortcuts {}
;; By default, pressing `Enter` in the document mode will create a new line.
;; Set this to `true` so that it's the same behaviour as the usual outliner mode.
:shortcut/doc-mode-enter-for-new-block? false
;; Block content larger than `block/content-max-length` will not be searchable
;; or editable for performance.
:block/content-max-length 10000
;; Whether to show command doc on hover
:ui/show-command-doc? true
;; Whether to show empty bullets for non-document mode (the default mode)
:ui/show-empty-bullets? false
;; Pre-defined :view function to use with advanced queries
:query/views
{:pprint
(fn [r] [:pre.code (pprint r)])}
;; Pre-defined :result-transform function for use with advanced queries
:query/result-transforms
{:sort-by-priority
(fn [result] (sort-by (fn [h] (get h :block/priority "Z")) result))}
;; The app will show those queries in today's journal page,
;; the "NOW" query asks the tasks which need to be finished "now",
;; the "NEXT" query asks the future tasks.
:default-queries
{:journals
[{:title "🔨 NOW"
:query [:find (pull ?h [*])
:in $ ?start ?today
:where
[?h :block/marker ?marker]
[(contains? #{"NOW" "DOING"} ?marker)]
[?h :block/page ?p]
[?p :block/journal? true]
[?p :block/journal-day ?d]
[(>= ?d ?start)]
[(<= ?d ?today)]]
:inputs [:14d :today]
:result-transform (fn [result]
(sort-by (fn [h]
(get h :block/priority "Z")) result))
:collapsed? false}
{:title "📅 NEXT"
:query [:find (pull ?h [*])
:in $ ?start ?next
:where
[?h :block/marker ?marker]
[(contains? #{"NOW" "LATER" "TODO"} ?marker)]
[?h :block/page ?p]
[?p :block/journal? true]
[?p :block/journal-day ?d]
[(> ?d ?start)]
[(< ?d ?next)]]
:inputs [:today :7d-after]
:collapsed? false}]}
;; Add your own commands to slash menu to speedup.
;; E.g.
;; :commands
;; [
;; ["js" "Javascript"]
;; ["md" "Markdown"]
;; ]
:commands
[]
;; By default, a block can only be collapsed if it has some children.
;; `:outliner/block-title-collapse-enabled? true` enables a block with a title
;; (multiple lines) can be collapsed too. For example:
;; - block title
;; block content
:outliner/block-title-collapse-enabled? false
;; Macros replace texts and will make you more productive.
;; For example:
;; Change the :macros value below to:
;; {"poem" "Rose is $1, violet's $2. Life's ordered: Org assists you."}
;; input "{{poem red,blue}}"
;; becomes
;; Rose is red, violet's blue. Life's ordered: Org assists you.
:macros {}
;; The default level to be opened for the linked references.
;; For example, if we have some example blocks like this:
;; - a [[page]] (level 1)
;; - b (level 2)
;; - c (level 3)
;; - d (level 4)
;;
;; With the default value of level 2, `b` will be collapsed.
;; If we set the level's value to 3, `b` will be opened and `c` will be collapsed.
:ref/default-open-blocks-level 2
:ref/linked-references-collapsed-threshold 50
:favorites []
;; any number between 0 and 1 (the greater it is the faster the changes of the next-interval of card reviews) (default 0.5)
;; :srs/learning-fraction 0.5
;; the initial interval after the first successful review of a card (default 4)
;; :srs/initial-interval 4
;; hide specific properties for blocks
;; E.g. :block-hidden-properties #{:created-at :updated-at}
;; :block-hidden-properties #{}
;; Enable all your properties to have corresponding pages
:property-pages/enabled? true
;; Properties to exclude from having property pages
;; E.g.:property-pages/excludelist #{:duration :author}
;; :property-pages/excludelist
;; By default, property value separated by commas will not be treated as
;; page references. You can add properties to enable it.
;; E.g. :property/separated-by-commas #{:alias :tags}
;; :property/separated-by-commas #{}
;; logbook setup
;; :logbook/settings
;; {:with-second-support? false ;limit logbook to minutes, seconds will be eliminated
;; :enabled-in-all-blocks true ;display logbook in all blocks after timetracking
;; :enabled-in-timestamped-blocks false ;don't display logbook at all
;; }
;; Mobile photo uploading setup
;; :mobile/photo
;; {:allow-editing? true}
;; Mobile features options
;; Gestures
;; :mobile
;; {:gestures/disabled-in-block-with-tags ["kanban"]}
;; Extra CodeMirror options
;; :editor/extra-codemirror-options {:keyMap "emacs" :lineWrapping true}
;; ignore #+keyword: for parsing page references in orgmode
;; :ignored-page-references-keywords #{"author" "startup"}
;; Quick capture templates on mobile for recieving contents from other apps.
;; Each template contains three elements {time}, {text} and {url}, which can be auto-expanded
;; by received contents from other apps. Note: the {} cannot be omitted.
;; - {time}: capture time
;; - {text}: text that users selected before sharing.
;; - {url}: url or assets path for media files stored in Logseq.
;; You can also reorder them, or even only use one or two of them in the template.
;; You can also insert or format any text in the template as shown in the following examples.
;; :quick-capture-templates
;; {:text "[[quick capture]] **{time}**: {text} from {url}"
;; :media "[[quick capture]] **{time}**: {url}"}
;; File sync options
;; Ignore these files when syncing, regexp is supported.
;; :file-sync/ignore-files []
;; dwim (do what I mean) for Enter key when editing.
;; Context-awareness of Enter key makes editing more easily
; :dwim/settings {
; :admonition&src? true
; :markup? false
; :block-ref? true
; :page-ref? true
; :properties? true
; :list? true
; }
;; Decide the way to escape the special characters in the page title.
;; Warning:
;; This is a dangerous operation. If you want to change the setting,
;; should access the setting `Filename format` and follow the instructions.
;; Or you have to rename all the affected files manually then re-index on all
;; clients after the files are synced. Wrong handling may cause page titles
;; containing special characters to be messy.
;; Available values:
;; :file/name-format :triple-lowbar
;; ;use triple underscore `___` for slash `/` in page title
;; ;use Percent-encoding for other invalid characters
;; :file/name-format :legacy
;; ;use Percent-encoding for slash and other invalid characters
;; ;parse `.` in file name as slash `/` in page title
:file/name-format :triple-lowbar
}

0
asset/logseq/custom.css Normal file
View File

BIN
asset/markdown/plugin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
asset/markdown/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
asset/neofetch/neofetch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
asset/nextcloud/dav1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
asset/nextcloud/dav2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
asset/nextcloud/dav3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
asset/nextcloud/dav4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
asset/nextcloud/dav5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
asset/nextcloud/dav6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
asset/nextcloud/dav7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
asset/nextcloud/dav8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
asset/nextcloud/sync1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
asset/nextcloud/sync10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
asset/nextcloud/sync11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
asset/nextcloud/sync12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
asset/nextcloud/sync13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
asset/nextcloud/sync2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
asset/nextcloud/sync3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

BIN
asset/nextcloud/sync4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
asset/nextcloud/sync5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
asset/nextcloud/sync6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
asset/nextcloud/sync7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
asset/nextcloud/sync8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
asset/nextcloud/sync9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

1
asset/pages/contents.md Normal file
View File

@@ -0,0 +1 @@
-

BIN
asset/pull-request/bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
asset/pull-request/mod.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

146
asset/rofi/config.rasi Normal file
View File

@@ -0,0 +1,146 @@
configuration {
modi: "drun,window,run,ssh";
width: 900;
lines: 15;
columns: 1;
font: "Open Sans 13";
bw: 1;
/* location: 0;*/
/* padding: 5;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
show-icons: true;
terminal: "konsole";
/* ssh-client: "ssh";*/
/* ssh-command: "{terminal} -e {ssh-client} {host}";*/
run-command: "{cmd}";
/* run-list-command: "";*/
run-shell-command: "{terminal} -e {cmd}";
/* window-command: "xkill -id {window}";*/
/* window-match-fields: "all";*/
/* drun-icon-theme: ;*/
drun-match-fields: "name,generic,exec,categories";
/* drun-show-actions: true; */
drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";
/* disable-history: false;*/
/* ignored-prefixes: "";*/
/* sort: false;*/
/* sorting-method: ;*/
case-sensitive: false;
/* cycle: true;*/
sidebar-mode: true;
/* eh: 1;*/
/* auto-select: false;*/
/* parse-hosts: false;*/
/* parse-known-hosts: true;*/
combi-modi: "drun,run,window";
matching: "fuzzy";
/* tokenize: true;*/
/* m: "-5";*/
/* line-margin: 2;*/
/* line-padding: 1;*/
/* filter: ;*/
/* separator-style: "dash";*/
/* hide-scrollbar: false;*/
/* fullscreen: false;*/
/* fake-transparency: false;*/
/* dpi: -1;*/
/* threads: 0;*/
/* scrollbar-width: 8;*/
/* scroll-method: 0;*/
/* fake-background: "screenshot";*/
/* window-format: "{w} {c} {t}";*/
/* click-to-exit: true;*/
/* show-match: true;*/
/* theme: ;*/
/* color-normal: ;*/
/* color-urgent: ;*/
/* color-active: ;*/
/* color-window: ;*/
/* max-history-size: 25;*/
combi-hide-mode-prefix: true;
/* matching-negate-char: '-' /* unsupported */;*/
/* cache-dir: ;*/
/* pid: "/run/user/19201007/rofi.pid";*/
display-window: true;
/* display-windowcd: ;*/
display-run: true;
display-ssh: true;
display-drun: true;
display-combi: true;
/* display-keys: ;*/
/* kb-primary-paste: "Control+V,Shift+Insert";*/
/* kb-secondary-paste: "Control+v,Insert";*/
/* kb-clear-line: "Control+w";*/
/* kb-move-front: "Control+a";*/
/* kb-move-end: "Control+e";*/
/* kb-move-word-back: "Alt+b,Control+Left";*/
/* kb-move-word-forward: "Alt+f,Control+Right";*/
/* kb-move-char-back: "Left,Control+b";*/
/* kb-move-char-forward: "Right,Control+f";*/
/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/
/* kb-remove-word-forward: "Control+Alt+d";*/
/* kb-remove-char-forward: "Delete,Control+d";*/
/* kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";*/
/* kb-remove-to-eol: "Control+k";*/
/* kb-remove-to-sol: "Control+u";*/
/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/
/* kb-accept-custom: "Control+Return";*/
/* kb-accept-alt: "Shift+Return";*/
/* kb-delete-entry: "Shift+Delete";*/
/* kb-mode-next: "Shift+Right,Control+Tab";*/
/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/
/* kb-row-left: "Control+Page_Up";*/
/* kb-row-right: "Control+Page_Down";*/
/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/
/* kb-row-down: "Down,Control+n";*/
/* kb-row-tab: "Tab";*/
/* kb-page-prev: "Page_Up";*/
/* kb-page-next: "Page_Down";*/
/* kb-row-first: "Home,KP_Home";*/
/* kb-row-last: "End,KP_End";*/
/* kb-row-select: "Control+space";*/
/* kb-screenshot: "Alt+S";*/
/* kb-ellipsize: "Alt+period";*/
/* kb-toggle-case-sensitivity: "grave,dead_grave";*/
/* kb-toggle-sort: "Alt+grave";*/
/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/
/* kb-custom-1: "Alt+1";*/
/* kb-custom-2: "Alt+2";*/
/* kb-custom-3: "Alt+3";*/
/* kb-custom-4: "Alt+4";*/
/* kb-custom-5: "Alt+5";*/
/* kb-custom-6: "Alt+6";*/
/* kb-custom-7: "Alt+7";*/
/* kb-custom-8: "Alt+8";*/
/* kb-custom-9: "Alt+9";*/
/* kb-custom-10: "Alt+0";*/
/* kb-custom-11: "Alt+exclam";*/
/* kb-custom-12: "Alt+at";*/
/* kb-custom-13: "Alt+numbersign";*/
/* kb-custom-14: "Alt+dollar";*/
/* kb-custom-15: "Alt+percent";*/
/* kb-custom-16: "Alt+dead_circumflex";*/
/* kb-custom-17: "Alt+ampersand";*/
/* kb-custom-18: "Alt+asterisk";*/
/* kb-custom-19: "Alt+parenleft";*/
kb-select-1: "Super+1";
kb-select-2: "Super+2";
kb-select-3: "Super+3";
kb-select-4: "Super+4";
kb-select-5: "Super+5";
kb-select-6: "Super+6";
kb-select-7: "Super+7";
kb-select-8: "Super+8";
kb-select-9: "Super+9";
kb-select-10: "Super+0";
/* ml-row-left: "ScrollLeft";*/
/* ml-row-right: "ScrollRight";*/
/* ml-row-up: "ScrollUp";*/
/* ml-row-down: "ScrollDown";*/
/* me-select-entry: "MousePrimary";*/
/* me-accept-entry: "MouseDPrimary";*/
/* me-accept-custom: "Control+MouseDPrimary";*/
}
@import "/home/piccihud/.local/share/rofi/themes/nord-oneline.rasi"

BIN
asset/rofi/final.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

BIN
asset/rofi/rofi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
asset/rofi/wifi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB