Compare commits

..

12 Commits

Author SHA1 Message Date
9b89c20c8a newsraft feeds change 2026-01-05 18:28:57 +01:00
5398d3fb29 fix yay install 2025-12-17 00:11:54 +01:00
4d926e8213 automatic nethack 2025-12-17 00:11:39 +01:00
5cb141942e add otp with pass 2025-12-04 17:48:15 +01:00
42e46d0834 add mpd with pipewire 2025-12-04 17:47:50 +01:00
474fbb84c2 note searching void packages 2025-11-26 20:25:07 +01:00
ebbc9ae1c8 nginx logs with recfiles 2025-11-16 01:34:35 +01:00
71ef311c70 note clearing search highlights 2025-11-14 02:28:58 +01:00
dc00b6ceea fix vim search 2025-11-06 03:36:19 +01:00
f3c7f931c4 vim linewrap 2025-11-06 03:36:18 +01:00
7f9de785df record terminal with script 2025-10-31 17:20:37 +01:00
723024db0b ansible notes 2025-10-21 23:54:30 +02:00
20 changed files with 91 additions and 161 deletions

View File

@@ -7,12 +7,12 @@ FZF != command -v sk || command -v fzy || command -v fzf || \
ifeq "$(FZF)" "/usr/bin/fzy"
FZF += -i
else
FZF += --print-query | tail -1
FZF += --print-query | cat
endif
spill_contents = sed -e '1,/---/d'
help: ## Print the help message
help: .git/info/exclude ## 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
@@ -32,11 +32,9 @@ $(foreach dir, $(categories), \
$(eval .dbs/$(dir).rec: $(wildcard $(dir)/*)) \
)
%/:
.dbs/:
mkdir $@
include cmd.mk
$(databases): .dbs/%.rec: %/ | .dbs/
$(info making $(@F))
for entry in $(shell find $< -type f -name "*.md") ; do \
@@ -75,28 +73,17 @@ default += .git/info/exclude
.PHONY: database
database: $(default) ## Make a recfiles database
%.md:
printf '---\n'
printf 'title: "%s"\n' "$(title)"
printf 'tags: [ "%s" ]\n' "$(shell echo $(basename $(dir $@)) | sed 's/\/$$//' )" | tr '[:upper:]' '[:lower:]' | sed 's#\/#", "#g'
printf 'requires: [ ]\n'
printf '---\n'
ifdef title
col = blue
path = $(shell find $(categories) -type d | sort | uniq | $(FZF))
filename = $(shell echo "$(title)" | tr ' ' '_' | tr -cd '[:alnum:]_')
endif
title = $(shell read -r -p "Title: " line && echo "$${line}" | tr -d '"' | sed 's/\b\(.\)/\U\1/g')
.PHONY: .entry
.entry: $(path)/$(filename).md
.PHONY: article
article: ## Write an article
make -e title="$(title)" .entry
@path=$$(find $(categories) -type d | sort | uniq | $(FZF)) ;\
read -p "Title: " title ;\
filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
mkdir -p $$path ;\
printf '%s\n' '---' >> $$path/$$filename.md ;\
printf 'title: "%s"\n' "$$title" >> $$path/$$filename.md ;\
printf 'tags: [ "%s" ]\n' "$$path" | tr '[:upper:]' '[:lower:]' | sed 's#\/#", "#g' >> $$path/$$filename.md ;\
printf '%s\n\n' '---' >> $$path/$$filename.md ;\
$(EDITOR) +5 "$$path/$$filename.md"
.dbs/map.fmt:| .dbs/
printf '%s\n' '[ {{requires[0]}} ] --> [ {{title}} ] {border-style: dashed;}' > $@

36
basics/column.md Normal file
View File

@@ -0,0 +1,36 @@
---
title: "column"
tags: [ "basics", "format", "json" ]
---
Put output into column.
```sh
du -h /etc/* | column
```
Reformat file with an explicit separator (`-s`):
```sh
column -ts: /etc/passwd
```
Give columns names (`-N`), so you can hide some (`-H`):
```sh
column -ts: -N User,PW,UID,GID,Description,Home,shell -H PW,GID /etc/passwd
```
Reorder with `-O` (unspecified items remain):
```sh
column -ts: -N User,PW,UID,GID,Description,Home,shell -H PW,GID -O User,Description,shell /etc/passwd
```
Output to json format with `-J`:
```sh
column -J -ts: -H PW,GID,shell -N User,PW,UID,GID,Description,Home,shell /etc/passwd
```

25
cmd.mk
View File

@@ -1,25 +0,0 @@
cmds != recsel command.rec -t command -G bin -U -CP bin
lists = $(patsubst %,lists/%.md, $(cmds))
default += $(lists)
get_title = printf 'title: "%s"\n' '${1}'
get_tags = recsel -t $(basename $<) $< -G bin \
-e 'bin = "$(1)"' -U -CP tag | \
sed 's/.*/"&",/g' | \
tr '\n' ' ' | \
sed 's/.*/tags: [ &]/'
list_commands = recsel -t $(basename $<) $< -e 'bin = "$(1)"' | \
recfmt -f lists.fmt
lists/%.md: command.rec | lists/
@printf '%s\n' '---' > $@
@$(call get_title,$(basename $(notdir $@))) >> $@
@$(call get_tags,$(basename $(notdir $@))) >> $@
@printf '\n%s\n' '---' >> $@
@$(call list_commands,$(basename $(notdir $@))) >> $@
.PHONY: cmd
cmd: $(lists) ## Bit lists of commands

View File

@@ -1,51 +0,0 @@
%rec: command
%doc: shell command examples
%type: aim line
%allowed: aim cmd bin tag
aim: Put output into column
cmd: du -h /etc/* | column
bin: column
tag: format
aim: Reformat file with an explicit separator (`-s`)
cmd: column -ts: /etc/passwd
bin: column
tag: format
aim: Give columns names (`-N`), so you can hide some (`-H`)
cmd: column -ts: -N User,PW,UID,GID,Description,Home,shell -H PW,GID /etc/passwd
bin: column
tag: format
aim: Reorder with `-O` (unspecified items remain)
cmd: column -ts: -N User,PW,UID,GID,Description,Home,shell -H PW,GID -O User,Description,shell /etc/passwd
bin: column
tag: format
aim: Output to json format with `-J`
cmd: column -J -ts: -H PW,GID,shell -N User,PW,UID,GID,Description,Home,shell /etc/passwd
bin: column
tag: format
tag: json
aim: Make a QR Code image:
cmd: qrencode 'https://play.google.com/store/apps/details?id=org.briarproject.briar.android' -o "$FILE".png
bin: qrencode
tag: qr
aim: Make a QR Coded message in the terminal:
cmd: qrencode -t ansi "Hello World"
bin: qrencode
tag: qr
aim: Read a QR Code image:
cmd: zbarimg $FILE
bin: qrencode
tag: qr
aim: Show wifi QR code (only with Network Manager):
cmd: nmcli device wifi show-password
bin: qrencode
tag: qr
tag: wifi

View File

@@ -129,7 +129,7 @@ Refreshing keys will tell you if some key you have contains a signature from som
gpg --refresh-keys
```
You can use the [crontab](../../system/cron.md) to refresh keys, but this will mostly fail, since keyservers often don't hold the right data.
You can use the [crontab](../../basics/cron.md) to refresh keys, but this will mostly fail, since keyservers often don't hold the right data.
# Export

View File

@@ -9,27 +9,3 @@ The `vim-gnupg` plugin lets vim edit gpg-encrypted files as if they were unencry
It's probably in your package manager.
If not, you'll need to endure the faff of following the [instructions](http://www.vim.org/scripts/script.php?script_id=3645).
## Prompt for password in terminal
Check your current gpg-agent configuration:
```sh
gpgconf --list-options gpg-agent
```
Create file, if it doesnt exit `~/.gnupg/gpg-agent.conf`:
```
# Force terminal prompts for passwords
pinentry-mode loopback
# Optional: specify which pinentry program to use
pinentry-program /usr/bin/pinentry-tty
```
Then restart gpg-agent:
```sh
gpg-connect-agent reloadagent /bye
```

View File

@@ -28,7 +28,7 @@ To add a basic password, e.g. for `$WEBSITE`:
pass $WEBSITE
```
To insert a multi-line password, e.g. with a login name:
To insert a multiline password, e.g. with a login name:
```sh
pass add -m $WEBSITE

View File

@@ -43,8 +43,8 @@ recset -f "$new_field" --delete $database
```
- [Extended example](recfiles/extended.md)
- [Playing with board games data](recfiles/board_games.md)
- [Playing with IP addresses](recfiles/ip_asn.md)
- [Playing with board games data](recfiles/Board_Games.md)
- [Playing with IP addresses](recfiles/IP_ASN.md)
- [Manage LaTeX Bibliographies](recfiles/bibliography.md)
- [Fixes](recfiles/recfixes.md)

View File

@@ -36,7 +36,7 @@ git clone http://localhost:23232/${some_repo}.git
### `https` Setup
Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard certificates with [nginx](../../networking/website/nginx.md).
Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard certificates with [nginx](../networking/website/nginx.md).
(replace `${DOMAIN_NAME}` with your domain's name).

View File

@@ -129,7 +129,7 @@ vi /etc/locale.gen
locale-gen
```
Make your keyboard changes permanent with:
Make your keyboard changes permenent with:
```sh
vi /etc/vconsole.conf

View File

@@ -1,8 +0,0 @@
---
title: "Laptops with Void Linux"
tags: [ "void", "laptop" ]
---
Install and enable `tlp`.
Decide how to handle events like the lid closing in `/etc/acpi/handler.sh`.

View File

@@ -1,6 +0,0 @@
{{aim}}
```{{shell}}
{{cmd}}
```

View File

@@ -5,17 +5,9 @@ tags: [ "networking" ]
# Get a Hostname
[onion hidden service guide](https://community.torproject.org/onion-services/setup/)
```sh
sudo vim /etc/tor/torrc
```
Uncomment the lines about `/var/lib/tor/hidden_services`, including port 22 (or whatever); restart tor, then go to that directory, and cat the hostname.
# SSH over tor
install package `torsocks`, and add it before `ssh` command, for easier use, add it to `.ssh/config`
`torsocks ssh user@{someonionhash}.onion`

View File

@@ -48,7 +48,7 @@ echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/wg.conf
```
```sh
systemctl enable --now wg-quick@wg0
systemctl enable --now wg-quiqck@wg0
```
```sh
@@ -67,7 +67,7 @@ Be root.
Install `wireguard-tools` on the client.
Copy the client server public key to the server (or just fill in the variables).
Copy the client private key and server public key to the server (or just fill in the variables).
```sh

View File

@@ -1,5 +1,5 @@
---
title: "mpd with pipewire"
title: "mpd"
tags: [ "sound", "pipewire" ]
requirements: [ "pipewire" ]
---

View File

@@ -178,6 +178,6 @@ In this case, the makefile can see that `backup` depends on the current backup f
# The Rest
- [File patterns](makefiles/patterns.md)
- [Makefile graphs](makefiles/graph-easy.md)
- [In-build help](makefiles/help.md)
- [File patterns](Makefiles/patterns.md)
- [Makefile graphs](Makefiles/graph-easy.md)
- [In-build help](Makefiles/help.md)

View File

@@ -3,7 +3,7 @@ title: "Makefile Patterns"
tags: [ "system", "make" ]
---
Using the [basic example](../makefiles.md), you can make a complete backup of all backup files.
Using the [basic example](../Makefile.md), you can make a complete backup of all backup files.
This file will depend upon everything inside the `$(storage_directory)`.
Unlike `bash`, you can't just say `storage_directory/*`: the pattern must be stated as a 'wildcard'.

28
vision/qr_codes.md Normal file
View File

@@ -0,0 +1,28 @@
---
title: "QR Codes"
tags: [ "qrencode", "zbar" ]
---
Make a QR Code image:
```sh
qrencode 'https://play.google.com/store/apps/details?id=org.briarproject.briar.android' -o "$FILE".png
```
Make a QR Coded message in the terminal:
```sh
qrencode -t ansi "Hello World"
```
Read a QR Code image:
```sh
zbarimg $FILE
```
Show wifi QR code (only with Network Manager):
```sh
nmcli device wifi show-password
```

View File

@@ -20,5 +20,6 @@ Keybind to exit this mode is `Ctrl+q`
- [Learning Vim](vim/vi.md)
- [Navigation](vim/navigate.md)
- [Completion](vim/completion.md)
- [Search](vim/search.md)
- [Window Splits](vim/windows.md)
- [Use vim bindings in bash](vim/vim_in_bash.md)

View File

@@ -1,5 +1,5 @@
---
title: "vim linewrap"
title: "vim windows"
tags: [ "vim", "format", "linewrap" ]
requires: [ "vim basics" ]
---