Compare commits
89 Commits
b3258d9f5f
...
vhs
Author | SHA1 | Date | |
---|---|---|---|
77054689b4
|
|||
7e2487f0d3
|
|||
3fec180a14
|
|||
c08ad6f175
|
|||
1a17ffda7f
|
|||
556dba6f29
|
|||
b7a79951c5
|
|||
65217b8673
|
|||
2d95304da4
|
|||
8e64f8f58e
|
|||
3b04aaf8be
|
|||
42886b3c1d
|
|||
1dfdac516b
|
|||
63e4c409bb
|
|||
98dbb5e3d6
|
|||
45eae50c24
|
|||
24bb7014f9
|
|||
92145ac4b7
|
|||
7292e0625e
|
|||
ffa4dbc51a
|
|||
8a86d9dc29
|
|||
641b8fb825
|
|||
a6b8420c26
|
|||
68d3a850c0
|
|||
7e75763cee
|
|||
2d3961e0f5
|
|||
72ad0786c8
|
|||
b64d9de0c4
|
|||
2f328f3b70
|
|||
fa9c8edb1d
|
|||
741e988536
|
|||
a72e2b117d
|
|||
cc574d5358
|
|||
0d76eb0531
|
|||
3bfeacd2d7
|
|||
219ea021e1
|
|||
ed4b54cf7e
|
|||
4e89c5ab9b
|
|||
1732c62734
|
|||
fb157895fb
|
|||
28c6a99b0e
|
|||
30bc3b7055
|
|||
c95ad1076e
|
|||
8f5298bc2f
|
|||
dcfe955cfe
|
|||
1dc717bdc1
|
|||
fe5f856590
|
|||
987208d232
|
|||
d0d0ddf079
|
|||
a26b9a8287
|
|||
6e9d2bd0c0
|
|||
5460e90137
|
|||
4cc4603b2e
|
|||
a8617fb5b1
|
|||
04814ff498
|
|||
7eea76f2be
|
|||
f3143876db
|
|||
3457ed4c61
|
|||
786178195b
|
|||
29bff234fd
|
|||
3e3e072623 | |||
a6907d7a91
|
|||
3f98db3d3a
|
|||
17b90a54cb
|
|||
0587e9914a
|
|||
257ece871c
|
|||
89ec9614e5
|
|||
6f8902ff8f
|
|||
1eab64e1bc
|
|||
92f90b51f7
|
|||
b44d6b88ed
|
|||
23160b22ad
|
|||
fd2c44f49b
|
|||
8b599e2c77
|
|||
4a9d2d61d2
|
|||
fda9fcdec4
|
|||
395cb363db
|
|||
abc2add177
|
|||
2dbc7965da
|
|||
4dd6c979b6
|
|||
8672905dc4
|
|||
6a3703a2d0
|
|||
8bb0c57ddb
|
|||
8994bbe0e2
|
|||
ea5ecad274
|
|||
c6f2891003
|
|||
46f538bbe8
|
|||
f80bc47a24
|
|||
6162bb1502
|
2
Makefile
2
Makefile
@@ -40,6 +40,8 @@ $(databases): .dbs/%.rec: %/ | .dbs/
|
||||
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 $^ >> $@
|
||||
|
25
README.md
25
README.md
@@ -4,23 +4,29 @@ title: "Linux Knowledge Base"
|
||||
|
||||
The Linux Knowledge-Base provides quick-start guides for working with terminal programs.
|
||||
|
||||
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 -q gpg
|
||||
recsel db.rec -e "title = 'ssh'"
|
||||
recsel db.rec -e "title ~ 'ssh'"
|
||||
recsel db.rec -e "title ~ 'bash'" -R title,wordcount
|
||||
recsel db.rec -m 1 -P content | less -R
|
||||
|
||||
recsel db.rec -t guide -j provides -G title \
|
||||
-e "title = 'ssh'" \
|
||||
-p 'sum(provides_wordcount)'
|
||||
```
|
||||
|
||||
# Style
|
||||
@@ -30,6 +36,16 @@ recsel db.rec -m 1 -P content | less -R
|
||||
- Nobody cares about how the project started.
|
||||
- Nobody wants to read what `ffmpeg` is, because anyone who wants to use it already knows what it is.
|
||||
|
||||
## State Knowledge Dependencies
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
[Do not Jaquays documentation](https://splint.rs/posts/no_links)
|
||||
|
||||
## Be Opinionated
|
||||
|
||||
- Guides should not ask the reader to select options half-way through.
|
||||
@@ -74,6 +90,11 @@ grep ls --color=always $HISTFILE | $PAGER
|
||||
|
||||
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
|
||||
|
@@ -64,6 +64,8 @@ atrm 2
|
||||
|
||||
Check `/var/spool/atd/` to see the jobs.
|
||||
|
||||

|
||||
|
||||
## Automation
|
||||
|
||||
Automatically add a job for later, by setting the date, then using echo for the command.
|
||||
|
42
basics/at.tape
Normal file
42
basics/at.tape
Normal file
@@ -0,0 +1,42 @@
|
||||
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
|
||||
|
@@ -13,6 +13,8 @@ type -P ls
|
||||
type -a cat
|
||||
```
|
||||
|
||||

|
||||
|
||||
# Whereis the Program
|
||||
|
||||
Where is `grep` and all its configuration files?
|
||||
|
@@ -56,7 +56,7 @@ Then set that language, with:
|
||||
LANG=pl_PL.UTF-8
|
||||
```
|
||||
|
||||
... then reboot.
|
||||
...then reboot.
|
||||
|
||||
# Network Time Protocol
|
||||
|
||||
|
33
basics/which.tape
Normal file
33
basics/which.tape
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
@@ -142,4 +142,3 @@ You can ensure omemo automatcally turns on:
|
||||
```
|
||||
---
|
||||
|
||||
'OTR' encryption is mostly dead, but you can find the old instructions [here](profanity-otr).
|
||||
|
@@ -8,22 +8,21 @@ tags: [ "tar", "backups", ".tgz", "tar.gz" ]
|
||||
|
||||
Combine many files and directories into a single t-archive file.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
tar cf "$ARCHIVE".tar $DIR
|
||||
```
|
||||
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.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
tar cf "$ARCHIVE".tar -C /etc/ nginx
|
||||
```
|
||||
|
||||
Check the contents of your archive with:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
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:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
files=$(ls /etc/nginx)
|
||||
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
|
||||
|
||||
> tar xf "$ARCHIVE".tar
|
||||
```sh
|
||||
tar xf "$ARCHIVE".tar
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
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:
|
||||
|
||||
```bash
|
||||
PASSWORD=my_password
|
||||
```
|
||||
```bash
|
||||
7za a -tzip -p$PASSWORD -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
|
||||
```sh
|
||||
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.
|
||||
They just can't read the contents.
|
||||
|
||||
Unzip:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
7za x archive.zip
|
||||
```
|
||||
|
||||
|
@@ -5,7 +5,7 @@ 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).
|
||||
|
||||
```bash
|
||||
```sh
|
||||
unison -version
|
||||
```
|
||||
|
||||
@@ -13,14 +13,14 @@ Create the `~/.unison` directory on both machines.
|
||||
|
||||
Make a job called `backup`:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
JOB=backup
|
||||
```
|
||||
|
||||
Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username.
|
||||
|
||||
|
||||
```bash
|
||||
```sh
|
||||
echo "
|
||||
auto = true
|
||||
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.
|
||||
Or you can deleted that line in the `.prf` file and run it with a flag:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
unison -batch *backup*.prf
|
||||
```
|
||||
|
||||
|
@@ -3,6 +3,24 @@ title: "Base 16"
|
||||
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
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
|
@@ -6,41 +6,40 @@ tags: [ "data" ]
|
||||
|
||||
## New Machines
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git config --global user.email "$YOUR_EMAIL"
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git config --global user.name "$YOUR_NAME"
|
||||
```
|
||||
|
||||
# New Git
|
||||
|
||||
Start a git in directory `$DIR`:
|
||||
Decide on algorithm:
|
||||
|
||||
```bash
|
||||
mkdir $DIR && cd $DIR
|
||||
- If you're scared of insecure hash-sums, go with `hash=sha256`.
|
||||
- If you don't know what a hash sum is, go with `hash=sha1`.
|
||||
|
||||
## Init the Git
|
||||
|
||||
Start a git in directory `${DIR}`:
|
||||
|
||||
```sh
|
||||
git init --object-format=${hash} ${DIR}
|
||||
cd ${DIR}
|
||||
```
|
||||
|
||||
```bash
|
||||
git init
|
||||
```
|
||||
Make a file explaining what the project does, and tell `git` to track it:
|
||||
|
||||
Make a file explaining what the project does:
|
||||
|
||||
```bash
|
||||
vim README.md
|
||||
```
|
||||
|
||||
Add this to the git:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
echo "I hereby solemnly swear never to commit a binary file." > README.md
|
||||
git add README.md
|
||||
```
|
||||
|
||||
Then make the initial commit, explaining the change you just made:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit
|
||||
```
|
||||
|
||||
@@ -48,17 +47,17 @@ git commit
|
||||
|
||||
Once you make a change to some file, add it and make a commit explaining it.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git add $FILE
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit -m"change $FILE"
|
||||
```
|
||||
|
||||
Check your history:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git log
|
||||
```
|
||||
|
||||
@@ -69,20 +68,20 @@ Give it the same name as the `$DIR` directory, above.
|
||||
|
||||
Add this as a remote:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
REMOTE=gitlab
|
||||
git remote add $REMOTE https://gitlab.com/$USERNAME/$DIR
|
||||
```
|
||||
|
||||
Tell git you're pushing the branch "master" to the remote repo "origin":
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git push -u master origin
|
||||
```
|
||||
|
||||
If someone makes a change on the remote, pull it down with:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git pull
|
||||
```
|
||||
|
||||
@@ -91,31 +90,31 @@ git pull
|
||||
A branch is a full copy of the project to test additional ideas.
|
||||
You can make a new branch called 'featurez' like this:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch $FEATURE_BRANCH
|
||||
```
|
||||
|
||||
Have a look at all your branches:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch
|
||||
```
|
||||
|
||||
Switch to your new branch:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git checkout $FEATURE_BRANCH
|
||||
```
|
||||
|
||||
And if your changes are rubbish, checkout the "master" branch again, then delete "featurez":
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch -D $FEATURE_BRANCH
|
||||
```
|
||||
|
||||
Or if it's a good branch, push it to the remote:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
remote=origin
|
||||
git push $remote $FEATURE_BRANCH
|
||||
```
|
||||
@@ -124,13 +123,13 @@ git push $remote $FEATURE_BRANCH
|
||||
|
||||
Once you like the feature, merge it into the main branch. Switch to master then merge it:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git merge $FEATURE_BRANCH
|
||||
```
|
||||
|
||||
And delete the branch, as you've already merged it:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch -d $FEATURE_BRANCH
|
||||
```
|
||||
|
||||
@@ -138,7 +137,7 @@ git branch -d $FEATURE_BRANCH
|
||||
|
||||
## Pulling another git repo into a subtree
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git subtree add -P config git@gitlab.com:bindrpg/config.git master
|
||||
```
|
||||
|
||||
@@ -146,27 +145,27 @@ git subtree add -P config git@gitlab.com:bindrpg/config.git master
|
||||
|
||||
## Delete All History
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git checkout --orphan temp
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git add -A
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git commit -am "release the commits!"
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch -D master
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git branch -m master
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git push -f origin master
|
||||
```
|
||||
|
||||
@@ -174,21 +173,21 @@ Gitlab requires more changes, such as going to `settings > repository` and switc
|
||||
|
||||
## Clean up Bloated Repo
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git fsck --full
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git gc --prune=now --aggressive
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git repack
|
||||
```
|
||||
|
||||
## Find Binary Blobs
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git rev-list --objects --all \
|
||||
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
|
||||
| sed -n 's/^blob //p' \
|
||||
|
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}"
|
||||
```
|
||||
|
19
data/interactive_string_substitution.md
Normal file
19
data/interactive_string_substitution.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "Interactive String Substitution"
|
||||
tags: [ "data", "vim", "substitution" ]
|
||||
---
|
||||
|
||||
Want to find and replace, but also confirm each instance?
|
||||
|
||||
```sh
|
||||
vim -c "%s/${pattern}/${replacement}/gc" -c 'wq' ${file}
|
||||
```
|
||||
|
||||
Notice that double-quotes (`"`) in the first command (`-c`).
|
||||
|
||||
Alternatively, check with an example string:
|
||||
|
||||
|
||||
```sh
|
||||
sed "s/${pattern}/ARGLEBARGLE/g" ${file} | grep 'ARGLEBARGLE'
|
||||
```
|
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "radicale and nginx"
|
||||
tags: [ "data", "calendar" ]
|
||||
requires: [ "nginx", "certbot" ]
|
||||
---
|
||||
|
||||
Check before you start:
|
||||
|
@@ -52,3 +52,5 @@ recset -f "$new_field" --delete $database
|
||||
|
||||
- [Recfiles for gemini capsules](gemini://tilde.town/~dozens/gemlog/21.gmi)
|
||||
|
||||
|
||||

|
||||
|
68
data/recfiles/recfiles.tape
Normal file
68
data/recfiles/recfiles.tape
Normal file
@@ -0,0 +1,68 @@
|
||||
Require recins
|
||||
|
||||
Set Shell "bash"
|
||||
Set TypingSpeed 0.1
|
||||
Set FontSize 25
|
||||
Set Width 900
|
||||
Set Height 700
|
||||
|
||||
Enter
|
||||
Type "touch games.rec"
|
||||
Enter
|
||||
|
||||
Sleep 2s
|
||||
Type 'recins --record "Name: Vojvodina" games.rec'
|
||||
Enter
|
||||
Sleep 2s
|
||||
Type 'recsel games.rec'
|
||||
Enter
|
||||
|
||||
Sleep 2s
|
||||
|
||||
Type 'for g in Saboter Carcassonne Chess; do recins -r "Name: $g" games.rec; done'
|
||||
Enter
|
||||
Type 'recsel games.rec'
|
||||
Enter
|
||||
Sleep 2s
|
||||
Type 'cat games.rec'
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
Type 'recsel --quick=Carc games.rec'
|
||||
Enter
|
||||
Type 'recsel -q Carc games.rec'
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
Type 'recsel -q "sabot" --print=Name games.rec'
|
||||
Enter
|
||||
Sleep 1s
|
||||
Type 'recsel --case-insensitive -q "sabot" --print=Name games.rec'
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
Type 'recsel -i -q "chess" -p Name games.rec'
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
Type 'recset -f "Played" --set-add="no" games.rec'
|
||||
Enter
|
||||
Type 'recsel games.rec'
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
Type 'recset -iq chess -f "Played" --set=yes games.rec'
|
||||
Enter
|
||||
Type 'recsel games.rec'
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
Type 'recset -f "Played" --delete games.rec'
|
||||
Enter
|
||||
Type 'recsel games.rec'
|
||||
Enter
|
||||
|
||||
Hide
|
||||
Type 'rm games.rec'
|
||||
Enter
|
||||
Sleep 3s
|
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "sc-im"
|
||||
tags: [ "TUI", "data", "spreadsheet", ".csv" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
- [Sample file](sc-im/sample.sc)
|
||||
@@ -47,6 +48,7 @@ echo 'set autowrap' >> .config/sc-im/scimrc
|
||||
|:----------------------|:---:|
|
||||
| text (left align) | < |
|
||||
| text (right align) | > |
|
||||
| text (right align) | `|` |
|
||||
| Edit existing text | E |
|
||||
|
||||
### Meta Actions
|
||||
@@ -61,6 +63,26 @@ echo 'set autowrap' >> .config/sc-im/scimrc
|
||||
| paste with format | Pc |
|
||||
| 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
|
||||
|
||||
|
13
data/sc-im/convert_spreadsheets.md
Normal file
13
data/sc-im/convert_spreadsheets.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "Convert Spreadsheets"
|
||||
tags: [ "data", "sc-im" ]
|
||||
---
|
||||
|
||||
Convert between spreadsheet formats with `sc-im`.
|
||||
|
||||
```sh
|
||||
sc-im --quiet --quit_afterload --nocurses --export_csv ${file}.xlsx
|
||||
sc-im --quiet --quit_afterload --nocurses --export_tab ${file}.sc
|
||||
sc-im --quiet --quit_afterload --nocurses --export_mkd ${file}.csv
|
||||
sc-im --quiet --quit_afterload --nocurses --export_txt ${file}.tsv
|
||||
```
|
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"
|
||||
tags: [ "data", "git server", "lfs" ]
|
||||
requires: [ "git", "nginx" ]
|
||||
---
|
||||
|
||||
## `http` Setup
|
||||
@@ -33,7 +34,7 @@ Restart the `soft-serve` service, then check it's working by cloning from localh
|
||||
git clone http://localhost:23232/${some_repo}.git
|
||||
```
|
||||
|
||||
## `https` Setup
|
||||
### `https` Setup
|
||||
|
||||
Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard certificates with [nginx](../networking/website/nginx.md).
|
||||
|
||||
@@ -67,3 +68,4 @@ Put this file at `/etc/nginx/sites-enabled/$DOMAIN.tld`, then set up standard ce
|
||||
}
|
||||
|
||||
```
|
||||
|
8
data/soft.md
Normal file
8
data/soft.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Soft-Serve"
|
||||
tags: [ "data", "git server", "lfs", "TUI" ]
|
||||
requires: [ "git", "nginx" ]
|
||||
---
|
||||
|
||||
- [Soft-Serve with https](soft-serve/soft_https.md)
|
||||
- [Maintenance](soft-serve/maintenance.md)
|
34
data/task/contexts.md
Normal file
34
data/task/contexts.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: "Taskwarrior Contexts"
|
||||
tags: [ "data", "task" ]
|
||||
requires: [ "Taskwarrior" ]
|
||||
---
|
||||
|
||||
# Contexts
|
||||
|
||||
Set three contexts by their tags:
|
||||
|
||||
```sh
|
||||
task context define work +sa or +hr
|
||||
```
|
||||
|
||||
```sh
|
||||
task context define study +ed or +void or +rat
|
||||
```
|
||||
|
||||
```sh
|
||||
task context define home -sa -hr -ed -void -rat
|
||||
```
|
||||
|
||||
Change to the first context.
|
||||
|
||||
```sh
|
||||
task context work
|
||||
```
|
||||
|
||||
Then stop.
|
||||
|
||||
```sh
|
||||
task context none
|
||||
```
|
||||
|
@@ -1,23 +1,35 @@
|
||||
---
|
||||
title: "task"
|
||||
tags: [ "organization" ]
|
||||
title: "Taskwarrior"
|
||||
tags: [ "data", "organization" ]
|
||||
---
|
||||
|
||||
Set up the configuration file:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task
|
||||
```
|
||||
|
||||
Taskwarrior published a new feature to synchronize tasks others, but the feature was not ready.
|
||||
The server's default installation instructions assume that users pay for hosting services.
|
||||
All listed providers run proprietary software and actively support genocide.
|
||||
|
||||
|
||||
To ignore the synchronization, tell the configuration file to use a local synchronization file.
|
||||
|
||||
```
|
||||
task config sync.local.server_dir
|
||||
task config data.location ~/.local/state/
|
||||
```
|
||||
|
||||
Add a task:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task add update linux
|
||||
```
|
||||
|
||||
See which task is next:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task next
|
||||
```
|
||||
|
||||
@@ -25,13 +37,13 @@ Note the id number.
|
||||
|
||||
Mark a task as started:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task start 1
|
||||
```
|
||||
|
||||
Once finished:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task 1 done
|
||||
```
|
||||
|
||||
@@ -39,23 +51,21 @@ task 1 done
|
||||
|
||||
Add a project:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task add project:house buy potted plant
|
||||
task add proj:house.repair buy screwdriver
|
||||
task add proj:house.repair buy shelf brackets
|
||||
task add pro:house.paint buy white paint
|
||||
task add pro:house.paint buy red paint
|
||||
task add pro:house.paint buy black paint
|
||||
task add pro:house.paint buy brushes
|
||||
|
||||
for t in "buy red paint" "buy black paint" "buy brushes" ; do
|
||||
task add pro:house.paint $t
|
||||
done
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task pro:house sum
|
||||
```
|
||||
|
||||
```bash
|
||||
task burndown.daily pro:house
|
||||
```
|
||||
|
||||
@@ -63,69 +73,33 @@ The summaries will show how fast a project is being completed, and when you can
|
||||
|
||||
# Tags
|
||||
|
||||
```bash
|
||||
|
||||
```sh
|
||||
task add +buy toothbrush
|
||||
```
|
||||
|
||||
You can then see only tasks which involve buying something with:
|
||||
|
||||
```bash
|
||||
task +buy
|
||||
```
|
||||
|
||||
# Contexts
|
||||
|
||||
Set three contexts by their tags:
|
||||
|
||||
```bash
|
||||
task context define work +sa or +hr
|
||||
```
|
||||
|
||||
```bash
|
||||
task context define study +ed or +void or +rat
|
||||
```
|
||||
|
||||
```bash
|
||||
task context define home -sa -hr -ed -void -rat
|
||||
```
|
||||
|
||||
Change to the first context.
|
||||
|
||||
```bash
|
||||
task context work
|
||||
```
|
||||
|
||||
Then stop.
|
||||
|
||||
```bash
|
||||
task context none
|
||||
```
|
||||
|
||||
# Review
|
||||
|
||||
View list of tasks completed in the last week:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task end.after:today-1wk completed
|
||||
```
|
||||
|
||||
# User Defined Attributes
|
||||
|
||||
Make a UDA 'size'.
|
||||
Define a new attribute for tasks called 'size'.
|
||||
The 'user defined attribute' (UDA) needs a `type` and `label`.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task config uda.size.type string
|
||||
```
|
||||
|
||||
```bash
|
||||
task config uda.size.label Size
|
||||
```
|
||||
You can also ensure task tasks can only be `large`, `medium`, or `small`, then set a default.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
task config uda.size.values large,medium,small
|
||||
```
|
||||
|
||||
```bash
|
||||
uda.size.default=medium
|
||||
```
|
||||
|
||||
@@ -133,7 +107,7 @@ uda.size.default=medium
|
||||
|
||||
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
|
||||
```
|
||||
|
20
data/task/taskwarrior_configuration.md
Normal file
20
data/task/taskwarrior_configuration.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "Taskwarrior Configuration"
|
||||
tags: [ "data", "task" ]
|
||||
requires: [ "Taskwarrior" ]
|
||||
---
|
||||
|
||||
Show your current config:
|
||||
|
||||
|
||||
```sh
|
||||
task show
|
||||
```
|
||||
|
||||
Use machine-readable output to make a config file with all configuration keys shown, then make it your configuration file.
|
||||
|
||||
```sh
|
||||
task _show > ${file}
|
||||
mv ${file} ~/.config/task/taskrc
|
||||
```
|
||||
|
@@ -6,13 +6,13 @@ tags: [ "data", "tracking", "time", "timew" ]
|
||||
|
||||
Try:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew summary :yesterday
|
||||
```
|
||||
|
||||
You can also use :week, :lastweek, :month, :quarter, :year, or a range such as:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew summary today to tomorrow
|
||||
timew today - tomorrow
|
||||
2018-10-15T06:00 - 2018-10-17T06:00
|
||||
@@ -22,7 +22,7 @@ Each of these can gain with the :ids tag.
|
||||
|
||||
# Basics
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew start
|
||||
timew stop
|
||||
timew continue
|
||||
@@ -32,7 +32,7 @@ timew tags
|
||||
|
||||
And add ids with:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew summary :ids
|
||||
timew track 10am - 1pm timewarrior
|
||||
timew track 1pm for 2h walk
|
||||
@@ -42,50 +42,50 @@ timew track 1pm for 2h walk
|
||||
|
||||
First get ids.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew summary :ids
|
||||
```
|
||||
|
||||
Then if we're looking at task @2:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew move @2 12:00
|
||||
timew lengthen @2 3mins
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
time shorten @2 40mins
|
||||
```
|
||||
|
||||
# Forgetting
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew start 1h ago @4
|
||||
```
|
||||
|
||||
Or if your action actually had a break:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew split @8
|
||||
```
|
||||
|
||||
Or maybe not?
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew join @4 @8
|
||||
timew @8 delete
|
||||
```
|
||||
|
||||
Start at previous time
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew start 3pm 'Read chapter 12'
|
||||
timew start 90mins ago 'Read chapter 12'
|
||||
```
|
||||
|
||||
Cancel currently tracked time.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
timew cancel
|
||||
```
|
||||
|
||||
@@ -157,11 +157,11 @@ with:
|
||||
|
||||
# Fixing Errors
|
||||
|
||||
```bash
|
||||
```sh
|
||||
curl -O https://taskwarrior.org/download/timew-dbcorrection.py
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
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.
|
@@ -19,3 +19,4 @@ w3m ddg.gg
|
||||
| T | new tab |
|
||||
| { / } | switch tabs |
|
||||
|
||||

|
||||
|
43
data/w3m.tape
Normal file
43
data/w3m.tape
Normal file
@@ -0,0 +1,43 @@
|
||||
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
|
@@ -57,5 +57,5 @@ brightnessctl s 10%+
|
||||
|
||||
- [autologin](autologin.md)
|
||||
- [services](sv.md)
|
||||
- [wifi](wpa_cli.md)
|
||||
- [wifi](../../networking/wpa_supplicant.md)
|
||||
|
||||
|
28
distros/void/xbps-install.tape
Normal file
28
distros/void/xbps-install.tape
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
|
64
distros/void/xbps-query.tape
Normal file
64
distros/void/xbps-query.tape
Normal file
@@ -0,0 +1,64 @@
|
||||
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
|
||||
|
28
distros/void/xbps-remove.tape
Normal file
28
distros/void/xbps-remove.tape
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
|
@@ -22,6 +22,8 @@ Search with regex:
|
||||
xbps-query --regex -Rs 'cow(s)?\w'
|
||||
```
|
||||
|
||||

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

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

|
||||
|
||||
## Fixes
|
||||
|
||||
Reinstall cowsay
|
||||
|
@@ -11,6 +11,7 @@ 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
|
||||
|
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
|
||||
```
|
25
networking/port_scan.md
Normal file
25
networking/port_scan.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "Port Scan"
|
||||
tags: [ "networking" ]
|
||||
repo: 'https://github.com/mrjackwills/havn/'
|
||||
---
|
||||
|
||||
`havn` scans ports.
|
||||
It's not in many repos, but if you can `cargo install havn`.
|
||||
|
||||
|
||||
```sh
|
||||
havn -h
|
||||
havn -a
|
||||
domain=splint.rs
|
||||
havn -p 19-90 ${domain}
|
||||
```
|
||||
|
||||
That last command doesn't work reliably, so increase the number of retries (`-r`), or decrease concurrent requests (`-c`).
|
||||
|
||||
|
||||
```sh
|
||||
havn -p 19-443 -r 6 ${domain}
|
||||
havn -p 1-1000 -c 500 -r 5 ${domain}
|
||||
```
|
||||
|
@@ -23,7 +23,8 @@ Using four spaces will not work!
|
||||
|
||||
## Dependency Files
|
||||
|
||||
Now we've made a `README.md` file, we can show how a makefile looks in the README:
|
||||
Now we've made a `README.md` file, we can show how a makefile looks in the README file.
|
||||
Add these lines to the `Makefile`:
|
||||
|
||||
```make
|
||||
README.md: Makefile
|
||||
@@ -44,7 +45,7 @@ Note the order:
|
||||
|
||||
Notice that the file above can print into the README by using `echo "" >> $@`.
|
||||
The `$@` stands for 'the file which we want', and `$<` stands for 'the first dependency file'.
|
||||
The `make` program starts by replacing those variables, and the result it:
|
||||
The `make` program starts by replacing those variables, so when you run `make`, the program looks like this:
|
||||
|
||||
```make
|
||||
README.md: Makefile
|
||||
@@ -54,7 +55,6 @@ README.md: Makefile
|
||||
cat Makefile >> README.md
|
||||
echo '```' >> README.md
|
||||
|
||||
|
||||
```
|
||||
|
||||
| Sigil | Meaning |
|
||||
@@ -71,7 +71,6 @@ README.md: Makefile
|
||||
|
||||
You can assign a variable normally, but must refer to it in brackets.
|
||||
|
||||
|
||||
```make
|
||||
storage_directory = backups
|
||||
|
||||
@@ -182,4 +181,3 @@ In this case, the makefile can see that `backup` depends on the current backup f
|
||||
- [File patterns](Makefiles/patterns.md)
|
||||
- [Makefile graphs](Makefiles/graph-easy.md)
|
||||
- [In-build help](Makefiles/help.md)
|
||||
- [Makefile graphs](Makefiles/graph-easy.md)
|
||||
|
@@ -8,13 +8,13 @@ Running `make help` will search for text which starts with `## ` and show what t
|
||||
|
||||
```make
|
||||
.PHONY: help
|
||||
help: ## Print the help message
|
||||
help: ## Print the help message.
|
||||
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
||||
sort | \
|
||||
column -s ':' -t
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove generated files
|
||||
clean: ## Remove generated files.
|
||||
$(RM) $(defaults)
|
||||
```
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
---
|
||||
title: "Makefile Patterns"
|
||||
tags: [ "system", "make" ]
|
||||
|
98
system/Makefiles/python_projects.md
Normal file
98
system/Makefiles/python_projects.md
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
title: "Python Projects with Makefiles"
|
||||
tags: [ "tutorial", "system", "makefiles", "graphviz", "python" ]
|
||||
requires: [ "Makefiles" ]
|
||||
---
|
||||
|
||||
If you have a python script which requires a packages - e.g. `graphviz` - you can automate the setup with a `Makefile`.
|
||||
The `Makefile` will:
|
||||
|
||||
1. Make three copies of an 8-line installer script.
|
||||
2. Use one of the installer script to install local packages.
|
||||
3. Install a symbolic link to python.
|
||||
3. Make a script called `activate`, which tells python to use
|
||||
|
||||
# Context
|
||||
|
||||
Python coders don't like updating their projects, they just expect everyone to install the same version of everything that they have.
|
||||
Historically, people dealt with this by installing only half a dozen copies of `graphviz`; but now each python project uses a local environment, with a local copy of `graphviz`, which means everyone gets to install a new copy of `graphviz` every time they try out a project.
|
||||
|
||||
Downloading 40MB of software for each 40-line script you write is called 'virtual environments' because it sounds cool.
|
||||
We can make it even cooler with `make`, but not yet, because python - like the fae of old - will not fetch anything until you know its true name.
|
||||
|
||||
# Setup
|
||||
|
||||
```sh
|
||||
command -v python
|
||||
realpath `!!`
|
||||
```
|
||||
|
||||
You must reveal that true path, because `python` is always a relative symbolic link, to an absolute symbolic link, which leads to a shortcut.
|
||||
We can finally let `make` know how to invoke python, and where it will install `graphviz`.
|
||||
|
||||
If your python's version is '3.14', then python needs its packages placed in `${somewhere}/lib/python3.14/site-packages/`.
|
||||
You must create a new, local, name for these packages, because - like the fey of old - python demands a private name in return for revealing its true name.
|
||||
|
||||
I'll call mine `camelot`, because the path is long and arduous.
|
||||
Set up the Makefiles like this:
|
||||
|
||||
```make
|
||||
py_link != command -v python
|
||||
py != realpath $(py_link)
|
||||
version != basename $(py)
|
||||
|
||||
virtenv = camelot
|
||||
```
|
||||
|
||||
Now you can ask for a local `pip` script, which can install the python packages:
|
||||
|
||||
```make
|
||||
[...]
|
||||
|
||||
$(virtenv)/bin/pip:
|
||||
$(py) -m venv $(virtenv)
|
||||
```
|
||||
|
||||
Finally, list the packages you want in `requirements.txt`, and make `pip` install from it.
|
||||
|
||||
|
||||
```sh
|
||||
ppkg=graphviz
|
||||
echo ${ppkg} > requirements.txt
|
||||
```
|
||||
|
||||
```make
|
||||
[...]
|
||||
|
||||
pkgs = $(virtenv)/lib/$(version)/site-packages/
|
||||
|
||||
$(pkgs): $(virtenv)/bin/pip
|
||||
$(pkgs): requirements.txt
|
||||
$(virtenv)/bin/pip install -r $<
|
||||
```
|
||||
|
||||
The complete Makefile looks like this:
|
||||
|
||||
|
||||
```make
|
||||
all: .default
|
||||
|
||||
py_link != command -v python
|
||||
py != realpath $(py_link)
|
||||
version != basename $(py)
|
||||
|
||||
virtenv = camelot
|
||||
|
||||
$(virtenv)/bin/pip:
|
||||
$(py) -m venv $(virtenv)
|
||||
|
||||
pkgs = $(virtenv)/lib/$(version)/site-packages/
|
||||
|
||||
$(pkgs): $(virtenv)/bin/pip
|
||||
$(pkgs): requirements.txt
|
||||
$(virtenv)/bin/pip install -r $<
|
||||
|
||||
.PHONY: .default
|
||||
.default: $(pkgs)
|
||||
```
|
||||
|
@@ -3,6 +3,8 @@ title: "lf - The Light File Manager"
|
||||
tags: [ "file browser", "TUI" ]
|
||||
---
|
||||
|
||||

|
||||
|
||||
## Config File
|
||||
|
||||
If you don't have a `~/.config/lf/lfrc` file, you can probably find an example in `/usr/share/examples/lf`.
|
||||
|
24
system/lf.tape
Normal file
24
system/lf.tape
Normal file
@@ -0,0 +1,24 @@
|
||||
Require lf
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 12
|
||||
Set Width 800
|
||||
Set Height 600
|
||||
|
||||
Type "lf"
|
||||
Sleep 1.5s
|
||||
Enter
|
||||
Sleep 1.5s
|
||||
Type "jjj"
|
||||
Sleep 1s
|
||||
Enter
|
||||
Sleep 2s
|
||||
Type "fortune > file"
|
||||
Enter
|
||||
Sleep 2s
|
||||
Enter
|
||||
Type "/file"
|
||||
Enter
|
||||
Sleep 3s
|
||||
Type "q"
|
||||
|
32
system/managing_groups.md
Normal file
32
system/managing_groups.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Managing Groups"
|
||||
tags: [ "system" ]
|
||||
---
|
||||
|
||||
Check which groups you are in, and which are available:
|
||||
|
||||
```sh
|
||||
cat /etc/group
|
||||
groups
|
||||
cat /etc/group | grep $USER
|
||||
```
|
||||
|
||||
Remove yourself from all groups, and add yourself back to only `wheel`, `audio`, and your own group:
|
||||
|
||||
```sh
|
||||
sudo usermod --groups wheel,audio,$USER
|
||||
```
|
||||
|
||||
Add yourself to the `wheel` group:
|
||||
|
||||
```sh
|
||||
su root -c "usermod --append --groups wheel $USER"
|
||||
```
|
||||
Add yourself to the `network` group:
|
||||
|
||||
```sh
|
||||
sudo usermod -aG network $USER
|
||||
```
|
||||
|
||||
The changes will not take effect until you log in again, so reboot or log into `localhost` with [ssh](../networking/ssh.md).
|
||||
|
@@ -1,48 +0,0 @@
|
||||
---
|
||||
title: "vim navigation"
|
||||
tags: [ "vim" ]
|
||||
---
|
||||
|
||||
| Move | Command |
|
||||
|:-----|:-------------|
|
||||
|Down page | C-f |
|
||||
| Down half page | C-d |
|
||||
| Up page | C-b |
|
||||
| Up half page | C-u |
|
||||
|
||||
## Scroll
|
||||
|
||||
> C-e
|
||||
|
||||
> C-y
|
||||
|
||||
## Jumps
|
||||
|
||||
Go through your last jumps:
|
||||
|
||||
> C-I
|
||||
|
||||
> C-O
|
||||
|
||||
Go to the last and previous places you've changed:
|
||||
|
||||
> g;
|
||||
|
||||
> g,
|
||||
|
||||
Go to a filename, and type `gf` (Go-to-File).
|
||||
For example, if you put your cursor over the `~/.vimrc` in this line, you can edit your vim configuration file.
|
||||
|
||||
`source ~/.vimrc`
|
||||
|
||||
# Project Structure
|
||||
|
||||
Make a 20 character 'visual split' in the current working directory ('`.`').
|
||||
|
||||
> :20vs .
|
||||
|
||||
Change the view for this:
|
||||
|
||||
> C-w x
|
||||
|
||||
|
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: "vim windows"
|
||||
tags: [ "vim" ]
|
||||
---
|
||||
|
||||
| Command | Keys |
|
||||
|:-----|:----:|
|
||||
| split window | C-w s |
|
||||
| split window vertically | C-w v |
|
||||
| close window | C-q |
|
||||
| change window | C-w w |
|
||||
| rotate windows | C-w r |
|
||||
| split open new file | :sf path/file |
|
||||
|
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: "Vim Tricks"
|
||||
tags: [ "vim" ]
|
||||
---
|
||||
|
||||
## Remote Editing
|
||||
|
||||
> vim scp://*user*@*myserver*[:*port*]//*path/to/file.txt*
|
||||
|
@@ -1,21 +1,16 @@
|
||||
---
|
||||
title: "virtualbox"
|
||||
tags: [ "system" ]
|
||||
requires: [ "Managing Groups" ]
|
||||
---
|
||||
# Setup
|
||||
|
||||
## Arch Linux
|
||||
Load the modules (or just reboot):
|
||||
|
||||
```sh
|
||||
sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
|
||||
```
|
||||
|
||||
```sh
|
||||
sudo modprobe vboxdrv
|
||||
```
|
||||
|
||||
```sh
|
||||
# vboxreload
|
||||
su root
|
||||
modprobe vboxdrv
|
||||
vboxreload
|
||||
```
|
||||
|
||||
Make dd image into vdi
|
||||
@@ -30,7 +25,13 @@ If this doesn't work, try to make a new bite size with just
|
||||
sudo dd if=image.dd of=image2.dd bs=512 conv=sync
|
||||
```
|
||||
|
||||
## CLI Management
|
||||
## Arch Linux
|
||||
|
||||
```sh
|
||||
pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
|
||||
```
|
||||
|
||||
# CLI Management
|
||||
|
||||
List boxes:
|
||||
|
||||
@@ -50,22 +51,19 @@ To pause the machine:
|
||||
VBoxManage controlvm "rata" pause --type headless
|
||||
```
|
||||
|
||||
You can do a number of things to virtualboxes this way:
|
||||
You can do a number of things to the 'virtual boxes' this way:
|
||||
|
||||
- startvm
|
||||
|
||||
- pause
|
||||
|
||||
- resume
|
||||
|
||||
- poweroff
|
||||
- `startvm`
|
||||
- `pause`
|
||||
- `resume`
|
||||
- `poweroff`
|
||||
|
||||
## Creating Disks
|
||||
|
||||
Creating a VM requires registering it:
|
||||
|
||||
```sh
|
||||
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
|
||||
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
|
||||
```
|
||||
|
||||
```sh
|
||||
@@ -78,6 +76,7 @@ VBoxManage storagectl Ubuntu19.04 -name IDE --add ide --controller PIIX4 --boot
|
||||
|
||||
Create just a disk with:
|
||||
|
||||
VBoxManageg createhd --filename Ubuntu16.04 --size 5120
|
||||
|
||||
```sh
|
||||
VBoxManage createhd --filename "$diskname" --size 5120
|
||||
```
|
||||
|
||||
|
12
writing/tex/calendar.md
Normal file
12
writing/tex/calendar.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "Calendar"
|
||||
tags: [ "writing", "tex", "fun" ]
|
||||
requires: [ "LaTeX Packages" ]
|
||||
---
|
||||
|
||||
```sh
|
||||
yplan $(date +%Y) > ${file}.tex
|
||||
pdflatex -output-directory=/tmp/ ${file}.tex
|
||||
mv /tmp/${file}.pdf .
|
||||
```
|
||||
|
78
writing/tex/tex_packages.md
Normal file
78
writing/tex/tex_packages.md
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
title: "LaTeX Packages"
|
||||
tags: [ "writing" ]
|
||||
---
|
||||
|
||||
# Warm Up
|
||||
|
||||
1. Deep breath.
|
||||
1. Cup of tea.
|
||||
1. Remove the old LaTeX junk you've installed. Search for 'texlive' or 'latex' in your package manager's installed files.
|
||||
1. Find `tlmgr` in your package manager.
|
||||
|
||||
# `tlmgr`
|
||||
|
||||
The LaTeX Package manager is known as `tlmgr`, and often resides in `/opt/texlive/${YEAR}/bin/x86_64-linux/tlmgr`.
|
||||
Double-check the location:
|
||||
|
||||
```sh
|
||||
ls -l /opt/texlive/${YEAR}/bin/x86_64-linux/tlmgr
|
||||
ls /opt/texlive/${YEAR}/texmf-dist/scripts/texlive/tlmgr.pl
|
||||
```
|
||||
|
||||
Double-check the year.
|
||||
It should *not* match the current year, it should match the `texlive`.
|
||||
|
||||
## Problems along the Path
|
||||
|
||||
You can't use `tlmgr` unless it's in the `$PATH`.
|
||||
|
||||
Check if it *is* in the `$PATH` then if it *should* be in the path:
|
||||
|
||||
```sh
|
||||
echo $PATH
|
||||
grep texlive -r /etc/profile*
|
||||
```
|
||||
|
||||
If `tlmgr` is where it should be, but not in the path, you can add it temporarily:
|
||||
|
||||
|
||||
```sh
|
||||
export PATH=${PATH}:/opt/texlive/${YEAR}/bin/x86_64-linux
|
||||
```
|
||||
|
||||
...or just reboot.
|
||||
|
||||
## Usage
|
||||
|
||||
Search packages:
|
||||
|
||||
|
||||
```sh
|
||||
tlmgr search --global epstopdf
|
||||
```
|
||||
|
||||
Can't find what you need?
|
||||
Search for a specific file instead:
|
||||
|
||||
```sh
|
||||
tlmgr search --global --file epstopdf-base.sty
|
||||
sudo tlmgr install epstopdf-pkg
|
||||
```
|
||||
|
||||
## Recommended Packages
|
||||
|
||||
|
||||
```
|
||||
latexmk
|
||||
luatex
|
||||
titletoc
|
||||
titlesec
|
||||
multicol
|
||||
microtype
|
||||
graphicx
|
||||
fontspec
|
||||
makeindex
|
||||
imakeidx
|
||||
```
|
||||
|
@@ -10,7 +10,8 @@ tags: [ "vim", "basic" ]
|
||||
|
||||
## Extras
|
||||
|
||||
- [Navigation](navigate.md)
|
||||
- [Completion](vim-completion.md)
|
||||
- [Search](vim-search.md)
|
||||
- [Window Splits](vim-windows.md)
|
||||
- [Navigation](vim/navigate.md)
|
||||
- [Completion](vim/completion.md)
|
||||
- [Search](vim/search.md)
|
||||
- [Window Splits](vim/windows.md)
|
||||
- [Use vim bindings in bash](vim/vim_in_bash.md)
|
@@ -1,16 +1,17 @@
|
||||
---
|
||||
title: "vim completion"
|
||||
tags: [ "vim" ]
|
||||
tags: [ "vim", "completion" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
Complete the word by searching for the *n*ext similar word:
|
||||
|
||||
> C-n
|
||||
`C-n`
|
||||
|
||||
Complete the word by searching for a *p*revious similar word:
|
||||
|
||||
> C-p
|
||||
`C-p`
|
||||
|
||||
Complete the full line:
|
||||
|
||||
> C-x C-l
|
||||
`C-x C-l`
|
36
writing/vim/navigate.md
Normal file
36
writing/vim/navigate.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: "vim navigation"
|
||||
tags: [ "vim", "navigation" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
| Move | Command |
|
||||
|:------------------------|:-------------|
|
||||
| Down page | Ctl-f |
|
||||
| Down half page | Ctl-d |
|
||||
| Up page | Ctl-b |
|
||||
| Up half page | Ctl-u |
|
||||
| Scroll down | Ctl-e |
|
||||
| Scroll up | Ctl-y |
|
||||
| Jump to previous place | Ctl-i |
|
||||
| Jump to back | Ctl-o |
|
||||
| Jump to last change | g; |
|
||||
| Jump to next change | g, |
|
||||
| Go to current filename | gf |
|
||||
|
||||
Go to a filename, and type `gf` (Go-to-File).
|
||||
For example, if you put your cursor over the `~/.vimrc` in this line, you can edit your vim configuration file.
|
||||
|
||||
`source ~/.vimrc`
|
||||
|
||||
# Project Structure
|
||||
|
||||
Make a 20 character 'visual split' in the current working directory ('`.`').
|
||||
|
||||
`:20vs .`
|
||||
|
||||
Swap buffer positions:
|
||||
|
||||
`C-w x`
|
||||
|
||||
|
@@ -1,22 +1,23 @@
|
||||
---
|
||||
title: "vim search"
|
||||
tags: [ "vim" ]
|
||||
tags: [ "vim", "search" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
Search for the next and or previous occurrence of the word under your cursor with `*` and `#`.
|
||||
|
||||
Search and replace the first 'one' found with 'two':
|
||||
|
||||
> :%s/one/two/
|
||||
`:%s/one/two/`
|
||||
|
||||
Same, but replace 'one' globally:
|
||||
|
||||
> :%s/one/two/g
|
||||
`:%s/one/two/g`
|
||||
|
||||
Put quotes around every occurrence of `$HOME`:
|
||||
|
||||
> :%s/$HOME/"&"
|
||||
`:%s/$HOME/"&"`
|
||||
|
||||
Same, but add curly brackets around `$HOSTNAME`:
|
||||
|
||||
> :%s/$HOSTNAME/{&}
|
||||
`:%s/$HOSTNAME/{&}`
|
||||
|
@@ -1,13 +1,14 @@
|
||||
---
|
||||
title: "vim in bash"
|
||||
tags: [ "vim", "bash", "inputrc" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
Put bash in vim mode!
|
||||
|
||||
Place the following in your `~/.inputrc`:
|
||||
|
||||
```bash
|
||||
```
|
||||
set editing-mode vi
|
||||
set show-mode-in-prompt on
|
||||
set vi-ins-mode-string \1\e[33;32m\2[>]=\1\e[0m\2
|
15
writing/vim/windows.md
Normal file
15
writing/vim/windows.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "vim windows"
|
||||
tags: [ "vim" ]
|
||||
requires: [ "vim basics" ]
|
||||
---
|
||||
|
||||
| Command | Keys |
|
||||
|:--------------------------|:-------------------:|
|
||||
| split window | `C-w s` |
|
||||
| split window vertically | `C-w v` |
|
||||
| close window | `C-q` |
|
||||
| change window | `C-w w` |
|
||||
| rotate windows | `C-w r` |
|
||||
| split open new file | `:sf $filepath` |
|
||||
|
10
writing/vim_tricks.md
Normal file
10
writing/vim_tricks.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "Vim Tricks"
|
||||
tags: [ "vim" ]
|
||||
requiered: [ "ssh" ]
|
||||
---
|
||||
|
||||
## Remote Editing
|
||||
|
||||
`vim scp://*user*@*myserver*[:*port*]//*path/to/file.txt*`
|
||||
|
Reference in New Issue
Block a user