Merge branch 'master' of ssh://git.andreafazzi.eu:10022/andrea/knowledgebase

This commit is contained in:
Andrea Fazzi 2023-02-23 04:53:11 +01:00
commit 2167a3b87b
10 changed files with 172 additions and 4 deletions

3
journals/2023_02_14.md Normal file
View file

@ -0,0 +1,3 @@
-
- Aladdin passwords #retrogaming
- Level 4 GENIE/JAFAR/ALADDIN/ABU

View file

@ -2,4 +2,9 @@
- ## Esercizio 1
- Individua il file `autosave.tmp` all'interno della cartella `service1` e rimuovilo
- Reindirizza l'output del comando `ls -l` eseguito all'interno della cartella `service1` nel file `ls-stdout` e calcolane il checksum.
- Seleziona sul modulo online il checksum ottenuto
- Seleziona sul modulo online il checksum ottenuto
- Rimuovere un host da know_hosts in #ssh
- ```bash
ssh-keygen -f "/home/pop-os/.ssh/known_hosts" -R "[localhost]:2222"
```

12
journals/2023_02_16.md Normal file
View file

@ -0,0 +1,12 @@
- **06:49** [[quick capture]]: A Pig Quest by Piggy 18 Team [A Pig Quest by Piggy 18 Team](https://piggy18.itch.io/a-pig-quest?fbclid=IwAR3zZxFjc9ZXQbdIcTJ3mSzRaRpgP8vlUjy8sghiYgzUy50T9mXZr2rfUmM) #retrogaming
- **07:39** [[quick capture]]: A Guide to JSON Web Token (JWT) - DEV Community 👩‍💻👨‍💻 [A Guide to JSON Web Token (JWT) - DEV Community 👩‍💻👨‍💻](https://dev.to/knitesh/building-a-secure-jwt-server-with-nodejs-and-jsonwebtoken-2l32) #JWT #[[Autenticazione basata su token JWT]]
- **12:36** [[quick capture]]: Fine-Tune GPT-3 on custom datasets with just 10 lines of code using GPT-Index - DEV Community 👩‍💻👨‍💻 [Fine-Tune GPT-3 on custom datasets with just 10 lines of code using GPT-Index - DEV Community 👩‍💻👨‍💻](https://dev.to/dhanushreddy29/fine-tune-gpt-3-on-custom-dataset-with-just-10-lines-of-code-using-gpt-index-18mc) #AI
- **19:52** [[quick capture]]: Running Go code inside a NodeJS app with WASM (Part 1/2, 2023) - DEV Community 👩‍💻👨‍💻 [Running Go code inside a NodeJS app with WASM (Part 1/2, 2023) - DEV Community 👩‍💻👨‍💻](https://pedromarquez.dev/blog/2023/2/node_golang_wasm) #golang #wasm
-
- **22:54** [[quick capture]]: https://support.system76.com/articles/bootloader/ #PopOS
- Accettare il fingerprint di un nuovo host in #ssh #bash (soluzione tratta da [questo](https://stackoverflow.com/questions/21383806/how-can-i-force-ssh-to-accept-a-new-host-fingerprint-from-the-command-line) articolo)
- ```bash
ssh -p 2222 -o StrictHostKeyChecking=accept-new test@localhost
```
- Documentazione su modalità valutazione di #LimeSurvey
- https://manual.limesurvey.org/Assessments

View file

@ -21,4 +21,50 @@
- ```bash
# L'opzione -r ritorna una stringa raw
curl -s 'https://api.github.com/users/lambda' | jq -r '.name'
```
```
- **07:41** [[quick capture]]: https://lit.dev/ #Javascript #webcomponents #nojsframework
- **15:06** [[quick capture]]: Modern SPAs without bundlers, CDNs, or Node.js [Modern SPAs without bundlers, CDNs, or Node.js](https://news.ycombinator.com/item?id=34829039) #nojsframework #Javascript
- Per configurare [MELPA](https://melpa.org/#/getting-started) su #emacs
- ```lisp
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
```
- Per spegnere un'uscita video con xrandr #bash
- ```bash
xrandr --output VGA-1 --off
```
- Per effettuare un proxy pass di una connessione #ssh tramite #nginx
- Configurazione di `Gogs` tramite connessione #vpn tra `falkenstein` e `thinkcentre` nell'#homelab
- ```text/x-nginx-conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
stream {
server {
listen 80;
proxy_pass 10.6.0.15:8085;
}
upstream ssh {
server 10.6.0.15:10022;
}
server {
listen 10022;
proxy_pass ssh;
}
}
```

View file

@ -9,4 +9,19 @@
docker build -t andrea/oef_prod .
docker tag andrea/oef_prod localhost:5000/andrea/oef_prod
docker push localhost:5000/andrea/oef_prod
```
```
- **06:41** [[quick capture]]: @kenobit@livellosegreto.it 🔗 https://livellosegreto.it/users/kenobit/statuses/109879692150856582
Stamattina mi hanno mostrato il trailer del film su Tetris, che mi è sembrato altamente insipido.
Il fatto è che la storia di Tetris è incredibile anche senza essere romanzata.
Consiglio questo documentario della BBC, con immagini e filmati dell'epoca:
https://youtu.be/NhwNTo_Yr3k
Fidatevi, è una storia incredibile e irripetibile.
#retrogaming
-
- **14:05** [[quick capture]]: Configuring GlusterFS in Linux Server - DEV Community 👩‍💻👨‍💻 [Configuring GlusterFS in Linux Server - DEV Community 👩‍💻👨‍💻](https://dev.to/waji97/configuring-gluster-in-linux-server-2n6a) #sysadmim
- **14:16** [[quick capture]]: Optimizing Bitbucket Pipelines with Custom Docker Images - DEV Community 👩‍💻👨‍💻 [Optimizing Bitbucket Pipelines with Custom Docker Images - DEV Community 👩‍💻👨‍💻](https://medium.com/@ibrarturi/optimizing-bitbucket-pipelines-with-custom-docker-images-ecbae7a84a26) #Docker

4
journals/2023_02_19.md Normal file
View file

@ -0,0 +1,4 @@
- **13:47** [[quick capture]]: https://jforberg.se/blog/posts/2023-02-19-rockpro64/rockpro64.html
- **14:24** [[quick capture]]: Voice.ai Stole Open-Source Code, Banned Developer Who Informed Them About This [Voice.ai Stole Open-Source Code, Banned Developer Who Informed Them About This](https://news.ycombinator.com/item?id=34856341) #AI #FLOSS #license
- **16:53** [[quick capture]]: Fully documented source code for Elite on the BBC Micro [Fully documented source code for Elite on the BBC Micro](https://news.ycombinator.com/item?id=34852219) #gamedev
-

2
journals/2023_02_20.md Normal file
View file

@ -0,0 +1,2 @@
- **12:13** [[quick capture]]: Email: Explained from first principles [Email: Explained from first principles](https://news.ycombinator.com/item?id=34846606) #teaching
- **16:25** [[quick capture]]: Self hosting in 2023 [Self hosting in 2023](https://news.ycombinator.com/item?id=34860655) #selfhosting #homelab

9
journals/2023_02_21.md Normal file
View file

@ -0,0 +1,9 @@
- **08:14** [[quick capture]]: https://andy-bell.co.uk/my-favourite-3-lines-of-css/ #css
- **20:22** [[quick capture]]: Django and HTMX - DEV Community 👩‍💻👨‍💻 [Django and HTMX - DEV Community 👩‍💻👨‍💻](https://dev.to/kummerer94/django-and-htmx-i5c) #htmx #jwt
- **20:24** [[quick capture]]: A Beginner's Guide to Using Fetch and Axios to Consume REST APIs in React - DEV Community 👩‍💻👨‍💻 [A Beginner's Guide to Using Fetch and Axios to Consume REST APIs in React - DEV Community 👩‍💻👨‍💻](https://dev.to/jhimmyofficial/a-beginners-guide-to-using-fetch-and-axios-to-consume-rest-apis-in-react-3dib) #Javascript #rest #nojsframework
- **20:28** [[quick capture]]: How to Create Your Own Commands in Linux - DEV Community 👩‍💻👨‍💻 [How to Create Your Own Commands in Linux - DEV Community 👩‍💻👨‍💻](https://dev.to/ther4v3n/how-to-create-your-own-commands-in-linux-3kgb) #bash #[[Amministrazione Sistemi Linux]]
- **20:54** [[quick capture]]: sqlite package - crawshaw.io/sqlite - Go Packages [sqlite package - crawshaw.io/sqlite - Go Packages](https://pkg.go.dev/crawshaw.io/sqlite) #sqlite
- **21:07** [[quick capture]]: Retrieve User's Posts Write.as API Documentation [Retrieve User's Posts Write.as API Documentation](https://developers.write.as/docs/api/#retrieve-user-39-s-posts) #WriteFreely #rest
- **21:09** [[quick capture]]: writeas package - github.com/writeas/go-writeas/v2 - Go Packages [writeas package - github.com/writeas/go-writeas/v2 - Go Packages](https://pkg.go.dev/github.com/writeas/go-writeas/v2) #WriteFreely
-
-

View file

@ -431,5 +431,76 @@
- ```bash
cat server.log | awk '{print $9}' | sed -e 's/µs|//' | awk '{ total += $0; count++ } END { print total/count }'
```
-
- ## Lezione 9 - Docker e preparazione al test finale (4 ore)
- Assegnare codici univoci per modulo online
- ### Installare #docker su sistemi Ubuntu based
- #### Documentazione di riferimento
- https://docs.docker.com/engine/install/ubuntu/
- #### Prerequisiti
- ```bash
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```
- #### Docker engine
- ```bash
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
- #### Verifica dell'installazione
- ```bash
sudo docker run hello-world
```
- #### Eseguire docker come non-root
- ```bash
sudo groupadd docker
sudo usermod -aG docker $USER
docker run hello-world
```
- ### Preparare ambiente *playground*
- Clonare il repository con le immagini Docker
- ```bash
git clone https://git.andreafazzi.eu/andrea/acp.git
```
- Costruire e lanciare il container
- ```bash
docker compose up --build
```
- Eseguire accesso ssh al container (su un altro *pane* o *window* di `tmux`)
- ```bash
ssh -p 2222 test@localhost # password "test"
```
- Svolgere l'esercizio
- Seguire il seguente URL e leggere le istruzioni riportate sul modulo
- https://sondaggi.andreafazzi.eu/767197
- Rimuovi il file `autosave.tmp` dalla cartella `~/playground/service1`, e produci un checksum della lista dei file contenuti nella cartella dopo la rimozione.
- Comunicare attraverso modulo il risultato di
- ```bash
ls | sha1sum
```
- Esercizi proposti durante la lezione
- #### Esercizio 1
- Installa il comando `nano`
- Entra nella `playground`
- Crea una cartella di nome `docs` all'interno della cartella `service2`
- Crea un file `foo.md` e inserisci il seguente testo
- ```markdown
# Intestazione 1
Paragrafo.
```
- La risposta da inviare si ottiene facendo
- ```bash
cat foo.md | sha1sum
```
- #### Esercizio 2
- Muovi i file `bar` e `biz` dentro `playground/service3/etc`
- Copia il file `foo` dentro `playground/service3/etc/conf`
-

1
pages/sqlite.md Normal file
View file

@ -0,0 +1 @@
-