how tos
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-01-13 15:42:40 +01:00
parent 7e17a5df75
commit 0fb46dcb79
4 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# How to add a CA certificate in Debian
Copy CA file with extension `crt` into `/usr/local/share/ca-certificates/`.
Call `update-ca-certificates` as root.

View File

@ -0,0 +1,32 @@
# Colors in Minicom
To start `minicom` in color mode use
```
minicom -c on
```
Switch terminal emulation to ANSI.
Use escape sequences to actually change the color of text as described for instance here
https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html.
The base sequence is `\1b[Xm` where X is a number as described below.
To get the colors in bright style, use the sequence `\x1b[X;1m`.
Number | Color
----|----
0 | reset
1 | highlight
7 | inverse
30 | black
31 | red
32 | green
33 | yellow
34 | blue
35 | magenta
36 | cyan
37 | white

View File

@ -0,0 +1,61 @@
# iSCSI on Linux
## Preparation
Install `open-iscsi`, at least on Debian systems.
## Use an iSCSI target from Linux
In our setup a Synology NAS at 172.16.200.19 provides the targets.
First, run
```
iscsiadm -m discovery -t sendtargets -p 172.16.200.19
```
to discover all provided targets.
You get something like this
```
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7
```
Now, connect to the target using
```
iscsiadm -m node --targetname "iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7" \
--portal 172.16.200.19 --login
```
A new SCSI device will be created. Check the name of the device using ''dmesg''. You see something like this
```
[16924536.979916] scsi host13: iSCSI Initiator over TCP/IP
[16924537.010635] scsi 13:0:0:1: Direct-Access SYNOLOGY iSCSI Storage 4.0 PQ: 0 ANSI: 5
[16924537.011449] sd 13:0:0:1: Attached scsi generic sg10 type 0
[16924537.012597] sd 13:0:0:1: [sdj] 209715200 512-byte logical blocks: (107 GB/100 GiB)
[16924537.012827] sd 13:0:0:1: [sdj] Write Protect is off
[16924537.012828] sd 13:0:0:1: [sdj] Mode Sense: 43 00 10 08
[16924537.013111] sd 13:0:0:1: [sdj] Write cache: enabled, read cache: enabled, supports DPO and FUA
[16924537.013361] sd 13:0:0:1: [sdj] Optimal transfer size 16384 logical blocks > dev_max (8192 logical blocks)
[16924537.018630] sd 13:0:0:1: [sdj] Attached SCSI disk
```
Now use `fdisk`, `mkfs` and if you like `blkid` on the new device and put it into the `/etc/fstab`.
===== Authenticated target =====
```
iscsiadm --mode node --targetname "iqn.2007-01.org.debian.foobar:CDs" -p 192.168.0.1:3260 --op=update --name node.session.auth.authmethod --value=CHAP
iscsiadm --mode node --targetname "iqn.2007-01.org.debian.foobar:CDs" -p 192.168.0.1:3260 --op=update --name node.session.auth.username --value=$Id
iscsiadm --mode node --targetname "iqn.2007-01.org.debian.foobar:CDs" -p 192.168.0.1:3260 --op=update --name node.session.auth.password --value=$MDP
iscsiadm --mode node --targetname "iqn.2007-01.org.debian.foobar:CDs" -p 192.168.0.1:3260 --login
```

View File

@ -0,0 +1,17 @@
# Execute occ in Nextcloud pod
First, look up the name of the pod using
```
kubectl get pods -n nextcloud
```
Then, get into the pod using
```
kubectl exec --stdin --tty NAME_OF_THE_POD -c nextcloud -n nextcloud -- sh
```
Finally, within the pod
```
su -s /bin/sh www-data -c "php occ --help"
```