forked from andonome/lk
Compare commits
74 Commits
Author | SHA1 | Date | |
---|---|---|---|
45eae50c24 | |||
24bb7014f9 | |||
92145ac4b7 | |||
7292e0625e | |||
ffa4dbc51a | |||
641b8fb825 | |||
a6b8420c26 | |||
68d3a850c0 | |||
7e75763cee | |||
2d3961e0f5 | |||
72ad0786c8 | |||
b64d9de0c4 | |||
fa9c8edb1d | |||
741e988536 | |||
a72e2b117d | |||
cc574d5358 | |||
0d76eb0531 | |||
3bfeacd2d7 | |||
ed4b54cf7e | |||
4e89c5ab9b | |||
1732c62734 | |||
fb157895fb | |||
b3258d9f5f | |||
d793bca3ea | |||
14470b6f92 | |||
59fb0ada24 | |||
b68fa25cea | |||
5bd45973b4 | |||
66cdca5c85 | |||
aa32bfc249 | |||
fc88ab6200 | |||
eaec01076b | |||
0abc2818e8 | |||
4250f619c3 | |||
4d53f7c7d6 | |||
38feabb79f | |||
b4683a8681 | |||
d2934bf8a3 | |||
5afc414a52 | |||
d8b4a9d00b | |||
a15b565e09 | |||
6ccba626c8 | |||
415985d08c | |||
d6c3cd6387 | |||
4c3d51ff83 | |||
8f3da4558f | |||
137466a423 | |||
37df47cf3b | |||
b6280a8581 | |||
1ce84ebc53 | |||
341b6ed46f | |||
63ce7e8bbb | |||
2184e9d663 | |||
02381c71f2 | |||
ef7b424586 | |||
9621cfc26a | |||
d92631c795 | |||
b81fd55a87 | |||
e4be8a8523 | |||
eeade3cdfb | |||
481b34a472 | |||
fd850761f3 | |||
b7729e5712 | |||
bbd34e24ec | |||
808ef3bb71 | |||
53e86fb86e | |||
6b4a846284 | |||
2250275be5 | |||
7427b05b0b | |||
5e703a65c0 | |||
8b7912a68f | |||
5460f23f12 | |||
7afe6e33cd | |||
1d8ccbc5e8 |
81
Makefile
Normal file
81
Makefile
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
MAKEFLAGS += -j
|
||||||
|
MAKEFLAGS += -s
|
||||||
|
EDITOR ?= vi
|
||||||
|
FZF != command -v sk || command -v fzy || command -v fzf || \
|
||||||
|
{ echo install a fuzzy finder && exit 1 ;}
|
||||||
|
|
||||||
|
spill_contents = sed -e '1,/---/d'
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
articles != find * -type f -name "*.md"
|
||||||
|
|
||||||
|
dirs != ls -d */
|
||||||
|
categories = $(patsubst %/, %, $(dirs))
|
||||||
|
|
||||||
|
databases = $(patsubst %, .dbs/%.rec, $(categories))
|
||||||
|
|
||||||
|
default += $(databases)
|
||||||
|
|
||||||
|
$(foreach dir, $(categories), \
|
||||||
|
$(eval .dbs/$(dir).rec: $(wildcard $(dir)/*)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
.dbs/:
|
||||||
|
mkdir $@
|
||||||
|
$(databases): .dbs/%.rec: %/ | .dbs/
|
||||||
|
$(info making $(@F))
|
||||||
|
for entry in $(shell find $< -type f -name "*.md") ; do \
|
||||||
|
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 > $@
|
||||||
|
|
||||||
|
# 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: requires rec guide' >> $@
|
||||||
|
printf '%s\n' '%type: provides rec guide' >> $@
|
||||||
|
printf '%s\n' '%type: wordcount int' >> $@
|
||||||
|
printf '%s\n\n' '%sort: wordcount' >> $@
|
||||||
|
cat $^ >> $@
|
||||||
|
recsel $@ -e "requires != ''" -CR title,requires |\
|
||||||
|
while read title requires; do \
|
||||||
|
for provider in "$$requires" ; do \
|
||||||
|
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
||||||
|
done ;\
|
||||||
|
done
|
||||||
|
sed -i 's/"//g' $@
|
||||||
|
recfix --sort $@
|
||||||
|
$(info Created main database: $@)
|
||||||
|
|
||||||
|
default += db.rec
|
||||||
|
|
||||||
|
.git/info/exclude: $(default)
|
||||||
|
echo $^ | tr ' ' '\n' > $@
|
||||||
|
|
||||||
|
default += .git/info/exclude
|
||||||
|
|
||||||
|
.PHONY: database
|
||||||
|
database: $(default) ## Make a recfiles database
|
||||||
|
|
||||||
|
.PHONY: article
|
||||||
|
article: ## Write an article
|
||||||
|
@path=$$(find $(categories) -type d | sort | uniq | $(FZF)) ;\
|
||||||
|
read -p "Title: " title ;\
|
||||||
|
filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
|
||||||
|
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"
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean: ## Remove all generated files
|
||||||
|
$(RM) $(default)
|
120
README.md
120
README.md
@ -1,77 +1,99 @@
|
|||||||
---
|
---
|
||||||
title: "Knowledge Base"
|
title: "Linux Knowledge Base"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Linux Knowledgebase
|
The Linux Knowledge-Base provides quick-start guides for working with terminal programs.
|
||||||
|
|
||||||
This is a list of quickstart guides for Linux programs, designed to get the user up and running as fast as possible.
|
If you like this style of short articles with a miniature database, then join me in my quest to remove the nausea of poorly-written documentation.
|
||||||
|
|
||||||
|
# Setup
|
||||||
|
|
||||||
|
Install `make`, `recutils`, and any fuzzy-finder (i.e. `sk`, `fzy`, or `fzf`).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Set up the database and try a few queries:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make
|
||||||
|
make database
|
||||||
|
|
||||||
|
recsel db.rec -m 3
|
||||||
|
recsel db.rec -q database
|
||||||
|
recsel db.rec -e "title = 'ssh'"
|
||||||
|
recsel db.rec -e "title ~ 'ssh'"
|
||||||
|
recsel db.rec -e "title ~ 'bash'" -R title,wordcount
|
||||||
|
|
||||||
|
recsel db.rec -t guide -j provides -G title \
|
||||||
|
-e "title = 'ssh'" \
|
||||||
|
-p 'sum(provides_wordcount)'
|
||||||
|
```
|
||||||
|
|
||||||
# Style
|
# Style
|
||||||
|
|
||||||
## Praxis Only
|
## No History, No Context
|
||||||
|
|
||||||
We leave theory alone as much as possible.
|
- Nobody cares about how the project started.
|
||||||
The documentation should be of the form 'if you want *X*, type *Y*'.
|
- Nobody wants to read what `ffmpeg` is, because anyone who wants to use it already knows what it is.
|
||||||
|
|
||||||
We don't need to explain what a program does - anyone looking up 'how to X', already knows what they want to do.
|
## State Knowledge Dependencies
|
||||||
We don't even need to explain which program to use - if someone wants to combine an mp4 and webm video into a single video file, they only care about that result, not about learning `ffmpeg`.
|
|
||||||
|
|
||||||
Any interest in these tools only comes after we can use them.
|
Articles should state what you need to understand in order to read them *at the start*.
|
||||||
|
They should not assume the reader knows much beyond common terminal commands, and should not provide a link to some other resource half-way through an article.
|
||||||
|
|
||||||
## Chronological
|
People should be able to read an article from the beginning, then keep going until the end, and then stop.
|
||||||
|
Articles should not take a detour through a chain of other articles of unknown size.
|
||||||
|
|
||||||
Entries should read like scripts - everything in the right order, with small notes on what this does.
|
## Be Opinionated
|
||||||
|
|
||||||
The chronology should never branch.
|
- Guides should not ask the reader to select options half-way through.
|
||||||
If `gitea` can use three different types of database, the documentation should simply pick one and continue instructions from there.
|
- Options for different filesystems, databases, et c., should be written as separate guides.
|
||||||
Repetition works better than a reference - if a database requires three commands to set up, it's better to repeat those three commands for every program that requires a database than to just link to another file which discusses databases.
|
|
||||||
|
|
||||||
---
|
## Repetition Beats Reference
|
||||||
|
|
||||||
### Closing
|
If a database requires three commands to set up, it's better to repeat those three commands for every program that requires a database than to just link to another file which discusses databases.
|
||||||
|
|
||||||
Introductory documents should show anything required to cleanly uninstall a program, without leaving bulky configuration files behind.
|
## Show Arguments as Variables
|
||||||
|
|
||||||
## Three Input Types
|
Look at this line:
|
||||||
|
|
||||||
There are three types of examples:
|
```sh
|
||||||
|
grep ls --color=always $HISTFILE | less -R
|
||||||
Fixed input:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ls
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Anything with arbitrary input should be shown as a variable.
|
What else can go in place of `always`?
|
||||||
|
Can you say `--color=red`?
|
||||||
|
Can you put anything?
|
||||||
|
The answer is not obvious.
|
||||||
|
|
||||||
```bash
|
What about this line:
|
||||||
ls $FILE
|
|
||||||
|
```sh
|
||||||
|
git branch new
|
||||||
|
git checkout new
|
||||||
```
|
```
|
||||||
|
|
||||||
Non-commands (e.g. output) should be shown as quoted text:
|
Do you always use `new`?
|
||||||
|
Can you use another word here?
|
||||||
|
The answer is not obvious.
|
||||||
|
|
||||||
> LK img
|
It's better to make all arbitrary values variables.
|
||||||
> Mail kn
|
|
||||||
> Projects music
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Example
|
|
||||||
|
|
||||||
```
|
|
||||||
How to see which websites you're actively accessing:
|
|
||||||
|
|
||||||
` ` `bash
|
|
||||||
ss -tr dst :$PORT
|
|
||||||
` ` `
|
|
||||||
|
|
||||||
> State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
|
|
||||||
> ESTAB 0 0 192.168.0.14:42476 149.154.167.91:https
|
|
||||||
> ESTAB 0 0 192.168.0.14:43644 104.17.90.199:https
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git branch $branch_name
|
||||||
|
git checkout $branch_name
|
||||||
|
PAGER='less -R'
|
||||||
|
grep ls --color=always $HISTFILE | $PAGER
|
||||||
```
|
```
|
||||||
|
|
||||||
# What's wrong with everything else?
|
Now we can see what can be changed.
|
||||||
|
|
||||||
|
## Assume People Follow the Instructions
|
||||||
|
|
||||||
|
Articles should say what to type, not the output.
|
||||||
|
If the command is `ls`, users will see files once they try the command, but the article does not need to provide an example list of files unless an important point has to be made about output.
|
||||||
|
|
||||||
|
# What's Wrong with Everything Else?
|
||||||
|
|
||||||
## Man pages
|
## Man pages
|
||||||
|
|
||||||
@ -79,12 +101,14 @@ ss -tr dst :$PORT
|
|||||||
- Often presumes you know everything except that one program.
|
- Often presumes you know everything except that one program.
|
||||||
- Often written in the 80's, and it shows.
|
- Often written in the 80's, and it shows.
|
||||||
- Zero respect for your time.
|
- Zero respect for your time.
|
||||||
|
- Often references `info` pages (yuck).
|
||||||
|
|
||||||
## curl cheat.sh/
|
## `curl cheat.sh`
|
||||||
|
|
||||||
- Doesn't have the programs I like.
|
- Doesn't have the programs I like.
|
||||||
- Too short to get you started on many programs.
|
- Too short to get you started on many programs.
|
||||||
- Poor understanding of priority (`git stash` is covered before `git commit`).
|
- Poor understanding of priority (`git stash` is covered before `git commit`).
|
||||||
|
- Repetitive
|
||||||
|
|
||||||
# Current State
|
# Current State
|
||||||
|
|
||||||
|
@ -6,7 +6,20 @@ tags: [ "fun" ]
|
|||||||
- `asciiquarium`
|
- `asciiquarium`
|
||||||
- `cbonsai -lim "$(fortune)"`
|
- `cbonsai -lim "$(fortune)"`
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
cow=$(cowsay -l | sort -R | head -1)
|
cow=$(cowsay -l | sort -R | head -1)
|
||||||
fortune -s | figlet | cowsay -nf $cow | lolcat
|
fortune -s | figlet | cowsay -nf $cow | lolcat
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Watch the [Collatz Conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture) collapse:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
x="$(du -sc ~/.cache | tr -d '[:alpha:]' | tail -1)"
|
||||||
|
until [ "$x" -eq "1" ]; do
|
||||||
|
test "$(( x % 2 ))" -eq 0 && x=$(( x / 2 )) || \
|
||||||
|
x=$(( x * 3 + 1 ))
|
||||||
|
clear -x
|
||||||
|
figlet "$x" | lolcat
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
```
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "at"
|
title: "at"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics", "time" ]
|
||||||
---
|
---
|
||||||
Install with:
|
Install with:
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Basics"
|
title: "Basics"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
You need about a dozen commands to move around Linux.
|
You need about a dozen commands to move around Linux.
|
||||||
@ -342,11 +342,12 @@ apt install $PROGRAM
|
|||||||
|
|
||||||
Remove `lolcat`, because it's useless:
|
Remove `lolcat`, because it's useless:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo apt remove lolcat
|
sudo apt remove lolcat
|
||||||
```
|
```
|
||||||
|
|
||||||
... and that's pretty much it. You can move, create, destroy, install things, and look things up.
|
...and that's pretty much it.
|
||||||
|
You can move, create, destroy, install things, and look things up.
|
||||||
|
|
||||||
# Review
|
# Review
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "clock"
|
title: "clock"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics", "time" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Show system time:
|
Show system time:
|
||||||
|
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.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
du -h /etc/* | column
|
||||||
|
```
|
||||||
|
|
||||||
|
Reformat file with an explicit separator (`-s`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
column -ts: /etc/passwd
|
||||||
|
```
|
||||||
|
|
||||||
|
Give columns names (`-N`), so you can hide some (`-H`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
column -ts: -N User,PW,UID,GID,Description,Home,shell -H PW,GID /etc/passwd
|
||||||
|
```
|
||||||
|
|
||||||
|
Reorder with `-O` (unspecified items remain):
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
column -J -ts: -H PW,GID,shell -N User,PW,UID,GID,Description,Home,shell /etc/passwd
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "conditionals"
|
title: "conditionals"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
# If statements
|
# If statements
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "cron"
|
title: "cron"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics", "time" ]
|
||||||
---
|
---
|
||||||
# Cronie
|
# Cronie
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "bash games"
|
title: "bash games"
|
||||||
tags: [ "Documentation", "Games" ]
|
tags: [ "games" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Games are a great way to learn bash.
|
Games are a great way to learn bash.
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
title: "kernel"
|
|
||||||
tags: [ "Documentation", "Basics" ]
|
|
||||||
---
|
|
||||||
## Living Space
|
|
||||||
|
|
||||||
Kernel modules live in lib/modules/$(uname -r)
|
|
||||||
|
|
||||||
## Change
|
|
||||||
|
|
||||||
Load them with
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo modprobe ath9k
|
|
||||||
```
|
|
||||||
|
|
||||||
Or remove one with
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo modprove uvcvideo
|
|
||||||
```
|
|
||||||
|
|
||||||
The PC's irritating speaker beep can be really annoying. Disable it with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo modprobe -r pcspeaker
|
|
||||||
```
|
|
||||||
|
|
||||||
Permanently disable a module by blacklisting it in `/etc/modprobe.d`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
echo 'blacklist pcspkr' > /etc/modprobe.d/*nobeep*.conf
|
|
||||||
```
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "kill"
|
title: "kill"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
If you want to kill a program in a graphical environment, open a terminal and type:
|
If you want to kill a program in a graphical environment, open a terminal and type:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "locale"
|
title: "locale"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics", "time" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Your locale tells the computer your location, preferred time-and-date format, standard language, papersize, et c.
|
Your locale tells the computer your location, preferred time-and-date format, standard language, papersize, et c.
|
||||||
|
@ -1,62 +1,33 @@
|
|||||||
---
|
---
|
||||||
title: "locating"
|
title: "locating"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
# Type
|
# Type
|
||||||
|
|
||||||
`type` shows what kind of thing you're running, be it an alias, function, or binary program.
|
`type` shows what kind of thing you're running, be it an alias, function, or binary program.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
type cmus
|
type cd
|
||||||
|
type ls
|
||||||
|
type -P ls
|
||||||
|
type -a cat
|
||||||
```
|
```
|
||||||
|
|
||||||
# Whereis the Program
|
# Whereis the Program
|
||||||
|
|
||||||
Ask where the `angband` program is, along with all its configuration files:
|
Where is `grep` and all its configuration files?
|
||||||
|
|
||||||
`whereis angband`
|
```sh
|
||||||
|
whereis grep
|
||||||
Also `which` shows where a binary file (the program) is,
|
|
||||||
|
|
||||||
```bash
|
|
||||||
which cmus
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Search Instantly with `plocate`
|
Which one of these is the binary file which you actually use?
|
||||||
|
|
||||||
You can search every file on the computer instantly by installing `plocate`.
|
```sh
|
||||||
|
which grep
|
||||||
Once installed, run `sudo updatedb` to create the database of (nearly) every file on the computer.
|
|
||||||
|
|
||||||
Check how big the database is:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
du -h /var/lib/plocate/plocate.db
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once you have the database, you can find nearly any file instantly.
|
# More
|
||||||
|
|
||||||
- Search for gifs: `locate .gif`
|
- [Search instantly with `plocate`](data/search_system.md)
|
||||||
- Search for gifs in the `/usr/` directory: `locate /usr/ .gif`
|
|
||||||
- Search for jpg images with 'dog' or 'Dog' in the name: `locate -i dog jpg`
|
|
||||||
- Search for videos: `plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'`
|
|
||||||
|
|
||||||
For best results, run `updatedb` regularly, perhaps in [crontab](../system/cron.md).
|
|
||||||
|
|
||||||
## Search More Places
|
|
||||||
|
|
||||||
`plocate` will not search `/tmp/`, because nobody cares about those files, and won't search inside `/mnt/`, because that's where USB sticks get mounted, so the files keep changing as USB sticks come and go.
|
|
||||||
|
|
||||||
Change where `plocate` searches by editing the configuration file at `/etc/updatedb.conf`.
|
|
||||||
|
|
||||||
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
|
|
||||||
cat /etc/updatedb.conf
|
|
||||||
sudo sed 's#/mnt/##' /etc/updatedb.conf
|
|
||||||
sudo updatedb
|
|
||||||
plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'
|
|
||||||
```
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "processes"
|
title: "processes"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
# Proccesses
|
# Proccesses
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "time"
|
title: "time"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics", "time" ]
|
||||||
---
|
---
|
||||||
# systemd
|
# systemd
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ Then set that language, with:
|
|||||||
LANG=pl_PL.UTF-8
|
LANG=pl_PL.UTF-8
|
||||||
```
|
```
|
||||||
|
|
||||||
... then reboot.
|
...then reboot.
|
||||||
|
|
||||||
# Network Time Protocol
|
# Network Time Protocol
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "users"
|
title: "users"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "basics" ]
|
||||||
---
|
---
|
||||||
# Basic Information
|
# Basic Information
|
||||||
|
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
---
|
|
||||||
title: "profanity"
|
|
||||||
tags: [ "Documentation", "Chat", "OTR" ]
|
|
||||||
---
|
|
||||||
# otr
|
|
||||||
|
|
||||||
'Off The Record' encryption seems mostly dead to me.
|
|
||||||
But this is what I did, back in the day...
|
|
||||||
|
|
||||||
Install libotr-dev or libotr5-dev or whatever..
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt -y install lib5otr-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Make your otr keys.
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr gen
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can start an otr converstation.
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr start bob@jobbies.org
|
|
||||||
```
|
|
||||||
|
|
||||||
Or if you already have a conversation windows open, switch to our using:
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, verify!
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr question "Who are you?" bob
|
|
||||||
```
|
|
||||||
|
|
||||||
Bob is verified upon the answer, 'bob'.
|
|
||||||
|
|
||||||
### OTR Finger Prints
|
|
||||||
|
|
||||||
Get yours with
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr myfp
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr theirfp
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
/otr myfp
|
|
||||||
```
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "profanity"
|
title: "profanity"
|
||||||
tags: [ "Documentation", "Chat", "omemo" ]
|
tags: [ "chat", "omemo" ]
|
||||||
---
|
---
|
||||||
# Setup (Commands)
|
# Setup (Commands)
|
||||||
|
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
---
|
---
|
||||||
title: "wgetpaste"
|
title: "wgetpaste"
|
||||||
tags: [ "Documentation", "Chat" ]
|
tags: [ "chat" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
See available pastebins:
|
See available pastebins:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wgetpaste -S
|
wgetpaste -S
|
||||||
```
|
```
|
||||||
|
|
||||||
Upload script.sh to bpaste:
|
Upload script.sh to bpaste:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wgetpaste -s bpaste script.sh
|
wgetpaste -s bpaste script.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Input clipboard to dpaste with the heading "Title"
|
Input clipboard to dpaste with the heading "Title"
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wgetpaste -s dpaste -d Title -x
|
wgetpaste -s dpaste -d Title -x
|
||||||
```
|
```
|
||||||
|
|
||||||
Paste in the file then load the result to the right-hand clipboard:
|
Paste in the file then load the result to the right-hand clipboard:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wgetpaste -s dpaste -X
|
wgetpaste -s dpaste -X
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Archives"
|
title: "Archives"
|
||||||
tags: [ "Documentation", "tar", "backups" ]
|
tags: [ "tar", "backups", ".tgz", "tar.gz" ]
|
||||||
---
|
---
|
||||||
# `tar`
|
# `tar`
|
||||||
|
|
||||||
@ -8,22 +8,21 @@ tags: [ "Documentation", "tar", "backups" ]
|
|||||||
|
|
||||||
Combine many files and directories into a single t-archive file.
|
Combine many files and directories into a single t-archive file.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
tar cf "$ARCHIVE".tar $DIR
|
tar cf "$ARCHIVE".tar $DIR
|
||||||
```
|
```
|
||||||
You can remember this with the mnemonic '*C*reate *F*ile'.
|
You can remember this with the mnemonic '*C*reate *F*ile'.
|
||||||
|
|
||||||
Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`.
|
Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`).
|
||||||
|
|
||||||
It's often better to tell tar which path to start from using the `-C` flag.
|
It's often better to tell tar which path to start from using the `-C` flag.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
tar cf "$ARCHIVE".tar -C /etc/ nginx
|
tar cf "$ARCHIVE".tar -C /etc/ nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the contents of your archive with:
|
Check the contents of your archive with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
tar tf "$ARCHIVE".tar
|
tar tf "$ARCHIVE".tar
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -31,7 +30,7 @@ If you want to store 'everything in a directory', then using `*` will not work,
|
|||||||
|
|
||||||
Instead, you can store the target in a variable:
|
Instead, you can store the target in a variable:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
files=$(ls /etc/nginx)
|
files=$(ls /etc/nginx)
|
||||||
tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
|
tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
|
||||||
```
|
```
|
||||||
@ -40,7 +39,9 @@ tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
|
|||||||
|
|
||||||
Extract the tar archive with
|
Extract the tar archive with
|
||||||
|
|
||||||
> tar xf "$ARCHIVE".tar
|
```sh
|
||||||
|
tar xf "$ARCHIVE".tar
|
||||||
|
```
|
||||||
|
|
||||||
You can remember this with the mnemonic 'e*X*tract *F*ile'.
|
You can remember this with the mnemonic 'e*X*tract *F*ile'.
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ You can remember this with the mnemonic 'e*X*tract *F*ile'.
|
|||||||
|
|
||||||
Create a zip-compressed archive with the `z` flag.
|
Create a zip-compressed archive with the `z` flag.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file
|
tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -60,18 +61,16 @@ You can use any file ending you want, but sane people like to use '.tgz' or '.ta
|
|||||||
|
|
||||||
Make archive:
|
Make archive:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
PASSWORD=my_password
|
7za a -tzip -p "$PASSWORD" -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
|
||||||
```
|
|
||||||
```bash
|
|
||||||
7za a -tzip -p$PASSWORD -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that people can still see every filename in your archive, and can change those files.
|
Note that people can still see every filename in your archive, and can change those files.
|
||||||
They just can't read the contents.
|
They just can't read the contents.
|
||||||
|
|
||||||
Unzip:
|
Unzip:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
7za x archive.zip
|
7za x archive.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
title: "unison"
|
title: "unison"
|
||||||
tags: [ "Documentation", "Backups" ]
|
tags: [ "backups", "synch" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Install unison on both machines, and make sure both have the same version of unison, with the same version of the ocaml compiler (the smallest difference will cause problems).
|
Install unison on both machines, and make sure both have the same version of unison, with the same version of the ocaml compiler (the smallest difference will cause problems).
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
unison -version
|
unison -version
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -13,14 +13,14 @@ Create the `~/.unison` directory on both machines.
|
|||||||
|
|
||||||
Make a job called `backup`:
|
Make a job called `backup`:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
JOB=backup
|
JOB=backup
|
||||||
```
|
```
|
||||||
|
|
||||||
Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username.
|
Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo "
|
echo "
|
||||||
auto = true
|
auto = true
|
||||||
root=$HOME
|
root=$HOME
|
||||||
@ -42,7 +42,7 @@ The last command means it will ignore any file with a name ending in `.flac`.
|
|||||||
The first command means this will run but also confirm which files will be deleted, and which will be transferred, us `batch = true` instead.
|
The first command means this will run but also confirm which files will be deleted, and which will be transferred, us `batch = true` instead.
|
||||||
Or you can deleted that line in the `.prf` file and run it with a flag:
|
Or you can deleted that line in the `.prf` file and run it with a flag:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
unison -batch *backup*.prf
|
unison -batch *backup*.prf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,8 +1,26 @@
|
|||||||
---
|
---
|
||||||
title: "Base 16"
|
title: "Base 16"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
```bash
|
Base 16 numbers often use `0x` at the start, so '10' just means '10', but `0x10` means '10 in base 16' which means '16'.
|
||||||
|
|
||||||
|
For small numbers, use `printf`.
|
||||||
|
|
||||||
|
```sh
|
||||||
printf "%x" $NUMBER
|
printf "%x" $NUMBER
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For any number, use `bc`.
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
fortune | md5sum | cut -d' ' -f1 | tr [:lower:] [:upper:] | bc
|
||||||
|
```
|
||||||
|
|
||||||
|
- Inputting base 16 uses `ibase=16`.
|
||||||
|
- Outputting base 10 uses `ibase=10`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo 'ibase=16;' $(echo cbb478ac825f0dce7671254be035d0bc | tr [:lower:] [:upper:]) | bc
|
||||||
|
```
|
||||||
|
@ -5,5 +5,10 @@ tags: [ "data", "calendar", "daylight savings" ]
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
The UK government keeps an ics file with clock, [here](https://www.gov.uk/when-do-the-clocks-change/united-kingdom.ics).
|
The UK government keeps an `ics` file with clock.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
wget https://www.gov.uk/when-do-the-clocks-change/united-kingdom.ics
|
||||||
|
calcurse -i united-kingdom.ics
|
||||||
|
```
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ Install `opensmtpd` (or similar), then `ncat` or `nc` or `netcat` (this mysterio
|
|||||||
|
|
||||||
Start the `opensmtpd` service, then use netcat to speak with the mail-daemon:
|
Start the `opensmtpd` service, then use netcat to speak with the mail-daemon:
|
||||||
|
|
||||||
|
```sh
|
||||||
```
|
|
||||||
nc localhost 25
|
nc localhost 25
|
||||||
```
|
```
|
||||||
|
|
||||||
The computer should respond with code `220`, which means 'I am listening'.
|
The computer should respond with code `220`, which means 'I am listening'.
|
||||||
|
|
||||||
> 220 hex ESMTP OpenSMTPD
|
> 220 hex ESMTP OpenSMTPD
|
||||||
@ -40,7 +40,7 @@ Tell the mail daemon who you are in this format.
|
|||||||
|
|
||||||
Then tell it who you're sending to.
|
Then tell it who you're sending to.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
RCPT TO: <www@dmz.rs>
|
RCPT TO: <www@dmz.rs>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ You will find the email under `/var/spool` or `/var/mail` or similar.
|
|||||||
|
|
||||||
If unsure, just take a part of your email, like `FRAGMENT="turn off server please"`, then `grep` for it:
|
If unsure, just take a part of your email, like `FRAGMENT="turn off server please"`, then `grep` for it:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo grep -r $FRAGMENT /var/spool/*
|
sudo grep -r $FRAGMENT /var/spool/*
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
---
|
---
|
||||||
title: "exiftool"
|
title: "exiftool"
|
||||||
tags: [ "Documentation", "Metadata" ]
|
tags: [ "metadata", "exifdata" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Find metadata.
|
Find metadata:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
exiftool image.jpg
|
exiftool "$file".jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
Find info on all images in current directory.
|
Find info on all `.png` images in current directory.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
exiftool -ext .png .
|
exiftool -ext .png .
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -19,22 +19,14 @@ You can make this recurring with the -r switch.
|
|||||||
|
|
||||||
And overwrite all metadata:
|
And overwrite all metadata:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
exiftool -all= -overwrite_original -ext jpg .
|
exiftool -all= -overwrite_original -ext jpg .
|
||||||
```
|
```
|
||||||
(NB: This does not work on pdf data. See [here](pdf_erasure.md) for erasing all pdf data)
|
(NB: This does not work on pdf data. See [here](pdf_erasure.md) for erasing all pdf data)
|
||||||
|
|
||||||
Or just GPS data:
|
Or just GPS data:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
exiftool -gps:all= *.jpg
|
exiftool -gps:all= *.jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also use the imagemagick tool:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
identify -verbose
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "git"
|
title: "git"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
# Starting
|
# Starting
|
||||||
|
|
||||||
@ -26,15 +26,10 @@ mkdir $DIR && cd $DIR
|
|||||||
git init
|
git init
|
||||||
```
|
```
|
||||||
|
|
||||||
Make a file explaining what the project does:
|
Make a file explaining what the project does, and tell `git` to track it:
|
||||||
|
|
||||||
```bash
|
|
||||||
vim README.md
|
|
||||||
```
|
|
||||||
|
|
||||||
Add this to the git:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
echo "I hereby solemnly swear never to commit a binary." > README.md
|
||||||
git add README.md
|
git add README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
22
data/git/commit_for_another.md
Normal file
22
data/git/commit_for_another.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: "Commit for Another"
|
||||||
|
tags: [ "data", "git" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
You can make Alice the author, while you are still the commiter:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
name="Alice Bobinson"
|
||||||
|
email="alice@email.com"
|
||||||
|
|
||||||
|
git add ${file}
|
||||||
|
git commit --author="${name} <${email}>"
|
||||||
|
```
|
||||||
|
|
||||||
|
Or, make Alice both the committer and the author:
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git -c user.name="${name}" -c user.email="${email}" commit -m "${message}"
|
||||||
|
```
|
||||||
|
|
@ -1,24 +1,72 @@
|
|||||||
---
|
---
|
||||||
title: "git-lfs"
|
title: "git-lfs"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data", "git" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Install, and add with
|
Git Large File Storage ('LFS') needs to change your `~/.gitconfig` to check out those binary files:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
|
cat ~/.gitconfig
|
||||||
git lfs install
|
git lfs install
|
||||||
|
cat ~/.gitconfig
|
||||||
```
|
```
|
||||||
|
|
||||||
Then track some filetype with:
|
Then track some filetypes with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
git lfs track "\*.ttf"
|
cd $git_repository
|
||||||
|
ext=ttf
|
||||||
|
git lfs track "*.$ext"
|
||||||
```
|
```
|
||||||
|
|
||||||
Or a directory with:
|
Or a directory with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
git lfs track "images/"
|
git lfs track "images/"
|
||||||
```
|
```
|
||||||
|
|
||||||
All changes require adding `.gitattributes`.
|
Track the changes to `.gitattributes`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git status
|
||||||
|
git add .gitattributes
|
||||||
|
git commit -m "add $ext to lfs"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Bash Completion
|
||||||
|
|
||||||
|
If bash completion does not work, you'll have to add it:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git lfs completion bash | sudo tee /usr/share/bash-completion/completions/git-lfs
|
||||||
|
```
|
||||||
|
|
||||||
|
## Trouble Shooting
|
||||||
|
|
||||||
|
You have some file "$FILE".png, which has some problem.
|
||||||
|
|
||||||
|
Check the filetype:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
file "$FILE".png
|
||||||
|
```
|
||||||
|
|
||||||
|
This should say the type is 'image'.
|
||||||
|
If it says the type is 'text', then this file is really just a reminder to `git-lfs` to check out that file.
|
||||||
|
|
||||||
|
Check `git-lfs` is expecting that file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git lfs status
|
||||||
|
git lfs ls-files
|
||||||
|
```
|
||||||
|
|
||||||
|
...then try these commands, and check the filetype again:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git lfs fetch --all
|
||||||
|
git lfs fsck
|
||||||
|
git lfs checkout
|
||||||
|
git lfs status
|
||||||
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "git hooks"
|
title: "git hooks"
|
||||||
tags: [ "Documentation", "data", "git" ]
|
tags: [ "data", "git" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Check out the sample hooks:
|
Check out the sample hooks:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "git"
|
title: "git subtree"
|
||||||
tags: [ "Documentation", "data", "git", "subtree" ]
|
tags: [ "data", "git", "subtree" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
## Pulling a Subtree from an existing git
|
## Pulling a Subtree from an existing git
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "gpg"
|
title: "gpg"
|
||||||
tags: [ "Documentation", "data", "GPG" ]
|
tags: [ "data", "gpg" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
- [Setup](gpg/basics.md)
|
- [Setup](gpg/basics.md)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "GPG Basics"
|
title: "GPG Basics"
|
||||||
tags: [ "Documentation", "data", "GPG" ]
|
tags: [ "data", "GPG" ]
|
||||||
---
|
---
|
||||||
# Making keys
|
# Making keys
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "gpg"
|
title: "gpg with vim"
|
||||||
tags: [ "Documentation", "vim", "data", "GPG" ]
|
tags: [ "vim", "data", "GPG" ]
|
||||||
|
requires: [ "GPG Basics", "vim basics" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
The `vim-gnupg` plugin lets vim edit gpg-encrypted files as if they were unencrypted.
|
The `vim-gnupg` plugin lets vim edit gpg-encrypted files as if they were unencrypted.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "groff"
|
title: "groff"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "data", "logic" ]
|
||||||
---
|
---
|
||||||
# Basic Documents
|
# Basic Documents
|
||||||
|
|
||||||
|
@ -1,60 +1,52 @@
|
|||||||
---
|
---
|
||||||
title: "khard"
|
title: "khard"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
Get the basic config:
|
Get the basic config:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
mkdir ~/.config/khard
|
mkdir ~/.config/khard
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
cp /usr/share/doc/khard/examples/khard/khard.conf.example ~/.config/khard.conf
|
cp /usr/share/doc/khard/examples/khard/khard.conf.example ~/.config/khard.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
Short list
|
Short list
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard list
|
khard list
|
||||||
```
|
```
|
||||||
|
|
||||||
Longer list
|
Longer list
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard show
|
khard show
|
||||||
```
|
```
|
||||||
|
|
||||||
Show from addressbook 'work'
|
Show from addressbook 'work'
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard list -a work
|
khard list -a work
|
||||||
```
|
```
|
||||||
|
|
||||||
Make a new contact in address book 'family'
|
Make a new contact in address book 'family'
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard new -a family
|
khard new -a family
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard edit grampa
|
khard edit grampa
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard remove bob
|
khard remove bob
|
||||||
```
|
```
|
||||||
|
|
||||||
Move contact 'nina' from 'work' to 'home' address book.
|
Move contact 'nina' from 'work' to 'home' address book.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
khard move -a home nina -A work
|
khard move -a home nina -A work
|
||||||
```
|
```
|
||||||
|
|
||||||
## Advanced
|
|
||||||
|
|
||||||
Merge:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
khard merge [-a source_abook] [-u uid|search terms [search terms ...]] [-A target_abook] [-U target_uid|-t target_search_terms]
|
|
||||||
```
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "newsboat"
|
title: "newsboat"
|
||||||
tags: [ "Documentation", "RSS" ]
|
tags: [ "RSS" ]
|
||||||
---
|
---
|
||||||
Create the configuration directory before you start, and add at least 1 URL.
|
Create the configuration directory before you start, and add at least 1 URL.
|
||||||
|
|
||||||
|
16
data/pass.md
16
data/pass.md
@ -1,42 +1,42 @@
|
|||||||
---
|
---
|
||||||
title: "pass"
|
title: "pass"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
|
requires: "GPG Basics"
|
||||||
---
|
---
|
||||||
[Video instructions](https://www.hooktube.com/watch?v=hlRQTj1D9LA)
|
|
||||||
|
|
||||||
Setup [gpg](./gpg.md) keys.
|
Setup [gpg](./gpg.md) keys.
|
||||||
|
|
||||||
Show your gpg secret it:
|
Show your gpg secret it:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
gpg --list-secret-keys
|
gpg --list-secret-keys
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use the id number under `sec` to make a pass repo:
|
Then use the id number under `sec` to make a pass repo:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
KEY="$(gpg --list-secret-keys | grep -m 1 -A1 '^sec' | tail -n 1)"
|
KEY="$(gpg --list-secret-keys | grep -m 1 -A1 '^sec' | tail -n 1)"
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
pass init $KEY
|
pass init $KEY
|
||||||
```
|
```
|
||||||
|
|
||||||
To add a basic password, e.g. for `$WEBSITE`:
|
To add a basic password, e.g. for `$WEBSITE`:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
pass $WEBSITE
|
pass $WEBSITE
|
||||||
```
|
```
|
||||||
|
|
||||||
To insert a multiline password, e.g. with a login name:
|
To insert a multiline password, e.g. with a login name:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
pass add -m $WEBSITE
|
pass add -m $WEBSITE
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove a password:
|
Remove a password:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
pass rm $WEBSITE
|
pass rm $WEBSITE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: "pdf to txt"
|
title: "pdf to txt"
|
||||||
tags: [ "Documentation", "data", "pdf", "ocr" ]
|
tags: [ "data", "pdf", "ocr" ]
|
||||||
---
|
---
|
||||||
How to translate pdf book images to text (results are very poor, and will need lots of corrections).
|
|
||||||
|
How to translate pdfs to text (results are very poor, and will need lots of corrections).
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
@ -17,8 +18,8 @@ pdftoppm -png *file*.pdf test
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
for x in \*png; do
|
for x in *png; do
|
||||||
tesseract -l eng "$x" - >> *out*.txt
|
tesseract -l eng "$x" - >> out.txt
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
---
|
---
|
||||||
title: "PDF Metadata Erasure"
|
title: "PDF Metadata Erasure"
|
||||||
tags: [ "Documentation", "Metadata", "Ghost Script" ]
|
tags: [ "metadata", "ghost script", "gs", ".pdf" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
You cannot erase pdf metadata with `exiftool` (it only *appends* your changes).
|
||||||
|
To delete pdf metadata, you'll need `gs`.
|
||||||
|
|
||||||
Make a text file called 'pdfmark.txt'.
|
Make a text file called 'pdfmark.txt'.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "radicale and nginx"
|
title: "radicale and nginx"
|
||||||
tags: [ "data", "calendar" ]
|
tags: [ "data", "calendar" ]
|
||||||
|
requires: [ "nginx", "certbot" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Check before you start:
|
Check before you start:
|
||||||
|
54
data/recfiles.md
Normal file
54
data/recfiles.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
title: "Recfiles"
|
||||||
|
tags: [ "data", "database" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Create:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
database=games.rec
|
||||||
|
touch $database
|
||||||
|
for g in Vojvodina Saboter Carcassonne Chess; do
|
||||||
|
recins -r "Name: $g" -r "Played: yes" $database
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
Read:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel $database
|
||||||
|
query=Carc
|
||||||
|
recsel --quick=$query $database
|
||||||
|
|
||||||
|
game=Vojvodina
|
||||||
|
recsel --expression="Name = '${game}'" $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Update:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recset --expression="Name = '${game}'" -f Played --set="no" $database
|
||||||
|
new_field=Played
|
||||||
|
value=no
|
||||||
|
recset -f "$new_field" --delete $database
|
||||||
|
recset -f "$new_field" --set-add="$value" $database
|
||||||
|
recsel $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recdel --expression="Name = '${game}'" $database
|
||||||
|
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)
|
||||||
|
- [Manage LaTeX Bibliographies](recfiles/bibliography.md)
|
||||||
|
- [Fixes](recfiles/recfixes.md)
|
||||||
|
|
||||||
|
# Resources
|
||||||
|
|
||||||
|
- [Recfiles for gemini capsules](gemini://tilde.town/~dozens/gemlog/21.gmi)
|
||||||
|
|
62
data/recfiles/Board_Games.md
Normal file
62
data/recfiles/Board_Games.md
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
title: "Board Games with Recfiles"
|
||||||
|
tags: [ "data", "recfiles", "games" ]
|
||||||
|
requires: "Recfiles"
|
||||||
|
---
|
||||||
|
|
||||||
|
You can play with a board games database from boardgamegeek.com.
|
||||||
|
|
||||||
|
## Download the Database
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir board_games
|
||||||
|
cd board_games
|
||||||
|
curl -Lo bg.zip 'https://www.kaggle.com/api/v1/datasets/download/threnjen/board-games-database-from-boardgamegeek'
|
||||||
|
unzip bg.zip
|
||||||
|
```
|
||||||
|
|
||||||
|
The header line shows fields with a bunch of colons, which will confused `recutils`, so we'll have to get rid of them.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sed -i '1s/://g' *.csv
|
||||||
|
```
|
||||||
|
|
||||||
|
Convert the games to `.rec` format.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
csv2rec games.csv > games.rec
|
||||||
|
```
|
||||||
|
|
||||||
|
## Queries
|
||||||
|
|
||||||
|
If you try to look at older games, you'll find lots of results.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel games.rec -e "YearPublished < 1800" -c
|
||||||
|
recsel games.rec -e "YearPublished < 1800" -Cp Name
|
||||||
|
```
|
||||||
|
But most are wrong.
|
||||||
|
The problem is games with a `YearPublished` date of `0`, probably because the year published is unknown.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel games.rec -e "Name = 'The Goblin King is Angry'" -p YearPublished
|
||||||
|
```
|
||||||
|
|
||||||
|
Fix the query by removing games published in '0 AD'.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel games.rec -e "YearPublished < 1800 && YearPublished != 0" -R YearPublished,Name
|
||||||
|
```
|
||||||
|
|
||||||
|
Or fix the database setting `YearPublished` to 'unknown':
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel games.rec -e "YearPublished = 0" -Cp Name
|
||||||
|
recset games.rec -e "YearPublished = 0" -f "YearPublished" -S 'unknown'
|
||||||
|
```
|
||||||
|
|
||||||
|
Strategic games which work best with 3 players, sorted by Average Rating:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel games.rec -e "BestPlayers = 3 && CatStrategy = 1" -CR Name --sort=AvgRating
|
||||||
|
```
|
16
data/recfiles/IP_ASN.md
Normal file
16
data/recfiles/IP_ASN.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: "IP Addresses with Recfiles"
|
||||||
|
tags: [ "data", "recfiles", "games" ]
|
||||||
|
requires: "Recfiles"
|
||||||
|
---
|
||||||
|
|
||||||
|
## Download the Database
|
||||||
|
|
||||||
|
Download the csv data, and separate the ipv4 data from the ipv6.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -Lo ips.zip 'https://www.kaggle.com/api/v1/datasets/download/ipinfo/ipinfo-country-asn'
|
||||||
|
unzip -p ips.zip country_asn.csv | csv2rec | recsel -e "start_ip ~ '\.'" > ipv4.rec
|
||||||
|
unzip -p ips.zip country_asn.csv | csv2rec | recsel -e "start_ip ~ '::'" > ipv6.rec
|
||||||
|
```
|
||||||
|
|
121
data/recfiles/bibliography.md
Normal file
121
data/recfiles/bibliography.md
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
---
|
||||||
|
title: "Recfile Bibliography for TeX"
|
||||||
|
tags: [ "data", "database", "recfiles", "tex" ]
|
||||||
|
requires: [ "Recfiles", "TeX", "Makefile" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Store your bibliography in a `recfile` database, then extract any part with `make`.
|
||||||
|
|
||||||
|
For example, you could store books like this in `bibliography.rec`:
|
||||||
|
|
||||||
|
```recfile
|
||||||
|
%rec: book
|
||||||
|
%key: slug
|
||||||
|
|
||||||
|
slug: thinkingexperience
|
||||||
|
author: H. H. Price
|
||||||
|
title: Thinking and Experience
|
||||||
|
year: 1953
|
||||||
|
publisher: Harvard University Press, Cambridge
|
||||||
|
|
||||||
|
slug: inventingrightwrong
|
||||||
|
author: John Leslie Mackie
|
||||||
|
title: Inventing Right and Wrong
|
||||||
|
year: 1997
|
||||||
|
publisher: Penguin Books, England
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Run `make book` to extract `book.bib`, ready for LaTeX to use:
|
||||||
|
|
||||||
|
```bib
|
||||||
|
@book{thinkingexperience,
|
||||||
|
author = {H. H. Price},
|
||||||
|
title = {Thinking and Experience},
|
||||||
|
year = {1953},
|
||||||
|
publisher = {Harvard University Press, Cambridge},
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{inventingrightwrong,
|
||||||
|
author = {John Leslie Mackie},
|
||||||
|
title = {Inventing Right and Wrong},
|
||||||
|
year = {1997},
|
||||||
|
publisher = {Penguin Books, England},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `makefile` syntax is just a few lines (though admittedly employs some garbled shell-crud):
|
||||||
|
|
||||||
|
```make
|
||||||
|
bibs != grep -Po '%rec: \K.*' bibliography.rec
|
||||||
|
bibfiles = $(patsubst %, %.bib, $(bibs))
|
||||||
|
|
||||||
|
$(bibfiles): %.bib: bibliography.rec
|
||||||
|
recsel $< -t $(basename $@) |\
|
||||||
|
sed 's/slug: \(.*\)/@$(basename $@){\1,/g' |\
|
||||||
|
sed 's/^\(\b.*\b\): \(.*\)/ \1 = {\2},/gI' |\
|
||||||
|
sed 's/^$$/}\n/g' > $@
|
||||||
|
echo '}' >> $@
|
||||||
|
```
|
||||||
|
|
||||||
|
Here's a longer `bibliography.rec` file, which can also produce `article.bib`:
|
||||||
|
|
||||||
|
```recfile
|
||||||
|
%rec: book
|
||||||
|
%key: slug
|
||||||
|
%type: year int
|
||||||
|
%constraint: year > -2000
|
||||||
|
%sort: year month
|
||||||
|
|
||||||
|
slug: thinkingexperience
|
||||||
|
author: H. H. Price
|
||||||
|
title: Thinking and Experience
|
||||||
|
year: 1953
|
||||||
|
publisher: Harvard University Press, Cambridge
|
||||||
|
|
||||||
|
slug: inventingrightwrong
|
||||||
|
author: John Leslie Mackie
|
||||||
|
title: Inventing Right and Wrong
|
||||||
|
year: 1997
|
||||||
|
publisher: Penguin Books, England
|
||||||
|
|
||||||
|
slug: metaphysicscontemporaryintro
|
||||||
|
author: Michael J. Loux
|
||||||
|
title: Metaphysics: A Contemporary Introduction
|
||||||
|
year: 1998
|
||||||
|
publisher: Routledge, London
|
||||||
|
|
||||||
|
slug: pluralityworlds
|
||||||
|
author: David Lewis
|
||||||
|
title: On the Plurality of Worlds
|
||||||
|
publisher: Blackwell Publishing, Oxford
|
||||||
|
year: 2001
|
||||||
|
|
||||||
|
%rec: article
|
||||||
|
%key: slug
|
||||||
|
%sort: year month
|
||||||
|
|
||||||
|
slug: genuinerealisttheory
|
||||||
|
author: John Divers
|
||||||
|
title: A Genuine Realist Theory of Advanced Modalizing
|
||||||
|
year: 1999
|
||||||
|
pages: 217–240
|
||||||
|
month: april
|
||||||
|
journaltitle: Mind
|
||||||
|
uri: https://academic.oup.com/mind/article-abstract/108/430/217/975258?redirectedFrom=fulltext
|
||||||
|
volume: 108
|
||||||
|
publisher: Harvard University Press, Cambridge
|
||||||
|
|
||||||
|
slug: twokindsmentalrealism
|
||||||
|
author: Tam\'{a}s Demeter
|
||||||
|
title: Two Kinds of Mental Realism
|
||||||
|
year: 2009
|
||||||
|
pages: 40:59-71
|
||||||
|
uri: https://www.researchgate.net/profile/Tamas_Demeter2/publication/41554923_Two_Kinds_of_Mental_Realism/links/0deec53247f5a4ae21000000.pdf
|
||||||
|
month: august
|
||||||
|
journaltitle: Journal for General Philosophy of Science
|
||||||
|
volume: 30
|
||||||
|
publisher: Harvard University Press, Cambridge
|
||||||
|
|
||||||
|
```
|
||||||
|
|
118
data/recfiles/extended.md
Normal file
118
data/recfiles/extended.md
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
---
|
||||||
|
title: "Recfiles Extended Example"
|
||||||
|
tags: [ "data", "database", "recfiles" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
## Create
|
||||||
|
|
||||||
|
Make a database for your boardgames, specifying only one field and value:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
database=games.rec
|
||||||
|
n=Name
|
||||||
|
g=Vojvodina
|
||||||
|
touch $database
|
||||||
|
recins -f $n --value $g $database
|
||||||
|
recsel $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Insert a few more, with the estimated playtime:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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
|
||||||
|
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
|
||||||
|
f=played
|
||||||
|
v=yes
|
||||||
|
recset -f $f -a $v $database
|
||||||
|
```
|
||||||
|
|
||||||
|
...but the field is wrong, it should have a capital letter:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
new_field=Played
|
||||||
|
recset -f $f --rename $new_field
|
||||||
|
```
|
||||||
|
|
||||||
|
## Read
|
||||||
|
|
||||||
|
Check how many records the database has:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
recinf $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Look at just the games you've never played:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
recsel --expression="Played = 'no'" $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Print how many, then just print the names:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
recsel -e "Played = 'no'" --count $database
|
||||||
|
recsel -e "Played = 'no'" --print=Name $database
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
To change a game's `Played` field from `no` to `yes`, use `recset` to specify the number, and change that field.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
num=0
|
||||||
|
f=Played
|
||||||
|
value=yes
|
||||||
|
recsel --number=$num $database
|
||||||
|
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
|
||||||
|
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
|
||||||
|
recset -e "Playtime = 40" -f Max_Players --set-add 50 games.rec
|
||||||
|
```
|
||||||
|
|
||||||
|
## Delete
|
||||||
|
|
||||||
|
Remove `Played` record from first game:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
num=0
|
||||||
|
recset --number=$num -f Played --delete $database
|
||||||
|
```
|
||||||
|
|
||||||
|
You can comment the line instead of deleting it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
num=1
|
||||||
|
recset --number=$num -f Played --delete $database
|
||||||
|
recsel $database
|
||||||
|
cat $database
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete an entire record:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
num=2
|
||||||
|
recdel --number=$num $database
|
||||||
|
```
|
||||||
|
|
33
data/recfiles/recfixes.md
Normal file
33
data/recfiles/recfixes.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
title: "Recfixes"
|
||||||
|
tags: [ "data", "recfiles" ]
|
||||||
|
requires: "Recfiles"
|
||||||
|
---
|
||||||
|
|
||||||
|
Sometimes `recsel` chokes on a large query, and you need to break the query into chunks with a pipe.
|
||||||
|
|
||||||
|
This Kickstarter file has 374,853 records.
|
||||||
|
Here's the chonky query:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel kick.rec -e "Category = 'Games'" -p "Subcategory,Avg(Goal)" -G Subcategory
|
||||||
|
```
|
||||||
|
|
||||||
|
It breaks down like this:
|
||||||
|
|
||||||
|
| Chunk | Meaning |
|
||||||
|
|:-----------------------------:|:---------------------------------------------:|
|
||||||
|
| `recsel kick.rec` | Select records from `kick.rec` |
|
||||||
|
| `-e "Category = 'Games'"` | Select only records where Category = 'Games' |
|
||||||
|
| `-p "Subcategory,Avg(Goal)"` | Print the Subcategory and average goal |
|
||||||
|
| `-G "Subcategory"` | Group by subcategory |
|
||||||
|
|
||||||
|
Two ways to break the query apart:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
recsel kick.rec -e "Category = 'Games'" | recsel -p "Subcategory,Avg(Goal)" -G "Subcategory"
|
||||||
|
|
||||||
|
recsel kick.rec -e "Category = 'Games'" > games.rec
|
||||||
|
recsel games.rec -p "Subcategory" -G "Subcategory"
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "sc-im"
|
title: "sc-im"
|
||||||
tags: [ "Documentation", "TUI", "data" ]
|
tags: [ "TUI", "data", "spreadsheet", ".csv" ]
|
||||||
|
requires: [ "vim basics" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
- [Sample file](sc-im/sample.sc)
|
- [Sample file](sc-im/sample.sc)
|
||||||
|
49
data/search_system.md
Normal file
49
data/search_system.md
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
---
|
||||||
|
title: "Search System"
|
||||||
|
tags: [ "data", "search", "locate", "plocate" ]
|
||||||
|
requires: "cron"
|
||||||
|
---
|
||||||
|
|
||||||
|
You can search every file on the computer instantly by installing `plocate`.
|
||||||
|
|
||||||
|
Once installed, run `sudo updatedb` to create the database of (nearly) every file on the computer.
|
||||||
|
|
||||||
|
Check how big the database is:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
du -h /var/lib/plocate/plocate.db
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you have the database, you can find nearly any file instantly.
|
||||||
|
|
||||||
|
- Search for gifs: `locate .gif`
|
||||||
|
- Search for gifs in the `/usr/` directory: `locate /usr/ .gif`
|
||||||
|
- Search for jpg images with 'dog' or 'Dog' in the name: `locate -i dog jpg`
|
||||||
|
- Search for videos: `plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'`
|
||||||
|
|
||||||
|
For best results, run `updatedb` regularly, perhaps in [crontab](../system/cron.md).
|
||||||
|
|
||||||
|
## Search More Places
|
||||||
|
|
||||||
|
`plocate` will not search `/tmp/`, because nobody cares about those files, and won't search inside `/mnt/`, because that's where USB sticks get mounted, so the files keep changing as USB sticks come and go.
|
||||||
|
|
||||||
|
Change where `plocate` searches by editing the configuration file at `/etc/updatedb.conf`.
|
||||||
|
|
||||||
|
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
|
||||||
|
su root
|
||||||
|
cat /etc/updatedb.conf
|
||||||
|
sed -i 's#/mnt/##' /etc/updatedb.conf
|
||||||
|
updatedb
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you can search in `/mnt` for films:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'
|
||||||
|
```
|
||||||
|
|
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" ]
|
||||||
|
requires: [ "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"
|
title: "Soft Serve through https"
|
||||||
tags: [ "data", "git" ]
|
tags: [ "data", "git server", "lfs" ]
|
||||||
|
requires: [ "git", "nginx" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
## `http` Setup
|
## `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
|
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).
|
||||||
|
|
||||||
@ -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" ]
|
||||||
|
requires: [ "git", "nginx" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
- [Soft-Serve with https](soft-serve/soft_https.md)
|
||||||
|
- [Maintenance](soft-serve/maintenance.md)
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "sqlite"
|
title: "sqlite"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Work with a database:
|
Work with a database:
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
---
|
---
|
||||||
title: "task"
|
title: "task"
|
||||||
tags: [ "Documentation", "Organization" ]
|
tags: [ "organization" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Set up the configuration file:
|
Set up the configuration file:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task
|
task
|
||||||
```
|
```
|
||||||
|
|
||||||
Add a task:
|
Add a task:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task add update linux
|
task add update linux
|
||||||
```
|
```
|
||||||
|
|
||||||
See which task is next:
|
See which task is next:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task next
|
task next
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -25,13 +25,13 @@ Note the id number.
|
|||||||
|
|
||||||
Mark a task as started:
|
Mark a task as started:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task start 1
|
task start 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Once finished:
|
Once finished:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task 1 done
|
task 1 done
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ task 1 done
|
|||||||
|
|
||||||
Add a project:
|
Add a project:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task add project:house buy potted plant
|
task add project:house buy potted plant
|
||||||
task add proj:house.repair buy screwdriver
|
task add proj:house.repair buy screwdriver
|
||||||
task add proj:house.repair buy shelf brackets
|
task add proj:house.repair buy shelf brackets
|
||||||
@ -51,11 +51,11 @@ task add pro:house.paint buy brushes
|
|||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task pro:house sum
|
task pro:house sum
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task burndown.daily pro:house
|
task burndown.daily pro:house
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -63,13 +63,13 @@ The summaries will show how fast a project is being completed, and when you can
|
|||||||
|
|
||||||
# Tags
|
# Tags
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task add +buy toothbrush
|
task add +buy toothbrush
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then see only tasks which involve buying something with:
|
You can then see only tasks which involve buying something with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task +buy
|
task +buy
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -77,27 +77,27 @@ task +buy
|
|||||||
|
|
||||||
Set three contexts by their tags:
|
Set three contexts by their tags:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task context define work +sa or +hr
|
task context define work +sa or +hr
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task context define study +ed or +void or +rat
|
task context define study +ed or +void or +rat
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task context define home -sa -hr -ed -void -rat
|
task context define home -sa -hr -ed -void -rat
|
||||||
```
|
```
|
||||||
|
|
||||||
Change to the first context.
|
Change to the first context.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task context work
|
task context work
|
||||||
```
|
```
|
||||||
|
|
||||||
Then stop.
|
Then stop.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task context none
|
task context none
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ task context none
|
|||||||
|
|
||||||
View list of tasks completed in the last week:
|
View list of tasks completed in the last week:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task end.after:today-1wk completed
|
task end.after:today-1wk completed
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -113,19 +113,19 @@ task end.after:today-1wk completed
|
|||||||
|
|
||||||
Make a UDA 'size'.
|
Make a UDA 'size'.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task config uda.size.type string
|
task config uda.size.type string
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task config uda.size.label Size
|
task config uda.size.label Size
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task config uda.size.values large,medium,small
|
task config uda.size.values large,medium,small
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
uda.size.default=medium
|
uda.size.default=medium
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ uda.size.default=medium
|
|||||||
|
|
||||||
This command shows tasks I'm most interested in:
|
This command shows tasks I'm most interested in:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
task next +ACTIVE or +OVERDUE or due:today or scheduled:today or pri:H
|
task next +ACTIVE or +OVERDUE or due:today or scheduled:today or pri:H
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: "timew"
|
title: "timewarrior"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "data", "tracking", "time", "timew" ]
|
||||||
---
|
---
|
||||||
# Summaries
|
# Summaries
|
||||||
|
|
||||||
Try:
|
Try:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew summary :yesterday
|
timew summary :yesterday
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also use :week, :lastweek, :month, :quarter, :year, or a range such as:
|
You can also use :week, :lastweek, :month, :quarter, :year, or a range such as:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew summary today to tomorrow
|
timew summary today to tomorrow
|
||||||
timew today - tomorrow
|
timew today - tomorrow
|
||||||
2018-10-15T06:00 - 2018-10-17T06:00
|
2018-10-15T06:00 - 2018-10-17T06:00
|
||||||
@ -22,7 +22,7 @@ Each of these can gain with the :ids tag.
|
|||||||
|
|
||||||
# Basics
|
# Basics
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew start
|
timew start
|
||||||
timew stop
|
timew stop
|
||||||
timew continue
|
timew continue
|
||||||
@ -32,7 +32,7 @@ timew tags
|
|||||||
|
|
||||||
And add ids with:
|
And add ids with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew summary :ids
|
timew summary :ids
|
||||||
timew track 10am - 1pm timewarrior
|
timew track 10am - 1pm timewarrior
|
||||||
timew track 1pm for 2h walk
|
timew track 1pm for 2h walk
|
||||||
@ -42,50 +42,50 @@ timew track 1pm for 2h walk
|
|||||||
|
|
||||||
First get ids.
|
First get ids.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew summary :ids
|
timew summary :ids
|
||||||
```
|
```
|
||||||
|
|
||||||
Then if we're looking at task @2:
|
Then if we're looking at task @2:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew move @2 12:00
|
timew move @2 12:00
|
||||||
timew lengthen @2 3mins
|
timew lengthen @2 3mins
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
time shorten @2 40mins
|
time shorten @2 40mins
|
||||||
```
|
```
|
||||||
|
|
||||||
# Forgetting
|
# Forgetting
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew start 1h ago @4
|
timew start 1h ago @4
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if your action actually had a break:
|
Or if your action actually had a break:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew split @8
|
timew split @8
|
||||||
```
|
```
|
||||||
|
|
||||||
Or maybe not?
|
Or maybe not?
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew join @4 @8
|
timew join @4 @8
|
||||||
timew @8 delete
|
timew @8 delete
|
||||||
```
|
```
|
||||||
|
|
||||||
Start at previous time
|
Start at previous time
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew start 3pm 'Read chapter 12'
|
timew start 3pm 'Read chapter 12'
|
||||||
timew start 90mins ago 'Read chapter 12'
|
timew start 90mins ago 'Read chapter 12'
|
||||||
```
|
```
|
||||||
|
|
||||||
Cancel currently tracked time.
|
Cancel currently tracked time.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
timew cancel
|
timew cancel
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -157,11 +157,11 @@ with:
|
|||||||
|
|
||||||
# Fixing Errors
|
# Fixing Errors
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
curl -O https://taskwarrior.org/download/timew-dbcorrection.py
|
curl -O https://taskwarrior.org/download/timew-dbcorrection.py
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
python timew-dbcorrections.py
|
python timew-dbcorrections.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
11
data/view_torrents.md
Normal file
11
data/view_torrents.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
title: "View Torrents"
|
||||||
|
tags: [ "data", "transmission", "torrenting" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
transmission-show $file.torrent | less
|
||||||
|
```
|
||||||
|
|
||||||
|
`TRACKERS` shows where transmission will ask who has the torrent, but will probably be out of date.
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "w3m"
|
title: "w3m"
|
||||||
tags: [ "Documentation", "browsers" ]
|
tags: [ "browsers" ]
|
||||||
---
|
---
|
||||||
Open a search tab:
|
Open a search tab:
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ tags: [ "networking", "ssh", "android" ]
|
|||||||
3. Open fdroid, and run:
|
3. Open fdroid, and run:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
pkg upgrade
|
pkg upgrade
|
||||||
pkg install busybox termux-services openssh openssh-sftp-server
|
pkg install busybox termux-services openssh openssh-sftp-server
|
||||||
source $PREFIX/etc/profile.d/start-services.sh
|
source $PREFIX/etc/profile.d/start-services.sh
|
||||||
|
53
distros/arch/Maintenance.md
Normal file
53
distros/arch/Maintenance.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
---
|
||||||
|
title: "Maintenance"
|
||||||
|
tags: [ "arch" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Cache
|
||||||
|
|
||||||
|
Clean the cache of old packages in `/var/cachepacman/pkg/`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls /var/cache/pacman/pkg/ | wc -l
|
||||||
|
sudo pacman -Sc
|
||||||
|
ls /var/cache/pacman/pkg/ | wc -l
|
||||||
|
```
|
||||||
|
And the same for `yay` (with `-Yc` to remove old dependencies):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls ~/.cache/yay/ | wc -l
|
||||||
|
yay -Sc
|
||||||
|
yay -Yc
|
||||||
|
ls ~/.cache/yay/ | wc -l
|
||||||
|
```
|
||||||
|
|
||||||
|
# New Configs
|
||||||
|
|
||||||
|
If you chance a configuration file, such as `/etc/environment`, and `pacman` wants to update the file, it will place `/etc/environment.pacnew`.
|
||||||
|
|
||||||
|
Check the new files, then look at the difference between the `pacman` version, and your version.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo find /etc/ /var/ /usr/ -name "*.pacnew"
|
||||||
|
diff /etc/pacman.d/mirrorlist*
|
||||||
|
```
|
||||||
|
|
||||||
|
Either,
|
||||||
|
|
||||||
|
- Update the files manually,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo -e /etc/pacman.d/mirrorlist
|
||||||
|
sudo rm /etc/pacman.d/mirrorlist.pacnew
|
||||||
|
```
|
||||||
|
|
||||||
|
Or,
|
||||||
|
|
||||||
|
- use a tool like `pacdiff` to view the changes next to each other, and select them with `vim`.
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S pacman-contrib
|
||||||
|
sudo pacdiff
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Arch on a Raspberry Pi 4"
|
title: "Arch on a Raspberry Pi 4"
|
||||||
tags: [ "Documentation", "distros", "raspberry pi", "rpi" ]
|
tags: [ "distros", "raspberry pi", "rpi" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
The [Official Instructions](https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4) for a Raspberry pi 4 do not allow for working sound from the headphone jack, unless you use the aarch64 Installation.
|
The [Official Instructions](https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4) for a Raspberry pi 4 do not allow for working sound from the headphone jack, unless you use the aarch64 Installation.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "autologin"
|
title: "autologin"
|
||||||
tags: [ "Documentation", "Distros", "Arch" ]
|
tags: [ "distros", "arch" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Automatic Login
|
# Automatic Login
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "basic-install"
|
title: "basic-install"
|
||||||
tags: [ "Documentation", "arch" ]
|
tags: [ "arch" ]
|
||||||
|
requires: [ "partitions", "time" ]
|
||||||
---
|
---
|
||||||
Keyboard layout changed.
|
Keyboard layout changed.
|
||||||
|
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
---
|
---
|
||||||
title: "fonts"
|
title: "fonts"
|
||||||
tags: [ "Documentation", "distros" ]
|
tags: [ "distros" ]
|
||||||
---
|
---
|
||||||
# Basics
|
# Basics
|
||||||
|
|
||||||
Update font-cache:
|
Update font-cache:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
|
su root
|
||||||
fc-cache
|
fc-cache
|
||||||
```
|
```
|
||||||
|
|
||||||
List fonts:
|
List fonts:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
fc-list
|
fc-list
|
||||||
```
|
```
|
||||||
|
|
||||||
Grab the part of the font name you need for Xresources:
|
Grab the part of the font name you need for Xresources:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
fc-list | cut -d: -f2
|
fc-list | cut -d: -f2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "fonts"
|
title: "Ach Linux GPU Setup"
|
||||||
tags: [ "Documentation", "distros" ]
|
tags: [ "arch", "GPU" ]
|
||||||
---
|
---
|
||||||
# Step 1: Multilib
|
# Step 1: Multilib
|
||||||
|
|
||||||
@ -60,4 +60,3 @@ You should see 'true' here.
|
|||||||
```bash
|
```bash
|
||||||
sudo pacman -S --needed lib32-mesa vulkan-radeon lib32-vulkan-radeon vulkan-icd-loader lib32-vulkan-icd-loader xf86-video-amdgpu
|
sudo pacman -S --needed lib32-mesa vulkan-radeon lib32-vulkan-radeon vulkan-icd-loader lib32-vulkan-icd-loader xf86-video-amdgpu
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "pacman"
|
title: "pacman"
|
||||||
tags: [ "Documentation", "distros" ]
|
tags: [ "distros" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Packages are kept in /var/cache/pacman/pkg.
|
Packages are kept in /var/cache/pacman/pkg.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "apt"
|
title: "apt"
|
||||||
tags: [ "Documentation", "distros" ]
|
tags: [ "distros" ]
|
||||||
---
|
---
|
||||||
## apt
|
## apt
|
||||||
|
|
||||||
@ -8,27 +8,27 @@ tags: [ "Documentation", "distros" ]
|
|||||||
|
|
||||||
Messed up a package's configuration files?
|
Messed up a package's configuration files?
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo apt-get purge [thing]
|
sudo apt-get purge [thing]
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo apt autoremove
|
sudo apt autoremove
|
||||||
```
|
```
|
||||||
|
|
||||||
Check if you still have related things:
|
Check if you still have related things:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
apt search [thing]
|
apt search [thing]
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo apt-get install [ thing ]
|
sudo apt-get install [ thing ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Still have problems?
|
Still have problems?
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo dpgk --force-confmiss -i /var/cache/apt/archives/[thing]
|
sudo dpgk --force-confmiss -i /var/cache/apt/archives/[thing]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,18 +1,24 @@
|
|||||||
---
|
---
|
||||||
title: "Aeroplane Mode in Void"
|
title: "Aeroplane Mode in Void"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
Put your device in 'aeroplane' mode (e.g. where no trace of signal leaves it) by turning off Wi-Fi and blue-tooth.
|
Put your device in 'aeroplane' mode (e.g. where no trace of signal leaves it) by turning off Wi-Fi and blue-tooth.
|
||||||
|
|
||||||
> sudo sv stop wpa_supplicant bluetoothd
|
```sh
|
||||||
|
su root
|
||||||
|
sv stop wpa_supplicant bluetoothd
|
||||||
|
```
|
||||||
|
|
||||||
Find your device's name with `ip a`.
|
Find your device's name with `ip -color addr`.
|
||||||
If unsure, try this:
|
If unsure, try this:
|
||||||
|
|
||||||
> name=$(ip a | grep -Eo 'wlp\w{3}')
|
```sh
|
||||||
|
name=$(ip a | grep -Eo 'wlp\w{3}')
|
||||||
> echo $name
|
echo $name
|
||||||
|
```
|
||||||
|
|
||||||
Then set that device down:
|
Then set that device down:
|
||||||
|
|
||||||
> sudo ip link set $name down
|
```sh
|
||||||
|
ip link set $name down
|
||||||
|
```
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Void Autologin"
|
title: "Void Autologin"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Make the autologin service:
|
Make the autologin service:
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
---
|
---
|
||||||
title: "extrace"
|
title: "extrace"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
Monitor all processes:
|
Monitor all processes:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
extrace
|
extrace
|
||||||
```
|
```
|
||||||
|
|
||||||
Monitor one process:
|
Monitor one process:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
extrace ls
|
extrace ls
|
||||||
```
|
```
|
||||||
|
|
||||||
Monitor a script:
|
Monitor a script:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
./script.sh | extrace
|
./script.sh | extrace
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9,16 +9,17 @@ Jenkins is janky.
|
|||||||
## Start
|
## Start
|
||||||
Start the service file.
|
Start the service file.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo ln -s /etc/sv/jenkins /var/service
|
su root
|
||||||
sudo sv start jenkins
|
ln -s /etc/sv/jenkins /var/service
|
||||||
|
sv start jenkins
|
||||||
```
|
```
|
||||||
|
|
||||||
Then visit the web interface with `$BROWSER localhost:8080`.
|
Then visit the web interface with `$BROWSER localhost:8080`.
|
||||||
|
|
||||||
If it's not working, try running the command from the run file the first time:
|
If it's not working, try running the command from the run file the first time:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
chpst -u jenkins java -jar /opt/jenkins/jenkins.war
|
chpst -u jenkins java -jar /opt/jenkins/jenkins.war
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -6,13 +6,13 @@ tags: [ "void", "locale" ]
|
|||||||
Check the current locales:
|
Check the current locales:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
locale -a
|
locale -a
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the languages you want by editing `/etc/default/libc-locales`, and uncommenting your choice:
|
Add the languages you want by editing `/etc/default/libc-locales`, and uncommenting your choice:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
#en_DK.UTF-8 UTF-8
|
#en_DK.UTF-8 UTF-8
|
||||||
#en_DK ISO-8859-1
|
#en_DK ISO-8859-1
|
||||||
en_GB.UTF-8 UTF-8
|
en_GB.UTF-8 UTF-8
|
||||||
@ -25,13 +25,14 @@ Now you can generate what you need for those languages.
|
|||||||
However, instead of generating what you need, you're going to generate everything which needs updating:
|
However, instead of generating what you need, you're going to generate everything which needs updating:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo xbps-reconfigure glibc-locales
|
su root
|
||||||
|
xbps-reconfigure glibc-locales
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, select your chosen locale by placing it in `/etc/locale.conf`.
|
Finally, select your chosen locale by placing it in `/etc/locale.conf`.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo "LC_ALL=en_GB.UTF-8
|
echo "LC_ALL=en_GB.UTF-8
|
||||||
LANG=en_GB.UTF-8
|
LANG=en_GB.UTF-8
|
||||||
LANGUAGE=en_GB.UTF-8" > /etc/locale.conf
|
LANGUAGE=en_GB.UTF-8" > /etc/locale.conf
|
||||||
@ -48,7 +49,7 @@ en_GB ISO-8859-1
|
|||||||
Check your new locales are available:
|
Check your new locales are available:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
locale -a
|
locale -a
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "sv"
|
title: "sv"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
# List Services
|
# List Services
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Void Linux Basics"
|
title: "Void Linux Basics"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
# Updates
|
# Updates
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "xbps"
|
title: "xbps"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "void" ]
|
||||||
---
|
---
|
||||||
## Search
|
## Search
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "brightness"
|
title: "brightness"
|
||||||
tags: [ "Documentation", "hardware" ]
|
tags: [ "hardware", "laptop" ]
|
||||||
---
|
---
|
||||||
# Brightness
|
# Brightness
|
||||||
|
|
||||||
|
66
hardware/keyboard.md
Normal file
66
hardware/keyboard.md
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: "keyboard"
|
||||||
|
tags: [ "keyboard", "vim" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
# System-Wide Capslock and Escape Swap
|
||||||
|
|
||||||
|
This works everywhere, including in a bare-ass tty.
|
||||||
|
|
||||||
|
Select a keymap, and create a new custom map.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
su root
|
||||||
|
ls /usr/share/kbd/keymaps/i386/qwerty/
|
||||||
|
|
||||||
|
basemap=/usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz
|
||||||
|
newmap=/usr/share/kbd/keymaps/custom.map.gz
|
||||||
|
|
||||||
|
gunzip -c $basemap | \
|
||||||
|
sed 's/Caps_Lock/\n/g;s/Escape/Caps_Lock/g;s/\n/Escape/g' | \
|
||||||
|
gzip > $newmap
|
||||||
|
```
|
||||||
|
|
||||||
|
Tell the system to use this keymap at startup by naming it in the `rc.conf` file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo "KEYMAP=$newmap" >> /etc/rc.conf
|
||||||
|
|
||||||
|
cat /etc/rc.conf
|
||||||
|
reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
# Set Layout with X Display
|
||||||
|
|
||||||
|
Set layout to British English.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
setxkbmap -layout gb
|
||||||
|
```
|
||||||
|
|
||||||
|
Or Polish with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
setxkbmap -layout pl
|
||||||
|
```
|
||||||
|
|
||||||
|
| Language | short |
|
||||||
|
|:---------|:------|
|
||||||
|
| Polish | `pl` |
|
||||||
|
| Serbian | `rs` |
|
||||||
|
|
||||||
|
Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle
|
||||||
|
```
|
||||||
|
|
||||||
|
## Alt_GR
|
||||||
|
|
||||||
|
Remap, e.g., the right Windows key, to Alt_Gr.
|
||||||
|
|
||||||
|
```
|
||||||
|
key <RWIN> {[ ISO_Level3_Shift ]};
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
|||||||
---
|
|
||||||
title: "keyboard"
|
|
||||||
tags: [ "Documentation", "keyboard" ]
|
|
||||||
---
|
|
||||||
# Set Layout with X Display
|
|
||||||
|
|
||||||
Set layout to British English.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
setxkbmap -layout gb
|
|
||||||
```
|
|
||||||
|
|
||||||
Or Polish with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
setxkbmap -layout pl
|
|
||||||
```
|
|
||||||
|
|
||||||
| Language | short |
|
|
||||||
|:--------|:------|
|
|
||||||
| Polish | pl |
|
|
||||||
| Serbian | rs |
|
|
||||||
|
|
||||||
Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle
|
|
||||||
```
|
|
||||||
|
|
||||||
## Alt_GR
|
|
||||||
|
|
||||||
Remap, e.g., the right Windows key, to Alt_Gr.
|
|
||||||
|
|
||||||
```
|
|
||||||
key <RWIN> {[ ISO_Level3_Shift ]};
|
|
||||||
```
|
|
||||||
|
|
||||||
# Set TTY Keymap
|
|
||||||
|
|
||||||
Copy your keymap, e.g. if it's polish-1, then:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cp /usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz /usr/share/kbd/keymaps/*custom*.map.gz
|
|
||||||
```
|
|
||||||
|
|
||||||
Then change that map:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo vim /usr/share/kbd/keymaps/custom.map.gz
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
You can switch Escape and Caps Lock with a single line:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo sh -c "gunzip -c /usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz | sed 's/ Escape/ PLACEHOLDER/ ; s/Caps_Lock/Escape/g ; s/PLACEHOLDER/Caps_Lock/' | gzip > /usr/share/kbd/keymaps/custom.map.gz"
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Change the default keyboard mapping to the custom map:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
echo 'KEYMAP="/usr/share/kbd/keymaps/*custom*.map.gz"' | sudo tee /etc/vconsole.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
Reboot to have changes take effect.
|
|
@ -1,37 +0,0 @@
|
|||||||
☢ ☣ s ☠ ⚠
|
|
||||||
radioactive sign biohazard sign skull and crossbones warning sign
|
|
||||||
☤ ⚕ ⚚ †
|
|
||||||
caduceus staff of aesculapius staff of hermes dagger
|
|
||||||
☯ ⚖ ☮ ⚘
|
|
||||||
yin yang scales peace flower
|
|
||||||
⚔ ☭ ⚒ ⚓
|
|
||||||
crossed swords hammer and sickle hammer and pick anchor
|
|
||||||
⚛ ⚜ ⚡ ⚶
|
|
||||||
atom symbol fleur-de-lis lightning vesta
|
|
||||||
☥ ✠ ✙ ✞
|
|
||||||
ankh cross cross cross
|
|
||||||
✟ ✧ ⋆ ★
|
|
||||||
cross diamond star star
|
|
||||||
☆ ✪ ✫ ✬
|
|
||||||
star star star star
|
|
||||||
✭ ✮ ✯ ✰
|
|
||||||
star star star star
|
|
||||||
≪
|
|
||||||
☸ ✵ ❂ ☘
|
|
||||||
wheel of dharma star sun shamrock
|
|
||||||
♡ ♥ ❤ ⚘
|
|
||||||
heart heart big heart flower
|
|
||||||
❀ ❃ ❁ ✼
|
|
||||||
flower flower flower flower
|
|
||||||
☀ ✌ ♫ ♪
|
|
||||||
sun V sign music note / melody music note / melody
|
|
||||||
☃ ❄ ❅ ❆
|
|
||||||
snowman snowflake snowflake snowflake
|
|
||||||
☕ ☂ ❦ ✈
|
|
||||||
cofee umbrella floral heart / leaf airplane
|
|
||||||
♕ ♛ ♖ ♜
|
|
||||||
white king / crown black king / crown white rook / tower black rook / tower
|
|
||||||
☁ ☾
|
|
||||||
cloud waning crescent moon
|
|
||||||
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
|||||||
---
|
---
|
||||||
title: "monitor"
|
title: "monitor"
|
||||||
tags: [ "Documentation", "hardware" ]
|
tags: [ "hardware" ]
|
||||||
---
|
---
|
||||||
See screen size
|
See screen size
|
||||||
|
|
||||||
> xrandr -q
|
```sh
|
||||||
|
xrandr -q
|
||||||
|
```
|
||||||
|
|
||||||
Automatically configure:
|
Automatically configure:
|
||||||
|
|
||||||
> xrandr --auto
|
```sh
|
||||||
|
xrandr --auto
|
||||||
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "printers"
|
title: "printers"
|
||||||
tags: [ "Documentation", "hardware" ]
|
tags: [ "hardware" ]
|
||||||
---
|
---
|
||||||
# Cups: The Common Unix Printing System
|
# Cups: The Common Unix Printing System
|
||||||
|
|
||||||
|
20
networking/bad_horse.md
Normal file
20
networking/bad_horse.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
title: "Mapping the Net"
|
||||||
|
tags: [ "networking", "graph", "fun" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Find the path to a domain:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
domain=bad.horse
|
||||||
|
max_hops=50
|
||||||
|
|
||||||
|
tracepath -m $maximum_hops $domain
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're on Debian, you can use `graph-easy` and `dothost` to make an instant diagram:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
domain=dice.camp
|
||||||
|
dothost $domain | graph-easy --boxart
|
||||||
|
```
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "fail2ban"
|
title: "fail2ban"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
|
requires: [ "ssh" ]
|
||||||
---
|
---
|
||||||
# SSH Daemon Jail
|
# SSH Daemon Jail
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Easy Network Graph"
|
title: "Easy Network Graph"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
Set up a file like this, called `troubleshooting.txt`.
|
Set up a file like this, called `troubleshooting.txt`.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "iptables"
|
title: "iptables"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
# Intro
|
# Intro
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "nmap"
|
title: "nmap"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "pi-hole-server"
|
title: "pi-hole-server"
|
||||||
tags: [ "Documentation", "Distros" ]
|
tags: [ "distros" ]
|
||||||
---
|
---
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "rclone"
|
title: "rclone"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking", "synch" ]
|
||||||
---
|
---
|
||||||
The manpage's 'Synopsis' provides a fast reference.
|
The manpage's 'Synopsis' provides a fast reference.
|
||||||
```
|
```
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Download videos"
|
title: "Download videos"
|
||||||
tags: [ "Documentation", "Scraping" ]
|
tags: [ "scraping" ]
|
||||||
---
|
---
|
||||||
Install `yt-dlp`.
|
Install `yt-dlp`.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Agate on Arch Linux"
|
title: "Agate on Arch Linux"
|
||||||
tags: [ "Documentation", "Networking", "Arch", "Gemini" ]
|
tags: [ "networking", "arch", "gemini" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Docs are [here](https://github.com/mbrubeck/agate).
|
Docs are [here](https://github.com/mbrubeck/agate).
|
||||||
|
@ -7,7 +7,7 @@ tags: [ "networking" ]
|
|||||||
Try out basic ssh by accessing `git.charm.sh`, without needing authentication:
|
Try out basic ssh by accessing `git.charm.sh`, without needing authentication:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ssh git.charm.sh
|
ssh git.charm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -16,32 +16,32 @@ The ssh server is sometimes in a package called `openssh`, and sometimes only in
|
|||||||
|
|
||||||
Once it's installed, check it's working:
|
Once it's installed, check it's working:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo systemctl status ssh
|
sudo systemctl status ssh
|
||||||
```
|
```
|
||||||
|
|
||||||
If that doesn't work, the service may be called `sshd`.
|
If that doesn't work, the service may be called `sshd`.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo systemctl status sshd
|
sudo systemctl status sshd
|
||||||
```
|
```
|
||||||
|
|
||||||
Then start that service:
|
Then start that service:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo systemctl start sshd
|
sudo systemctl start sshd
|
||||||
```
|
```
|
||||||
Test it works by using ssh into your own system, from inside:
|
Test it works by using ssh into your own system, from inside:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ssh $USER@localhost
|
ssh $USER@localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
Access the computer from another computer on the same local network by finding your computer's IP address.
|
Access the computer from another computer on the same local network by finding your computer's IP address.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ip address | grep inet
|
ip address | grep inet
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -56,24 +56,24 @@ Here is mine:
|
|||||||
|
|
||||||
|
|
||||||
The first one starts `127`, which means it returns back to that computer (like `localhost`).
|
The first one starts `127`, which means it returns back to that computer (like `localhost`).
|
||||||
The second is an ipv6 address, which is too angelic for this world, and has yet to ascend.
|
The second is an ipv6 address, which is too angelic for this world, and has yet to descend.
|
||||||
The third will work from a remote computer.
|
The third will work from a remote computer.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ssh $USERNAME@IP_ADDRESS
|
ssh $USERNAME@IP_ADDRESS
|
||||||
```
|
```
|
||||||
|
|
||||||
Once you have that, generate some ssh keys:
|
Once you have that, generate some ssh keys:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ssh-keygen
|
ssh-keygen
|
||||||
```
|
```
|
||||||
|
|
||||||
Look at your keys:
|
Look at your keys:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ls ~/.ssh
|
ls ~/.ssh
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ The other is secret.
|
|||||||
|
|
||||||
Now send those keys to a remote computer:
|
Now send those keys to a remote computer:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ssh-copy-id $USERNAME@IP_ADDRESS
|
ssh-copy-id $USERNAME@IP_ADDRESS
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "sshfs"
|
title: "sshfs"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
|
requires: [ "ssh" ]
|
||||||
---
|
---
|
||||||
# Mount
|
# Mount
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "ssh tricks"
|
title: "ssh-tricks"
|
||||||
tags: [ "Documentation", "Networking", "ssh", "tricks" ]
|
tags: [ "networking", "ssh", "tricks" ]
|
||||||
|
requires: [ "ssh" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Mount a remote filesystem locally with fuse-sshfs:
|
Mount a remote filesystem locally with fuse-sshfs:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: "tor"
|
title: "tor"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Get a hostname
|
# Get a Hostname
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo vim /etc/tor/torrc
|
sudo vim /etc/tor/torrc
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "transmission"
|
title: "transmission"
|
||||||
tags: [ "Documentation", "Networking", "Torrenting" ]
|
tags: [ "networking", "torrenting" ]
|
||||||
---
|
---
|
||||||
# Torrench
|
# Torrench
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
title: "troubleshooting"
|
title: "troubleshooting"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Do you have an IP?
|
# Do you have an IP?
|
||||||
|
|
||||||
If not, try checking out what your local Networking interfaces are, then check if they have been picked up:
|
If not, try checking out what your local networking interfaces are, then check if they have been picked up:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dmesg | grep eth0
|
dmesg | grep eth0
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "nginx"
|
title: "nginx"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking", "web" ]
|
||||||
---
|
---
|
||||||
Install nginx:
|
Install nginx:
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "wifi"
|
title: "network"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Netstat Stuff
|
# Netstat Stuff
|
||||||
|
|
||||||
Stats on local net usage within domain.
|
Stats on local net usage within domain.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "wireguard"
|
title: "wireguard"
|
||||||
tags: [ "Documentation", "Networking", "VPN" ]
|
tags: [ "networking", "VPN" ]
|
||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
from
|
from
|
||||||
@ -11,25 +11,22 @@ https://engineerworkshop.com/blog/how-to-set-up-wireguard-on-a-raspberry-pi/
|
|||||||
|
|
||||||
Install `wireguard-tools` on the server.
|
Install `wireguard-tools` on the server.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
sudo -i
|
su root
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd /etc/wireguard
|
cd /etc/wireguard
|
||||||
```
|
```
|
||||||
|
|
||||||
umask 077
|
umask 077
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wg genkey | tee server_private_key | wg pubkey > server_public_key
|
wg genkey | tee server_private_key | wg pubkey > server_public_key
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
wg genkey | tee client_private_key | wg pubkey > client_public_key
|
wg genkey | tee client_private_key | wg pubkey > client_public_key
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo "
|
echo "
|
||||||
[Interface]
|
[Interface]
|
||||||
Address = 10.0.0.1/24
|
Address = 10.0.0.1/24
|
||||||
@ -46,20 +43,20 @@ wg genkey | tee client_private_key | wg pubkey > client_public_key
|
|||||||
" > /etc/wireguard/wg0.conf
|
" > /etc/wireguard/wg0.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/wg.conf
|
echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/wg.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
systemctl enable --now wg-quiqck@wg0
|
systemctl enable --now wg-quiqck@wg0
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
chown -R root:root /etc/wireguard/
|
chown -R root:root /etc/wireguard/
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
chmod -R og-rwx /etc/wireguard/\*
|
chmod -R og-rwx /etc/wireguard/*
|
||||||
```
|
```
|
||||||
|
|
||||||
Forward traffic from port 51900 to the server.
|
Forward traffic from port 51900 to the server.
|
||||||
@ -72,21 +69,25 @@ Install `wireguard-tools` on the client.
|
|||||||
|
|
||||||
Copy the client private key and 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).
|
||||||
|
|
||||||
> server_ip=*your server's public ip*
|
|
||||||
|
|
||||||
echo "
|
```sh
|
||||||
[Interface]
|
server_ip=$PUBLIC_IP
|
||||||
Address = 10.0.0.2/32
|
|
||||||
PrivateKey = $(cat client_private_key)
|
|
||||||
DNS = 9.9.9.9
|
|
||||||
|
|
||||||
[Peer]
|
|
||||||
PublicKey = $(cat server_public_key)
|
|
||||||
Endpoint = $(echo $server_ip:51900)
|
|
||||||
AllowedIPs = 0.0.0.0/0, ::/0
|
|
||||||
" > /etc/wireguard/wg0-client.conf
|
|
||||||
|
|
||||||
> wg-quick up wg0-client
|
echo "
|
||||||
|
[Interface]
|
||||||
|
Address = 10.0.0.2/32
|
||||||
|
PrivateKey = $(cat client_private_key)
|
||||||
|
DNS = 9.9.9.9
|
||||||
|
|
||||||
|
[Peer]
|
||||||
|
PublicKey = $(cat server_public_key)
|
||||||
|
Endpoint = $(echo $server_ip:51900)
|
||||||
|
AllowedIPs = 0.0.0.0/0, ::/0
|
||||||
|
" > /etc/wireguard/wg0-client.conf
|
||||||
|
|
||||||
|
wg-quick up wg0-client
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Extras
|
## Extras
|
||||||
|
|
||||||
@ -98,6 +99,6 @@ Add multiple peers by copying the `[peer]` section (they each get called `peer`)
|
|||||||
|
|
||||||
Make a standard client configuration, then:
|
Make a standard client configuration, then:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
qrencode -t ansiutf8 < /etc/wireguard/mobile_user.conf
|
qrencode -t ansiutf8 < /etc/wireguard/mobile_user.conf
|
||||||
```
|
```
|
||||||
|
@ -1,60 +1,63 @@
|
|||||||
---
|
---
|
||||||
title: "wireless"
|
title: "wireless"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Check wifi's working
|
Check wifi's working
|
||||||
```bash
|
|
||||||
|
```sh
|
||||||
lspci -k
|
lspci -k
|
||||||
```
|
```
|
||||||
|
|
||||||
Or for usb wifi:
|
Or for usb wifi:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
dmesg | grep usbcore
|
dmesg | grep usbcore
|
||||||
```
|
```
|
||||||
|
|
||||||
... and hopefully it'll say the new interface is registered.
|
...and hopefully it'll say the new interface is registered.
|
||||||
|
|
||||||
# Check if a wifi interface has been created
|
Check if a wifi interface has been created
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ip link
|
ip link
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
...or
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
iw dev
|
iw dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Assuming it's wlan0, bring it up with
|
Assuming it's wlan0, bring it up with
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
ip link set wlan0 up
|
ip link set wlan0 up
|
||||||
```
|
```
|
||||||
|
|
||||||
Error messages probably means your wireless chipset requires a firmware to function. In this case, check the kernel messages for firmware being loaded
|
Error messages probably means your wireless chipset requires a firmware to function. In this case, check the kernel messages for firmware being loaded
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
dmesg | grep firmware
|
dmesg | grep firmware
|
||||||
```
|
```
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
|
|
||||||
iw doesn't do wpa/wpa2. wpa_supplicant does everything. iwd does everything except WEXT encryption.
|
- `iw` doesn't do wpa/wpa2.
|
||||||
|
- `iwd` does everything except WEXT encryption.
|
||||||
|
- `wpa_supplicant` does everything.
|
||||||
|
|
||||||
# Connecting
|
# Connecting
|
||||||
|
|
||||||
Get the link status:
|
Get the link status:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
iw dev wlan0 link
|
iw dev wlan0 link
|
||||||
```
|
```
|
||||||
|
|
||||||
Scan for available points:
|
Scan for available points:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
iw dev wlan0 scan
|
iw dev wlan0 scan
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user