Compare commits

...

7 Commits

Author SHA1 Message Date
219ea021e1
Merge branch 'dev' into vhs 2025-03-04 13:30:14 +01:00
ed4b54cf7e
tag 2025-03-03 19:44:41 +01:00
4e89c5ab9b
more grammarlier 2025-03-02 22:04:04 +01:00
1732c62734
add soft serve maintenance 2025-03-02 18:15:59 +01:00
fb157895fb
add requirements 2025-03-02 18:11:52 +01:00
b3258d9f5f
refactor db creation 2025-03-02 10:14:20 +01:00
d793bca3ea
search video audio 2025-02-28 17:10:25 +01:00
8 changed files with 86 additions and 18 deletions

View File

@ -24,35 +24,34 @@ $(foreach dir, $(categories), \
$(eval .dbs/$(dir).rec: $(wildcard $(dir)/*)) \
)
$(databases): .dbs/%.rec: %/
.dbs/:
mkdir $@
$(databases): .dbs/%.rec: %/ | .dbs/
$(info making $(@F))
@mkdir -p $(@D)
for entry in $(shell find $< -type f -name "*.md") ; do \
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$entry" |\
sed -e 's/\[ //' -e 's/ \]//' |\
tr -d '"' ;\
printf "wordcount: %s\n" "$$(wc -w < $$entry)" ;\
printf "file: %s\n\n" "$$entry" ;\
printf "file: %s\n" "$$entry" ;\
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$entry" |\
tr -d '[]' | tr -s ' ' |\
sed '/tags: /s/, /\ntag: /g ; s/tags:/tag:/ ; /requires/s/, /\nrequires: /g' ;\
printf "wordcount: %s\n\n" "$$(wc -w < $$entry)" ;\
done > $@
for entry in $(shell find $< -type f -name "*.md"); do \
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
recset $@ -e "file = '$${entry}'" -f content --set-add="$$($(spill_contents) $${entry})" ;\
done
# This two-variable read can only happen because of the quotes in the titles.
db.rec: $(databases)
printf '%s\n' '%rec: guide' > $@
printf '%s\n' '%key: title' >> $@
printf '%s\n' '%type: wordcount int' >> $@
printf '%s\n\n' '%sort: title' >> $@
recsel $^ >> $@
printf '%s\n\n' '%sort: wordcount' >> $@
cat $^ >> $@
recsel $@ -e "requires != ''" -CR title,requires |\
while read title requires; do \
IFS=', ' && for provider in $$requires; do \
for provider in "$$requires" ; do \
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
done ;\
done
$(info Created main database: $@)
sed -i 's/"//g' $@
recfix --sort $@
$(info Created main database: $@)
default += db.rec

View File

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

View File

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

View File

@ -0,0 +1,33 @@
---
title: "Search Video Audio"
tags: [ "data", "video" ]
---
Check subtitles available:
```sh
url='https://videos.domainepublic.net/videos/watch/d9567d5b-1add-477c-bce3-a58cef84c28c'
yt-dlp --list-subs "$url" | grep --max-count=1 '^en'
```
The original language often displays with `-orig`, e.g. `en-orig (Original)`.
```
Language Formats
ar vtt
az vtt
bg vtt
ca vtt
cs vtt
da vtt
de vtt
el vtt
en vtt
```
Search youtube.com for videos on a topic, and download subtitles:
```sh
url="$(ytfzf -I l "$search" )" && \
yt-dlp --write-subs --sub-format 'ass/srt/best/vtt' --sub-langs "en.*" --skip-download "$url"
```

View File

@ -0,0 +1,24 @@
---
title: "Soft Serve Maintenance"
tags: [ "data", "git server", "maintenance" ]
required: [ "git", "nginx" ]
---
Over time git repositories become bloated with old data, but never get cleaned.
I can't find an official way to clean up the crud, so I did this:
```sh
usermod -aG soft-serve $USER
# Log out and back in for this to take effect.
cd /var/lib/soft-serve/data/repos
sudo chmod -R g+w *
git config --global --add safe.directory '*'
du -sh *.git
for repo in *.git; do
git -C "$repo" gc
done
du -sh *.git
$EDITOR ~/.gitconfig
# You should remove having everything marked 'safe'.
```

View File

@ -1,6 +1,7 @@
---
title: "Soft Serve through https"
tags: [ "data", "git server", "lfs" ]
required: [ "git", "nginx" ]
---
## `http` Setup
@ -33,7 +34,7 @@ Restart the `soft-serve` service, then check it's working by cloning from localh
git clone http://localhost:23232/${some_repo}.git
```
## `https` Setup
### `https` Setup
Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard certificates with [nginx](../networking/website/nginx.md).
@ -67,3 +68,4 @@ Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard ce
}
```

8
data/soft.md Normal file
View File

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

View File

@ -8,13 +8,13 @@ Running `make help` will search for text which starts with `## ` and show what t
```make
.PHONY: help
help: ## Print the help message
help: ## Print the help message.
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
sort | \
column -s ':' -t
.PHONY: clean
clean: ## Remove generated files
clean: ## Remove generated files.
$(RM) $(defaults)
```