change ``bash headers to ``sh

This commit is contained in:
2025-08-22 15:59:04 +02:00
parent 3e049e1687
commit 8eea348112
80 changed files with 773 additions and 555 deletions

View File

@@ -5,7 +5,7 @@ tags: [ "data", "git" ]
Check out the sample hooks:
```bash
```sh
cd $GIT_REPO
ls .git/hooks
head .git/hooks/pre-commit.sample
@@ -13,7 +13,7 @@ head .git/hooks/pre-commit.sample
Add a hook to check the shell scripts in `$GIT_REPO` before making a commit:
```bash
```sh
echo '#!/bin/sh
shellcheck *.sh' > .git/hooks/commit-msg
chmod u+x .git/hooks/commit-msg

View File

@@ -10,7 +10,7 @@ The first should be its own repository, but should also retain its own history.
First, we extract its history as an independent item, and make that into a seprate branch.
```bash
```sh
git subtree split --prefix=sub-1 -b sub
```
@@ -18,7 +18,7 @@ If you want something a few directories deep, you can use `--prefix=sub-1/dir-2/
Then go and create a new git somewhere else:
```bash
```sh
cd ..;mkdir sub-1;cd sub-1;git init --bare
```
@@ -28,7 +28,7 @@ git push ../subtest sub:master
Finally, you can clone this repo from your original.
```bash
```sh
git clone ../subtest
```

View File

@@ -6,7 +6,7 @@ tags: [ "data", "GPG" ]
Generate keys:
```bash
```sh
gpg --full-generate-key
```
@@ -14,7 +14,7 @@ Follow the guide.
# Encrypting a file
```bash
```sh
gpg -r malinfreeborn@posteo.net -e file
```
@@ -25,7 +25,7 @@ Check you have an encrypted version of your file.
# Changing Expiration Dates
```bash
```sh
gpg --list-keys
# or...
gpg -k
@@ -37,13 +37,13 @@ gpg -k
Make a password with a password (cypher encryption).
```bash
```sh
gpg -c --output passwords.txt
```
or
```bash
```sh
gpg -c > passwords.txt
```
@@ -53,7 +53,7 @@ Write message then stop with Ctrl+d.
Get the message back out the file with:
```bash
```sh
gpg -d passwords.txt
```
@@ -61,13 +61,13 @@ gpg -d passwords.txt
Search for a key at any key store:
```bash
```sh
gpg --search-keys nestorv
```
Once you've made a decision about someone:
```bash
```sh
gpg --list-keys
```
@@ -86,13 +86,13 @@ This is a fingerprint.
You can now decide the trust level (this stays on your computer).
```bash
```sh
gpg --edit-key CD30421FD825696BD95F1FF644C62C57B790D3CF
```
Once you're in the interface, type `trust`.
```bash
```sh
gpg --sign-key alice@posteo.net
```
@@ -104,7 +104,7 @@ This system relies on a ring of people swapping key information.
Send those trusted keys up to a server, so people can see you have verified them:
```bash
```sh
gpg --send-keys 024C6B1C84449BD1CB4DF7A152295D2377F4D70F
```
@@ -125,7 +125,7 @@ keyserver hkps://keys.mailvelope.com
Refreshing keys will tell you if some key you have contains a signature from someone you already trust, or if someone has published a revocation certificate (meaning their key should not be trusted any more).
```bash
```sh
gpg --refresh-keys
```
@@ -135,12 +135,12 @@ You can use the [crontab](../../basics/cron.md) to refresh keys, but this will m
Your public key:
```bash
```sh
gpg --output me.gpg --armor --export
```
Alternatively:
```bash
```sh
gpg --export -a person@email.tld > my_key.pub
```

View File

@@ -4,11 +4,11 @@ tags: [ "RSS" ]
---
Create the configuration directory before you start, and add at least 1 URL.
```bash
```sh
mkdir ~/.config/newsboat
```
```bash
```sh
echo 'https://voidlinux.org/atom.xml foss tech' >> ~/.config/newsboat/urls
```
@@ -28,7 +28,7 @@ You can input a Youtube channel by adding this, with the channel's ID at the end
To get the channel ID without hunting:
```bash
```sh
curl *'https://www.youtube.com/@1minfilms'* | grep -oE 'browseId":"U\w+"' | tail | cut -d'"' -f3
```

View File

@@ -13,11 +13,11 @@ Arch: tesseract-data-eng and poppler-utils
## Script
```bash
```sh
pdftoppm -png *file*.pdf test
```
```bash
```sh
for x in *png; do
tesseract -l eng "$x" - >> out.txt
done

View File

@@ -23,6 +23,6 @@ Make a text file called 'pdfmark.txt'.
Then run:
```bash
```sh
gs -o output.pdf -sDEVICE=pdfwrite "$FILE".pdf pdfmark.txt
```

View File

@@ -16,7 +16,7 @@ The standard `radicale` package should come with a nice `systemd` service file.
If the service comes already-started, stop it immediately:
```bash
```sh
sudo systemctl stop radicale
```
@@ -40,7 +40,7 @@ You might get it in the `apache` package or similar.
`htpasswd` allows you to generate passwords for users, and place them in `/etc/radicale/users`.
```bash
```sh
PASS="$(xkcdpass)"
htpasswd -nb $USER "$PASS" | sudo tee -a /etc/radicale/users
echo "Your username is $USER"
@@ -93,7 +93,7 @@ sudo ln -s /etc/nginx/sites-available/radicale /etc/nginx/sites-enables/
Finally, replace the example `DOMAIN` with your actual domain name.
```bash
```sh
DOMAIN=whatever.com
sudo sed -i "s/DOMAIN/$DOMAIN/g" /etc/nginx/sites-available/radicale
```
@@ -102,18 +102,18 @@ sudo sed -i "s/DOMAIN/$DOMAIN/g" /etc/nginx/sites-available/radicale
Check nginx is happy:
```bash
```sh
sudo nginx -t
```
You will almost certainly need a new SSL certificate for the site:
```bash
```sh
sudo certbod -d cal.$DOMAIN
```
Start or restart both services:
```bash
```sh
sudo systemctl start radicale
sudo systemctl restart nginx
```

View File

@@ -7,7 +7,7 @@ tags: [ "data", "database", "recfiles" ]
Make a database for your boardgames, specifying only one field and value:
```bash
```sh
database=games.rec
n=Name
g=Vojvodina
@@ -18,21 +18,21 @@ recsel $database
Insert a few more, with the estimated playtime:
```bash
```sh
recins -f Name -v Saboter -f Playtime -v 30 $database
recins -f Name -v Chess -f Playtime -v 30 $database
```
View all games, or select one by number:
```bash
```sh
recsel $database
recsel -n 0 $database
```
Each game should note whether or not you have played it yet, so you can add that field and set the default to `yes`.
```bash
```sh
f=played
v=yes
recset -f $f -a $v $database
@@ -40,7 +40,7 @@ recset -f $f -a $v $database
...but the field is wrong, it should have a capital letter:
```bash
```sh
new_field=Played
recset -f $f --rename $new_field
```
@@ -49,19 +49,19 @@ recset -f $f --rename $new_field
Check how many records the database has:
```bash
```sh
recinf $database
```
Look at just the games you've never played:
```bash
```sh
recsel --expression="Played = 'no'" $database
```
Print how many, then just print the names:
```bash
```sh
recsel -e "Played = 'no'" --count $database
recsel -e "Played = 'no'" --print=Name $database
```
@@ -70,7 +70,7 @@ recsel -e "Played = 'no'" --print=Name $database
To change a game's `Played` field from `no` to `yes`, use `recset` to specify the number, and change that field.
```bash
```sh
num=0
f=Played
value=yes
@@ -80,14 +80,14 @@ recset --number=$num -f $f --set=$value $database
Find all games with a playtime of `30`, and set the field `Max_Players` to `4`.
```bash
```sh
recset -e "Playtime = 40" -f Max_Players --set 50 games.rec
```
This doesn't work, because that field does not exist.
You can `--set-add` the field, to add it wherever it does not exist.
```bash
```sh
recset -e "Playtime = 40" -f Max_Players --set-add 50 games.rec
```
@@ -95,14 +95,14 @@ recset -e "Playtime = 40" -f Max_Players --set-add 50 games.rec
Remove `Played` record from first game:
```bash
```sh
num=0
recset --number=$num -f Played --delete $database
```
You can comment the line instead of deleting it:
```bash
```sh
num=1
recset --number=$num -f Played --delete $database
recsel $database
@@ -111,7 +111,7 @@ cat $database
Delete an entire record:
```bash
```sh
num=2
recdel --number=$num $database
```

View File

@@ -15,7 +15,7 @@ Change this with `:set autowrap`.
Make `sc-im` always autowrap:
```bash
```sh
mkdir .config/sc-im/bash
echo 'set autowrap' >> .config/sc-im/scimrc
```

View File

@@ -33,7 +33,7 @@ By default, the `/mnt` directory is 'pruned' from the database.
So if you want to search `/mnt` for videos, remove the word `/mnt` from the configuration file.
```bash
```sh
su root
cat /etc/updatedb.conf
sed -i 's#/mnt/##' /etc/updatedb.conf

View File

@@ -7,7 +7,7 @@ You can share parts of a secret with multiple people, so only some of them need
Install `ssss`, then decide on the total number of secrets (`N`), and the threshold of people who must share their shard of the secret in order to reveal the secret.
```bash
```sh
N=5
T=3
FILE=secret.txt
@@ -17,7 +17,7 @@ Each shard is a line inside secret.txt.
Check it's working:
```bash
```sh
head -n $T $FILE | ssss-combine -t $T
tail -n $T $FILE | ssss-combine -t $T
```

View File

@@ -30,7 +30,7 @@ http:
Restart the `soft-serve` service, then check it's working by cloning from localhost:
```bash
```sh
git clone http://localhost:23232/${some_repo}.git
```

View File

@@ -5,7 +5,7 @@ tags: [ "data" ]
Work with a database:
```bash
```sh
sqlite3 "$FILE".sqlite3
```
Compress the database:

View File

@@ -16,7 +16,7 @@ All listed providers run proprietary software and actively support genocide.
To ignore the synchronization, tell the configuration file to use a local synchronization file.
```
```sh
task config sync.local.server_dir
task config data.location ~/.local/state/
```

View File

@@ -4,7 +4,7 @@ tags: [ "browsers" ]
---
Open a search tab:
```bash
```sh
w3m ddg.gg
```