Compare commits
12 Commits
9d35d04990
...
9b89c20c8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
9b89c20c8a
|
|||
|
5398d3fb29
|
|||
|
4d926e8213
|
|||
|
5cb141942e
|
|||
|
42e46d0834
|
|||
|
474fbb84c2
|
|||
|
ebbc9ae1c8
|
|||
|
71ef311c70
|
|||
|
dc00b6ceea
|
|||
|
f3c7f931c4
|
|||
|
7f9de785df
|
|||
|
723024db0b
|
37
Makefile
37
Makefile
@@ -7,12 +7,12 @@ FZF != command -v sk || command -v fzy || command -v fzf || \
|
|||||||
ifeq "$(FZF)" "/usr/bin/fzy"
|
ifeq "$(FZF)" "/usr/bin/fzy"
|
||||||
FZF += -i
|
FZF += -i
|
||||||
else
|
else
|
||||||
FZF += --print-query | tail -1
|
FZF += --print-query | cat
|
||||||
endif
|
endif
|
||||||
|
|
||||||
spill_contents = sed -e '1,/---/d'
|
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) | \
|
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
||||||
sort | \
|
sort | \
|
||||||
column -s ':' -t
|
column -s ':' -t
|
||||||
@@ -32,11 +32,9 @@ $(foreach dir, $(categories), \
|
|||||||
$(eval .dbs/$(dir).rec: $(wildcard $(dir)/*)) \
|
$(eval .dbs/$(dir).rec: $(wildcard $(dir)/*)) \
|
||||||
)
|
)
|
||||||
|
|
||||||
%/:
|
.dbs/:
|
||||||
mkdir $@
|
mkdir $@
|
||||||
|
|
||||||
include cmd.mk
|
|
||||||
|
|
||||||
$(databases): .dbs/%.rec: %/ | .dbs/
|
$(databases): .dbs/%.rec: %/ | .dbs/
|
||||||
$(info making $(@F))
|
$(info making $(@F))
|
||||||
for entry in $(shell find $< -type f -name "*.md") ; do \
|
for entry in $(shell find $< -type f -name "*.md") ; do \
|
||||||
@@ -75,28 +73,17 @@ default += .git/info/exclude
|
|||||||
.PHONY: database
|
.PHONY: database
|
||||||
database: $(default) ## Make a recfiles 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
|
.PHONY: article
|
||||||
article: ## Write an 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/
|
.dbs/map.fmt:| .dbs/
|
||||||
printf '%s\n' '[ {{requires[0]}} ] --> [ {{title}} ] {border-style: dashed;}' > $@
|
printf '%s\n' '[ {{requires[0]}} ] --> [ {{title}} ] {border-style: dashed;}' > $@
|
||||||
|
|||||||
36
basics/column.md
Normal file
36
basics/column.md
Normal 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
25
cmd.mk
@@ -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
|
|
||||||
51
command.rec
51
command.rec
@@ -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
|
|
||||||
@@ -129,7 +129,7 @@ Refreshing keys will tell you if some key you have contains a signature from som
|
|||||||
gpg --refresh-keys
|
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
|
# Export
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
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).
|
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
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ To add a basic password, e.g. for `$WEBSITE`:
|
|||||||
pass $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
|
```sh
|
||||||
pass add -m $WEBSITE
|
pass add -m $WEBSITE
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ recset -f "$new_field" --delete $database
|
|||||||
```
|
```
|
||||||
|
|
||||||
- [Extended example](recfiles/extended.md)
|
- [Extended example](recfiles/extended.md)
|
||||||
- [Playing with board games data](recfiles/board_games.md)
|
- [Playing with board games data](recfiles/Board_Games.md)
|
||||||
- [Playing with IP addresses](recfiles/ip_asn.md)
|
- [Playing with IP addresses](recfiles/IP_ASN.md)
|
||||||
- [Manage LaTeX Bibliographies](recfiles/bibliography.md)
|
- [Manage LaTeX Bibliographies](recfiles/bibliography.md)
|
||||||
- [Fixes](recfiles/recfixes.md)
|
- [Fixes](recfiles/recfixes.md)
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ 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).
|
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).
|
(replace `${DOMAIN_NAME}` with your domain's name).
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ vi /etc/locale.gen
|
|||||||
locale-gen
|
locale-gen
|
||||||
```
|
```
|
||||||
|
|
||||||
Make your keyboard changes permanent with:
|
Make your keyboard changes permenent with:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
vi /etc/vconsole.conf
|
vi /etc/vconsole.conf
|
||||||
|
|||||||
@@ -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`.
|
|
||||||
@@ -5,17 +5,9 @@ tags: [ "networking" ]
|
|||||||
|
|
||||||
# Get a Hostname
|
# Get a Hostname
|
||||||
|
|
||||||
[onion hidden service guide](https://community.torproject.org/onion-services/setup/)
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo vim /etc/tor/torrc
|
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.
|
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`
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/wg.conf
|
|||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
systemctl enable --now wg-quick@wg0
|
systemctl enable --now wg-quiqck@wg0
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -67,7 +67,7 @@ Be root.
|
|||||||
|
|
||||||
Install `wireguard-tools` on the client.
|
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
|
```sh
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "mpd with pipewire"
|
title: "mpd"
|
||||||
tags: [ "sound", "pipewire" ]
|
tags: [ "sound", "pipewire" ]
|
||||||
requirements: [ "pipewire" ]
|
requirements: [ "pipewire" ]
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -178,6 +178,6 @@ In this case, the makefile can see that `backup` depends on the current backup f
|
|||||||
|
|
||||||
# The Rest
|
# The Rest
|
||||||
|
|
||||||
- [File patterns](makefiles/patterns.md)
|
- [File patterns](Makefiles/patterns.md)
|
||||||
- [Makefile graphs](makefiles/graph-easy.md)
|
- [Makefile graphs](Makefiles/graph-easy.md)
|
||||||
- [In-build help](makefiles/help.md)
|
- [In-build help](Makefiles/help.md)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: "Makefile Patterns"
|
|||||||
tags: [ "system", "make" ]
|
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)`.
|
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'.
|
Unlike `bash`, you can't just say `storage_directory/*`: the pattern must be stated as a 'wildcard'.
|
||||||
|
|
||||||
|
|||||||
28
vision/qr_codes.md
Normal file
28
vision/qr_codes.md
Normal 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
|
||||||
|
```
|
||||||
@@ -20,5 +20,6 @@ Keybind to exit this mode is `Ctrl+q`
|
|||||||
- [Learning Vim](vim/vi.md)
|
- [Learning Vim](vim/vi.md)
|
||||||
- [Navigation](vim/navigate.md)
|
- [Navigation](vim/navigate.md)
|
||||||
- [Completion](vim/completion.md)
|
- [Completion](vim/completion.md)
|
||||||
|
- [Search](vim/search.md)
|
||||||
- [Window Splits](vim/windows.md)
|
- [Window Splits](vim/windows.md)
|
||||||
- [Use vim bindings in bash](vim/vim_in_bash.md)
|
- [Use vim bindings in bash](vim/vim_in_bash.md)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "vim linewrap"
|
title: "vim windows"
|
||||||
tags: [ "vim", "format", "linewrap" ]
|
tags: [ "vim", "format", "linewrap" ]
|
||||||
requires: [ "vim basics" ]
|
requires: [ "vim basics" ]
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user