Merge branch 'dev' into vhs

This commit is contained in:
2025-03-18 18:54:29 +01:00
12 changed files with 98 additions and 51 deletions

View File

@@ -8,22 +8,21 @@ tags: [ "tar", "backups", ".tgz", "tar.gz" ]
Combine many files and directories into a single t-archive file.
```bash
```sh
tar cf "$ARCHIVE".tar $DIR
```
You can remember this with the mnemonic '*C*reate *F*ile'.
Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`.
Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`).
It's often better to tell tar which path to start from using the `-C` flag.
```bash
```sh
tar cf "$ARCHIVE".tar -C /etc/ nginx
```
Check the contents of your archive with:
```bash
```sh
tar tf "$ARCHIVE".tar
```
@@ -31,7 +30,7 @@ If you want to store 'everything in a directory', then using `*` will not work,
Instead, you can store the target in a variable:
```bash
```sh
files=$(ls /etc/nginx)
tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
```
@@ -40,7 +39,9 @@ tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
Extract the tar archive with
> tar xf "$ARCHIVE".tar
```sh
tar xf "$ARCHIVE".tar
```
You can remember this with the mnemonic 'e*X*tract *F*ile'.
@@ -48,7 +49,7 @@ You can remember this with the mnemonic 'e*X*tract *F*ile'.
Create a zip-compressed archive with the `z` flag.
```bash
```sh
tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file
```
@@ -60,18 +61,16 @@ You can use any file ending you want, but sane people like to use '.tgz' or '.ta
Make archive:
```bash
PASSWORD=my_password
```
```bash
7za a -tzip -p$PASSWORD -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
```sh
7za a -tzip -p "$PASSWORD" -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
```
Note that people can still see every filename in your archive, and can change those files.
They just can't read the contents.
Unzip:
```bash
```sh
7za x archive.zip
```

View File

@@ -5,7 +5,7 @@ tags: [ "backups", "synch" ]
Install unison on both machines, and make sure both have the same version of unison, with the same version of the ocaml compiler (the smallest difference will cause problems).
```bash
```sh
unison -version
```
@@ -13,14 +13,14 @@ Create the `~/.unison` directory on both machines.
Make a job called `backup`:
```bash
```sh
JOB=backup
```
Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username.
```bash
```sh
echo "
auto = true
root=$HOME
@@ -42,7 +42,7 @@ The last command means it will ignore any file with a name ending in `.flac`.
The first command means this will run but also confirm which files will be deleted, and which will be transferred, us `batch = true` instead.
Or you can deleted that line in the `.prf` file and run it with a flag:
```bash
```sh
unison -batch *backup*.prf
```

View File

@@ -3,6 +3,24 @@ title: "Base 16"
tags: [ "data" ]
---
```bash
Base 16 numbers often use `0x` at the start, so '10' just means '10', but `0x10` means '10 in base 16' which means '16'.
For small numbers, use `printf`.
```sh
printf "%x" $NUMBER
```
For any number, use `bc`.
```sh
fortune | md5sum | cut -d' ' -f1 | tr [:lower:] [:upper:] | bc
```
- Inputting base 16 uses `ibase=16`.
- Outputting base 10 uses `ibase=10`
```sh
echo 'ibase=16;' $(echo cbb478ac825f0dce7671254be035d0bc | tr [:lower:] [:upper:]) | bc
```

View File

@@ -1,7 +1,7 @@
---
title: "radicale and nginx"
tags: [ "data", "calendar" ]
required: [ "nginx", "certbot" ]
requires: [ "nginx", "certbot" ]
---
Check before you start:

View File

@@ -1,7 +1,7 @@
---
title: "sc-im"
tags: [ "TUI", "data", "spreadsheet", ".csv" ]
required: [ "vim basics" ]
requires: [ "vim basics" ]
---
- [Sample file](sc-im/sample.sc)

View File

@@ -1,7 +1,7 @@
---
title: "Soft Serve Maintenance"
tags: [ "data", "git server", "maintenance" ]
required: [ "git", "nginx" ]
requires: [ "git", "nginx" ]
---
Over time git repositories become bloated with old data, but never get cleaned.

View File

@@ -1,7 +1,7 @@
---
title: "Soft Serve through https"
tags: [ "data", "git server", "lfs" ]
required: [ "git", "nginx" ]
requires: [ "git", "nginx" ]
---
## `http` Setup

View File

@@ -1,7 +1,7 @@
---
title: "Soft-Serve"
tags: [ "data", "git server", "lfs", "TUI" ]
required: [ "git", "nginx" ]
requires: [ "git", "nginx" ]
---
- [Soft-Serve with https](soft-serve/soft_https.md)