forked from andonome/lk
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
71
Makefile
Normal file
71
Makefile
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
MAKEFLAGS += -j
|
||||||
|
MAKEFLAGS += -s
|
||||||
|
EDITOR ?= vi
|
||||||
|
FZF != command -v sk || command -v fzy || command -v fzf || \
|
||||||
|
{ echo install a fuzzy finder && exit 1 ;}
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
categories != ls -d */
|
||||||
|
|
||||||
|
databases = $(patsubst %/, .dbs/%.rec, $(categories))
|
||||||
|
|
||||||
|
default += $(databases)
|
||||||
|
|
||||||
|
$(databases): .dbs/%.rec: %/ | .dbs/
|
||||||
|
$(info making $(@F))
|
||||||
|
mkdir -p $(@D)
|
||||||
|
for entry in $(shell find $< -type f -name "*.md") ; do \
|
||||||
|
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$entry" |\
|
||||||
|
sed -e 's/\[ //' -e 's/ \]//' |\
|
||||||
|
tr -d '"' ;\
|
||||||
|
printf "wordcount: %s\n" "$$(wc -w < $$entry)" ;\
|
||||||
|
printf "file: %s\n\n" "$$entry" ;\
|
||||||
|
done >> $@
|
||||||
|
for entry in $(shell find $< -type f -name "*.md"); do \
|
||||||
|
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
|
||||||
|
done
|
||||||
|
|
||||||
|
db.rec: $(databases)
|
||||||
|
printf '%s\n' '%rec: guide' > $@
|
||||||
|
printf '%s\n' '%type: wordcount int' >> $@
|
||||||
|
printf '%s\n\n' '%sort: title' >> $@
|
||||||
|
cat $^ >> $@
|
||||||
|
recsel $@ -e "requires != ''" -CR title,requires |\
|
||||||
|
while read title requires; do \
|
||||||
|
IFS=', ' && for provider in $$requires; do \
|
||||||
|
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
||||||
|
done ;\
|
||||||
|
done
|
||||||
|
$(info Created main database: $@)
|
||||||
|
recfix --sort $@
|
||||||
|
|
||||||
|
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" | 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)
|
106
README.md
106
README.md
@ -1,77 +1,79 @@
|
|||||||
---
|
---
|
||||||
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.
|
# Setup
|
||||||
|
|
||||||
|
Install `make`, `recutils`, and any fuzzy-finder (i.e. `sk`, `fzy`, or `fzf`).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make
|
||||||
|
make database
|
||||||
|
|
||||||
|
recsel db.rec -q database
|
||||||
|
recsel db.rec -q gpg
|
||||||
|
recsel db.rec -e "title = 'ssh'"
|
||||||
|
recsel db.rec -e "title ~ 'ssh'"
|
||||||
|
recsel db.rec -e "title ~ 'bash'" -R title,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.
|
## Be Opinionated
|
||||||
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.
|
- Guides should not ask the reader to select options half-way through.
|
||||||
|
- Options for different filesystems, databases, et c., should be written as separate guides.
|
||||||
|
|
||||||
## Chronological
|
## Repetition Beats Reference
|
||||||
|
|
||||||
Entries should read like scripts - everything in the right order, with small notes on what this does.
|
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.
|
||||||
|
|
||||||
The chronology should never branch.
|
## Show Arguments as Variables
|
||||||
If `gitea` can use three different types of database, the documentation should simply pick one and continue instructions from there.
|
|
||||||
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.
|
|
||||||
|
|
||||||
---
|
Look at this line:
|
||||||
|
|
||||||
### Closing
|
```sh
|
||||||
|
grep ls --color=always $HISTFILE | less -R
|
||||||
Introductory documents should show anything required to cleanly uninstall a program, without leaving bulky configuration files behind.
|
|
||||||
|
|
||||||
## Three Input Types
|
|
||||||
|
|
||||||
There are three types of examples:
|
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
# What's Wrong with Everything Else?
|
||||||
|
|
||||||
## Man pages
|
## Man pages
|
||||||
|
|
||||||
@ -79,12 +81,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:
|
||||||
|
|
||||||
@ -64,8 +64,6 @@ atrm 2
|
|||||||
|
|
||||||
Check `/var/spool/atd/` to see the jobs.
|
Check `/var/spool/atd/` to see the jobs.
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Automation
|
## Automation
|
||||||
|
|
||||||
Automatically add a job for later, by setting the date, then using echo for the command.
|
Automatically add a job for later, by setting the date, then using echo for the command.
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
Require at
|
|
||||||
Require atd
|
|
||||||
Sleep 500ms
|
|
||||||
Type "at teatime"
|
|
||||||
Enter
|
|
||||||
Sleep 1.5s
|
|
||||||
Type "./"
|
|
||||||
Sleep 500ms
|
|
||||||
Type "baskup.sh"
|
|
||||||
Sleep 1.5s
|
|
||||||
Enter
|
|
||||||
Sleep 1.5s
|
|
||||||
Ctrl+D
|
|
||||||
Sleep 3.5s
|
|
||||||
Type "atq"
|
|
||||||
Enter
|
|
||||||
Sleep 1.5s
|
|
||||||
Type "atq 1"
|
|
||||||
Sleep 500ms
|
|
||||||
Type "4"
|
|
||||||
Enter
|
|
||||||
Sleep 500ms
|
|
||||||
Type "at"
|
|
||||||
Sleep 1s
|
|
||||||
Type " -c 15"
|
|
||||||
Enter
|
|
||||||
Sleep 1.5s
|
|
||||||
Type "at"
|
|
||||||
Sleep 500ms
|
|
||||||
Type " "
|
|
||||||
Sleep 500ms
|
|
||||||
Type "-"
|
|
||||||
Sleep 500ms
|
|
||||||
Type "c 15 | grep PWD"
|
|
||||||
Enter
|
|
||||||
Sleep 5.5s
|
|
||||||
Type "atrm 15"
|
|
||||||
Sleep 2s
|
|
||||||
Enter
|
|
||||||
Sleep 3s
|
|
||||||
Ctrl+D
|
|
||||||
|
|
@ -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,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "kernel"
|
title: "kernel"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "Basics" ]
|
||||||
---
|
---
|
||||||
## Living Space
|
## Living Space
|
||||||
|
|
||||||
|
@ -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,64 +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
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "users"
|
title: "users"
|
||||||
tags: [ "Documentation", "Basics" ]
|
tags: [ "Basics" ]
|
||||||
---
|
---
|
||||||
# Basic Information
|
# Basic Information
|
||||||
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
Require cmus
|
|
||||||
|
|
||||||
Type "whereis cmus"
|
|
||||||
Enter
|
|
||||||
Sleep 1s
|
|
||||||
Type "which cmus"
|
|
||||||
Enter
|
|
||||||
Sleep 500ms
|
|
||||||
Type "type /bin/cmus"
|
|
||||||
Enter
|
|
||||||
Sleep 5s
|
|
||||||
Type "man cmus"
|
|
||||||
Enter
|
|
||||||
Sleep 1s
|
|
||||||
Type " "
|
|
||||||
Sleep 1s
|
|
||||||
Type " "
|
|
||||||
Sleep 1s
|
|
||||||
Type " "
|
|
||||||
Sleep 500ms
|
|
||||||
Type " "
|
|
||||||
Sleep 1.5s
|
|
||||||
Type " "
|
|
||||||
Sleep 500ms
|
|
||||||
Type " "
|
|
||||||
Sleep 1.5s
|
|
||||||
Type " "
|
|
||||||
Sleep 500ms
|
|
||||||
Type " q"
|
|
||||||
Sleep 500ms
|
|
||||||
Type "cmus"
|
|
||||||
Sleep 3s
|
|
||||||
Ctrl+D
|
|
@ -1,11 +0,0 @@
|
|||||||
Require yay
|
|
||||||
|
|
||||||
Set Shell "bash"
|
|
||||||
Set FontSize 20
|
|
||||||
Set Width 1400
|
|
||||||
Set Height 900
|
|
||||||
|
|
||||||
Sleep 2s
|
|
||||||
|
|
||||||
|
|
||||||
Type "yes | yay"
|
|
@ -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`
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
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).
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Base 16"
|
title: "Base 16"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "Data" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "exiftool"
|
title: "exiftool"
|
||||||
tags: [ "Documentation", "Metadata" ]
|
tags: [ "Metadata" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Find metadata.
|
Find metadata.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "git"
|
title: "git"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
# Starting
|
# Starting
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "git-lfs"
|
title: "git-lfs"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Install, and add with
|
Install, and add with
|
||||||
|
@ -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"
|
||||||
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"
|
||||||
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" ]
|
||||||
---
|
---
|
||||||
# Basic Documents
|
# Basic Documents
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "khard"
|
title: "khard"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "Data" ]
|
||||||
---
|
---
|
||||||
Get the basic config:
|
Get the basic config:
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "pass"
|
title: "pass"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
[Video instructions](https://www.hooktube.com/watch?v=hlRQTj1D9LA)
|
[Video instructions](https://www.hooktube.com/watch?v=hlRQTj1D9LA)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
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 pdf book images to text (results are very poor, and will need lots of corrections).
|
||||||
|
|
||||||
|
@ -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'.
|
||||||
|
|
||||||
|
|
||||||
|
51
data/recfiles.md
Normal file
51
data/recfiles.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
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)
|
||||||
|
|
||||||
|
# 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
|
||||||
|
```
|
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
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "sc-im"
|
title: "sc-im"
|
||||||
tags: [ "Documentation", "TUI", "data" ]
|
tags: [ "TUI", "data", "spreadsheet", ".csv" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
- [Sample file](sc-im/sample.sc)
|
- [Sample file](sc-im/sample.sc)
|
||||||
@ -47,7 +47,6 @@ echo 'set autowrap' >> .config/sc-im/scimrc
|
|||||||
|:----------------------|:---:|
|
|:----------------------|:---:|
|
||||||
| text (left align) | < |
|
| text (left align) | < |
|
||||||
| text (right align) | > |
|
| text (right align) | > |
|
||||||
| text (right align) | `|` |
|
|
||||||
| Edit existing text | E |
|
| Edit existing text | E |
|
||||||
|
|
||||||
### Meta Actions
|
### Meta Actions
|
||||||
@ -62,26 +61,6 @@ echo 'set autowrap' >> .config/sc-im/scimrc
|
|||||||
| paste with format | Pc |
|
| paste with format | Pc |
|
||||||
| delete a cell | x |
|
| delete a cell | x |
|
||||||
|
|
||||||
# Movement
|
|
||||||
|
|
||||||
| Action | Key |
|
|
||||||
|:-------------------------------:|:---:|
|
|
||||||
| highest part | H |
|
|
||||||
| lowest part | L |
|
|
||||||
| top | gg |
|
|
||||||
| move right | g$ |
|
|
||||||
| move left | g0 |
|
|
||||||
| insert middle | \ |
|
|
||||||
| insert left | \> |
|
|
||||||
| insert right | < |
|
|
||||||
| to to cell b4 | b4 |
|
|
||||||
| see all text in cells | aa |
|
|
||||||
| format cells so you can see it. | f |
|
|
||||||
| format wider right | fl |
|
|
||||||
| format smaller left | fh |
|
|
||||||
| format wider down | fj |
|
|
||||||
| format smaller down | fk |
|
|
||||||
|
|
||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
|
|
||||||
|
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$'
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Soft Serve through https"
|
title: "Soft Serve through https"
|
||||||
tags: [ "data", "git" ]
|
tags: [ "data", "git server", "lfs" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
## `http` Setup
|
## `http` Setup
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "sqlite"
|
title: "sqlite"
|
||||||
tags: [ "Documentation", "data" ]
|
tags: [ "data" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Work with a database:
|
Work with a database:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "task"
|
title: "task"
|
||||||
tags: [ "Documentation", "Organization" ]
|
tags: [ "Organization" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Set up the configuration file:
|
Set up the configuration file:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "timew"
|
title: "timewarrior"
|
||||||
tags: [ "Documentation", "Data" ]
|
tags: [ "Data", "tracking", "time", "timew" ]
|
||||||
---
|
---
|
||||||
# Summaries
|
# Summaries
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "w3m"
|
title: "w3m"
|
||||||
tags: [ "Documentation", "browsers" ]
|
tags: [ "browsers" ]
|
||||||
---
|
---
|
||||||
Open a search tab:
|
Open a search tab:
|
||||||
|
|
||||||
@ -19,4 +19,3 @@ w3m ddg.gg
|
|||||||
| T | new tab |
|
| T | new tab |
|
||||||
| { / } | switch tabs |
|
| { / } | switch tabs |
|
||||||
|
|
||||||

|
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
Require w3m
|
|
||||||
|
|
||||||
Sleep 1s
|
|
||||||
Type "w3m ddg.gg"
|
|
||||||
Sleep 500ms
|
|
||||||
Enter
|
|
||||||
Sleep 1.5s
|
|
||||||
Tab
|
|
||||||
Enter
|
|
||||||
Type "cats"
|
|
||||||
Enter
|
|
||||||
Sleep 2s
|
|
||||||
Tab
|
|
||||||
Enter
|
|
||||||
Sleep 2s
|
|
||||||
Type "jjjjjjjjjjjj"
|
|
||||||
Tab
|
|
||||||
Enter
|
|
||||||
Sleep 2s
|
|
||||||
Type "U"
|
|
||||||
Sleep 500ms
|
|
||||||
Ctrl+U
|
|
||||||
Sleep 500ms
|
|
||||||
Type "dmz.rs"
|
|
||||||
Sleep 500ms
|
|
||||||
Enter
|
|
||||||
Sleep 4.5s
|
|
||||||
Type "jjjjjjjj"
|
|
||||||
Tab
|
|
||||||
Type "j"
|
|
||||||
Sleep 500ms
|
|
||||||
Enter
|
|
||||||
Sleep 1s
|
|
||||||
Type " "
|
|
||||||
Sleep 2s
|
|
||||||
Backspace
|
|
||||||
Sleep 500ms
|
|
||||||
Type " "
|
|
||||||
Sleep 1.5s
|
|
||||||
Type " "
|
|
||||||
Sleep 2s
|
|
||||||
Type "qy"
|
|
||||||
Sleep 500ms
|
|
@ -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: "fonts"
|
||||||
tags: [ "Documentation", "distros" ]
|
tags: [ "distros" ]
|
||||||
---
|
---
|
||||||
# Step 1: Multilib
|
# Step 1: Multilib
|
||||||
|
|
||||||
|
@ -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 a`.
|
||||||
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,28 +0,0 @@
|
|||||||
Require xbps-query
|
|
||||||
Require xbps-install
|
|
||||||
|
|
||||||
Set Shell "bash"
|
|
||||||
Set FontSize 20
|
|
||||||
Set Width 1400
|
|
||||||
Set Height 900
|
|
||||||
|
|
||||||
Type "sudo xbps-install --sync" Enter Sleep 700ms Enter
|
|
||||||
|
|
||||||
Type "sudo xbps-install --update --yes" Sleep 700ms
|
|
||||||
|
|
||||||
Backspace 33
|
|
||||||
|
|
||||||
Type "echo same but faster!" Sleep 200ms Enter
|
|
||||||
|
|
||||||
Type "sudo xbps-install -uy" Enter Sleep 700ms
|
|
||||||
|
|
||||||
Type "echo now we just download" Sleep 2s Enter
|
|
||||||
|
|
||||||
Type "sudo xbps-install -SD --yes" Sleep 700ms Enter
|
|
||||||
|
|
||||||
Type "echo and install from the downloaded updates..." Sleep 2s Enter
|
|
||||||
|
|
||||||
Type "sudo xbps-install -Du" Sleep 700ms Enter
|
|
||||||
|
|
||||||
Sleep 4s
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
Require xbps-query
|
|
||||||
Require xbps-install
|
|
||||||
|
|
||||||
Set Shell "bash"
|
|
||||||
#Set FontSize 20
|
|
||||||
#Set Width 1400
|
|
||||||
#Set Height 900
|
|
||||||
|
|
||||||
#Hide
|
|
||||||
#
|
|
||||||
#Type "sudo xbps-remove -y cowsay xcowsay aerc"
|
|
||||||
|
|
||||||
Show
|
|
||||||
|
|
||||||
Type "xbps-query cows" Enter Sleep 1s
|
|
||||||
|
|
||||||
Type "nothing..."
|
|
||||||
|
|
||||||
Backspace 11
|
|
||||||
|
|
||||||
Type "xbps-query --search cows" Sleep 500ms Enter
|
|
||||||
|
|
||||||
Type "xbps-query --repository --search cows" Sleep 500ms Enter
|
|
||||||
|
|
||||||
Type "echo same but faster!" Sleep 200ms Enter
|
|
||||||
|
|
||||||
Type "xbps-query -Rs cows" Sleep 500ms Enter
|
|
||||||
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Type "sudo xbps-install -y xcowsay" Enter Sleep 700ms Enter
|
|
||||||
|
|
||||||
Sleep 5
|
|
||||||
|
|
||||||
Type "xbps-query --repository --search 'email'" Sleep 300ms Enter
|
|
||||||
|
|
||||||
Type "too much...." Sleep 1s
|
|
||||||
|
|
||||||
Backspace 13
|
|
||||||
|
|
||||||
Sleep 1s
|
|
||||||
|
|
||||||
Type "xbps-query -R --search '^email'" Sleep 300ms Enter
|
|
||||||
|
|
||||||
Sleep 2s
|
|
||||||
|
|
||||||
Type "xbps-query -Rs --regex '^email terminal'" Sleep 300ms Enter
|
|
||||||
|
|
||||||
Type "???" Sleep 2s
|
|
||||||
|
|
||||||
Backspace 3
|
|
||||||
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Type "regex first!" Sleep 2s
|
|
||||||
|
|
||||||
Backspace 12
|
|
||||||
|
|
||||||
Type "xbps-query --regex -Rs '^email.*terminal'" Sleep 300ms Enter Sleep 900ms
|
|
||||||
|
|
||||||
Type "xbps-query --regex -Rs '^terminal.*email'" Sleep 300ms Enter Sleep 900ms
|
|
||||||
|
|
||||||
Type "sudo xbps-install aerc" Enter Sleep 300ms Enter Sleep 2s
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
Require xbps-query
|
|
||||||
Require xbps-install
|
|
||||||
|
|
||||||
Set Shell "bash"
|
|
||||||
#Set FontSize 20
|
|
||||||
#Set Width 1400
|
|
||||||
#Set Height 900
|
|
||||||
|
|
||||||
Type "sudo xbps-remove --yes thunderbird" Enter Sleep 2s
|
|
||||||
|
|
||||||
Type "time to kill orphans" Sleep 600ms
|
|
||||||
|
|
||||||
Backspace 21
|
|
||||||
|
|
||||||
Enter
|
|
||||||
|
|
||||||
Type "xbps-remove --remove-orphans --dry-run" Sleep 700ms
|
|
||||||
|
|
||||||
Backspace 38
|
|
||||||
|
|
||||||
Enter
|
|
||||||
|
|
||||||
Type "xbps-remove -on | cowsay" Sleep 300ms Enter Sleep 1.5s
|
|
||||||
|
|
||||||
Type "sudo xbps-remove --yes -o" Sleep 700ms Enter
|
|
||||||
|
|
||||||
Sleep 2s
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "xbps"
|
title: "xbps"
|
||||||
tags: [ "Documentation", "Void" ]
|
tags: [ "Void" ]
|
||||||
---
|
---
|
||||||
## Search
|
## Search
|
||||||
|
|
||||||
@ -22,8 +22,6 @@ Search with regex:
|
|||||||
xbps-query --regex -Rs 'cow(s)?\w'
|
xbps-query --regex -Rs 'cow(s)?\w'
|
||||||
```
|
```
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
List what's required for cowsay
|
List what's required for cowsay
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -70,8 +68,6 @@ Upgrade current packages.
|
|||||||
xbps-install -Suv
|
xbps-install -Suv
|
||||||
```
|
```
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Remove/ Uninstall
|
## Remove/ Uninstall
|
||||||
|
|
||||||
Remove cowsay
|
Remove cowsay
|
||||||
@ -94,8 +90,6 @@ xbps-remove -o
|
|||||||
|
|
||||||
Show information about cowsay
|
Show information about cowsay
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
Reinstall cowsay
|
Reinstall cowsay
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "brightness"
|
title: "brightness"
|
||||||
tags: [ "Documentation", "hardware" ]
|
tags: [ "hardware", "laptop" ]
|
||||||
---
|
---
|
||||||
# Brightness
|
# Brightness
|
||||||
|
|
||||||
|
65
hardware/keyboard.md
Normal file
65
hardware/keyboard.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
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.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
su root
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo "KEYMAP=$newmap" >> /etc/rc.conf
|
||||||
|
|
||||||
|
cat /etc/rc.conf
|
||||||
|
reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
# 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 ]};
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
@ -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" ]
|
||||||
---
|
---
|
||||||
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).
|
||||||
|
@ -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,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "tor"
|
title: "tor"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Get a hostname
|
# Get a hostname
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "transmission"
|
title: "transmission"
|
||||||
tags: [ "Documentation", "Networking", "Torrenting" ]
|
tags: [ "Networking", "Torrenting" ]
|
||||||
---
|
---
|
||||||
# Torrench
|
# Torrench
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "troubleshooting"
|
title: "troubleshooting"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Do you have an IP?
|
# Do you have an IP?
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "nginx"
|
title: "nginx"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
Install nginx:
|
Install nginx:
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "wifi"
|
title: "wifi"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
# Netstat Stuff
|
# Netstat Stuff
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "wireguard"
|
title: "wireguard"
|
||||||
tags: [ "Documentation", "Networking", "VPN" ]
|
tags: [ "Networking", "VPN" ]
|
||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
from
|
from
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "wireless"
|
title: "wireless"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Check wifi's working
|
# Check wifi's working
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "wpa_supplicant"
|
title: "wpa_supplicant"
|
||||||
tags: [ "Documentation", "Networking" ]
|
tags: [ "Networking" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
wpa_supplicant configurations are stored in /etc/wpa_supplicant/wpa_supplicant-wlan0 (or equivalent).
|
wpa_supplicant configurations are stored in /etc/wpa_supplicant/wpa_supplicant-wlan0 (or equivalent).
|
||||||
|
27
new.sh
27
new.sh
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo Select a category
|
|
||||||
|
|
||||||
category="$(find . -type d -printf '%P\n' | fzy)"
|
|
||||||
|
|
||||||
[ ! -d "$category" ] && mkdir "$category"
|
|
||||||
|
|
||||||
echo Select a name
|
|
||||||
|
|
||||||
read name
|
|
||||||
|
|
||||||
filePath="$category/$(echo $name | sed 's/ /_/g').md"
|
|
||||||
|
|
||||||
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
|
|
||||||
|
|
||||||
[ -e "$filePath" ] && $EDITOR "$filePath" && exit 0
|
|
||||||
|
|
||||||
echo "---
|
|
||||||
title: \"$name\"
|
|
||||||
tags: [ $tagsList ]
|
|
||||||
---
|
|
||||||
|
|
||||||
" > "$filePath"
|
|
||||||
|
|
||||||
$EDITOR "$filePath"
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Basic Sound"
|
title: "Basic Sound"
|
||||||
tags: [ "Documentation", "Sound" ]
|
tags: [ "Sound" ]
|
||||||
---
|
---
|
||||||
# Pulse
|
# Pulse
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
title: "festival"
|
title: "festival"
|
||||||
tags: [ "Documentation", "Sound" ]
|
tags: [ "Sound" ]
|
||||||
---
|
---
|
||||||
# Basics
|
# Basics
|
||||||
|
|
||||||
Add your user to the audio group, and install `festival-english`.
|
Add your user to the audio group, and install `festival-english`.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo "(Parameter.set 'Audio_Method 'Audio_Command)" >> /usr/share/festival/voices.scm
|
echo "(Parameter.set 'Audio_Method 'Audio_Command)" >> /usr/share/festival/voices.scm
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
echo "(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")" /usr/share/festival/voices.scm
|
echo "(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")" /usr/share/festival/voices.scm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "mpd"
|
title: "mpd"
|
||||||
tags: [ "Documentation", "Sound" ]
|
tags: [ "Sound" ]
|
||||||
---
|
---
|
||||||
# Setup
|
# Setup
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "ncmpcpp"
|
title: "ncmpcpp"
|
||||||
tags: [ "Documentation", "Sound" ]
|
tags: [ "Sound" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Music Player Daemon
|
# Music Player Daemon
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user