Compare commits
7 Commits
28c6a99b0e
...
219ea021e1
Author | SHA1 | Date | |
---|---|---|---|
219ea021e1 | |||
ed4b54cf7e | |||
4e89c5ab9b | |||
1732c62734 | |||
fb157895fb | |||
b3258d9f5f | |||
d793bca3ea |
29
Makefile
29
Makefile
@ -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
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "radicale and nginx"
|
||||
tags: [ "data", "calendar" ]
|
||||
required: [ "nginx", "certbot" ]
|
||||
---
|
||||
|
||||
Check before you start:
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "sc-im"
|
||||
tags: [ "TUI", "data", "spreadsheet", ".csv" ]
|
||||
required: [ "vim basics" ]
|
||||
---
|
||||
|
||||
- [Sample file](sc-im/sample.sc)
|
||||
|
33
data/search_video_audio.md
Normal file
33
data/search_video_audio.md
Normal 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"
|
||||
```
|
24
data/soft-serve/maintenance.md
Normal file
24
data/soft-serve/maintenance.md
Normal 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'.
|
||||
```
|
@ -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
8
data/soft.md
Normal 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)
|
@ -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)
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user