Compare commits
10 Commits
vhs
...
3dface826f
Author | SHA1 | Date | |
---|---|---|---|
3dface826f
|
|||
a55712032b
|
|||
33a959fcea
|
|||
4ed4c87acf
|
|||
68f9eb2a7d
|
|||
c407e8be9e
|
|||
f52b241dc2
|
|||
c0755da29f
|
|||
c3afb4b562
|
|||
f5b3d969fd
|
1
Makefile
1
Makefile
@@ -38,6 +38,7 @@ $(databases): .dbs/%.rec: %/ | .dbs/
|
|||||||
|
|
||||||
# This two-variable read can only happen because of the quotes in the titles.
|
# This two-variable read can only happen because of the quotes in the titles.
|
||||||
db.rec: $(databases)
|
db.rec: $(databases)
|
||||||
|
$(warning rebuilding from $? )
|
||||||
printf '%s\n' '%rec: guide' > $@
|
printf '%s\n' '%rec: guide' > $@
|
||||||
printf '%s\n' '%key: title' >> $@
|
printf '%s\n' '%key: title' >> $@
|
||||||
printf '%s\n' '%type: requires rec guide' >> $@
|
printf '%s\n' '%type: requires rec guide' >> $@
|
||||||
|
@@ -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
|
|
||||||
|
|
@@ -13,8 +13,6 @@ type -P ls
|
|||||||
type -a cat
|
type -a cat
|
||||||
```
|
```
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# Whereis the Program
|
# Whereis the Program
|
||||||
|
|
||||||
Where is `grep` and all its configuration files?
|
Where is `grep` and all its configuration files?
|
||||||
|
@@ -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,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "git-lfs"
|
title: "git-lfs"
|
||||||
tags: [ "data", "git" ]
|
tags: [ "data", "git" ]
|
||||||
|
requires: [ "git" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Git Large File Storage ('LFS') needs to change your `~/.gitconfig` to check out those binary files:
|
Git Large File Storage ('LFS') needs to change your `~/.gitconfig` to check out those binary files:
|
||||||
|
69
data/git/git_stash.md
Normal file
69
data/git/git_stash.md
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
---
|
||||||
|
title: "git stash"
|
||||||
|
tags: [ "data", "git" ]
|
||||||
|
requires: [ "git" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Save file-changes without committing anything.
|
||||||
|
|
||||||
|
Change a file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
file=README.md
|
||||||
|
fortune >> ${file}
|
||||||
|
git diff
|
||||||
|
git stash save
|
||||||
|
```
|
||||||
|
|
||||||
|
List which stashes you have:
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git stash list
|
||||||
|
|
||||||
|
stash@{1}: WIP on master: c21f102 init git
|
||||||
|
```
|
||||||
|
|
||||||
|
Make a new file, then stash it:
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
otherfile=file.log
|
||||||
|
fortune > ${otherfile}
|
||||||
|
git add ${otherfile}
|
||||||
|
stashname=logfile
|
||||||
|
git stash save ${stashname}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you can see two stashed changes, and the most recent has a name:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git stash list
|
||||||
|
|
||||||
|
stash@{0}: On master: logfile
|
||||||
|
stash@{1}: WIP on master: c21f102 init git
|
||||||
|
```
|
||||||
|
|
||||||
|
You can delete a stash by referring to its index number, or name (if it has one).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
choice=1
|
||||||
|
git stash drop ${choice}
|
||||||
|
|
||||||
|
choice=${stashname}
|
||||||
|
git stash drop ${choice}
|
||||||
|
```
|
||||||
|
|
||||||
|
Or just run `git stash drop` to remove the most recent (labelled `{0}`).
|
||||||
|
|
||||||
|
Return stashed changes with an index number (or the most recent).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git stash pop ${choice}
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete all stashes:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git stash clear
|
||||||
|
```
|
13
data/json.md
Normal file
13
data/json.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: "ijq"
|
||||||
|
tags: [ "data", "json", "TUI" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Analyse `json` easier with `ijq`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
column -J -ts: -H PW,GID,shell -N User,PW,UID,GID,Description,Home,shell /etc/passwd > host.json
|
||||||
|
ijq !$
|
||||||
|
```
|
||||||
|
|
||||||
|
If you get stuck, try adding `.[]`.
|
@@ -52,5 +52,3 @@ recset -f "$new_field" --delete $database
|
|||||||
|
|
||||||
- [Recfiles for gemini capsules](gemini://tilde.town/~dozens/gemlog/21.gmi)
|
- [Recfiles for gemini capsules](gemini://tilde.town/~dozens/gemlog/21.gmi)
|
||||||
|
|
||||||
|
|
||||||

|
|
||||||
|
@@ -1,68 +0,0 @@
|
|||||||
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
|
|
@@ -48,7 +48,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
|
||||||
@@ -63,26 +62,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
|
||||||
|
|
||||||
|
@@ -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
|
|
@@ -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
|
|
||||||
|
|
@@ -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
|
||||||
|
114
system/ansible/ansible_with_docker.md
Normal file
114
system/ansible/ansible_with_docker.md
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
---
|
||||||
|
title: "Ansible with Docker"
|
||||||
|
tags: [ "system", "ansible", "docker" ]
|
||||||
|
requires: [ "Docker" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Set up two containers: `deb` and `arch`, add them to an `ansible` hosts file, then do a 'ping' to see if they respond.
|
||||||
|
|
||||||
|
## Required Packages
|
||||||
|
|
||||||
|
- `ansible`
|
||||||
|
- `jq`
|
||||||
|
- `docker`
|
||||||
|
|
||||||
|
## Debian Container
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -di --rm --name deb --hostname deb debian
|
||||||
|
docker exec -it deb sh -c 'apt update && apt -y install openssh-server python3 sudo'
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate the host's ssh keys, then start the ssh daemon:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker exec -it deb sh -c 'ssh-keygen -A'
|
||||||
|
docker exec -d deb /usr/sbin/sshd -D
|
||||||
|
```
|
||||||
|
|
||||||
|
## Arch Linux Container
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -di --rm --name arch --hostname arch archlinux
|
||||||
|
docker exec -it arch sh -c 'pacman -Syu --noconfirm python sudo openssh'
|
||||||
|
docker exec -it arch sh -c 'ssh-keygen -A'
|
||||||
|
docker exec -d arch /usr/sbin/sshd -D
|
||||||
|
```
|
||||||
|
|
||||||
|
## `ssh` Keys
|
||||||
|
|
||||||
|
Copy across your public ssh key to the container's `authorized_keys` file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pubkey=~/.ssh/id_rsa.pub
|
||||||
|
for hostname in arch deb; do
|
||||||
|
docker cp $pubkey $hostname:/root/.ssh/authorized_keys
|
||||||
|
docker exec -it $hostname sh -c "chown -R root:root /root/.ssh/"
|
||||||
|
docker exec -it $hostname sh -c "chmod -R 700 /root/.ssh/"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hosts File
|
||||||
|
|
||||||
|
Find name of containers' IPv4 addresses.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker network inspect bridge
|
||||||
|
```
|
||||||
|
|
||||||
|
The output is awful.
|
||||||
|
Use `jq` to parse the `json`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker network inspect bridge | jq -r '.[].Containers | .[].IPv4Address'
|
||||||
|
```
|
||||||
|
|
||||||
|
Now put those into a host file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker_hosts=hosts.txt
|
||||||
|
echo '[containers]' > $docker_hosts
|
||||||
|
|
||||||
|
docker network inspect bridge | \
|
||||||
|
jq -r '.[].Containers | .[] | "root@" + .IPv4Address' | \
|
||||||
|
cut -d/ -f1 >> $docker_hosts
|
||||||
|
```
|
||||||
|
|
||||||
|
You may need to add those host keys to your known hosts file.
|
||||||
|
Either connect interactively, or (for scripts):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
hosts="$(docker network inspect bridge | jq -r '.[].Containers | .[] | .Name + " " + .IPv4Address' | \
|
||||||
|
cut -d/ -f1)"
|
||||||
|
|
||||||
|
echo "$hosts"
|
||||||
|
|
||||||
|
echo "$hosts" | while read hostname ip; do
|
||||||
|
printf "%s" "$ip"
|
||||||
|
key="$(docker exec $hostname cat /etc/ssh/ssh_host_ed25519_key.pub)"
|
||||||
|
echo "$ip $key" >> ~/.ssh/known_hosts
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
Check if they ping:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible -i $docker_hosts all -m ping
|
||||||
|
```
|
||||||
|
|
||||||
|
This command produces an irritating warning about the python interpreter (i.e., `python3`).
|
||||||
|
|
||||||
|
Make the warning shut-up:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo '
|
||||||
|
[containers:vars]
|
||||||
|
ansible_python_interpreter=/usr/bin/python3.13' >> $docker_hosts
|
||||||
|
```
|
||||||
|
|
||||||
|
Now the ping is cleaner:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible -i $docker_hosts all -m ping
|
||||||
|
```
|
||||||
|
|
@@ -3,8 +3,6 @@ title: "lf - The Light File Manager"
|
|||||||
tags: [ "file browser", "TUI" ]
|
tags: [ "file browser", "TUI" ]
|
||||||
---
|
---
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Config File
|
## Config File
|
||||||
|
|
||||||
If you don't have a `~/.config/lf/lfrc` file, you can probably find an example in `/usr/share/examples/lf`.
|
If you don't have a `~/.config/lf/lfrc` file, you can probably find an example in `/usr/share/examples/lf`.
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
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"
|
|
||||||
|
|
@@ -17,10 +17,10 @@ Remove yourself from all groups, and add yourself back to only `wheel`, `audio`,
|
|||||||
sudo usermod --groups wheel,audio,$USER
|
sudo usermod --groups wheel,audio,$USER
|
||||||
```
|
```
|
||||||
|
|
||||||
Add yourself to the `wheel` group:
|
Add yourself to the `docker` group:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
su root -c "usermod --append --groups wheel $USER"
|
su root -c "usermod --append --groups docker $USER"
|
||||||
```
|
```
|
||||||
Add yourself to the `network` group:
|
Add yourself to the `network` group:
|
||||||
|
|
||||||
@@ -28,5 +28,11 @@ Add yourself to the `network` group:
|
|||||||
sudo usermod -aG network $USER
|
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).
|
The changes have not taken effect, so log into your own account again with `su`:
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
groups
|
||||||
|
sudo su $USER
|
||||||
|
groups
|
||||||
|
```
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Docker"
|
title: "Docker"
|
||||||
tags: [ "documentation", "virtualization" ]
|
tags: [ "documentation", "virtualization" ]
|
||||||
|
requires: [ "Managing Groups" ]
|
||||||
---
|
---
|
||||||
```sh
|
```sh
|
||||||
sudo pacman -S docker
|
sudo pacman -S docker
|
||||||
|
@@ -31,6 +31,7 @@ ffmpeg -f x11grab -s "$(xdpyinfo | grep dimensions | awk '{print $2}')" -i :1.0
|
|||||||
```
|
```
|
||||||
|
|
||||||
# Add default pulse audio
|
# Add default pulse audio
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ffmpeg -f x11grab -s [screensize] -i :0.0 -f alsa -i default out.mkv
|
ffmpeg -f x11grab -s [screensize] -i :0.0 -f alsa -i default out.mkv
|
||||||
```
|
```
|
||||||
|
22
vision/make_a_gif.md
Normal file
22
vision/make_a_gif.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: "Make a gif"
|
||||||
|
tags: [ "vision" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
Split your video into frames.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
d=$(mktemp -d)
|
||||||
|
cp $vid.mp4 $d
|
||||||
|
cd $d
|
||||||
|
|
||||||
|
ffmpeg -i $vid.mp4 -vf "fps=10, scale=360:-1" frame%04d.png
|
||||||
|
gifski --fps 10 -o ${out}.gif frame*.png
|
||||||
|
```
|
||||||
|
|
||||||
|
Optimize:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gifsicle --optimize=3 --lossy=100 -o ${final}.gif ${out}.gif
|
||||||
|
```
|
||||||
|
|
@@ -3,13 +3,14 @@ title: "vim basics"
|
|||||||
tags: [ "vim", "basic" ]
|
tags: [ "vim", "basic" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
1. Insert text by pressing `i`.
|
1. Insert text by pressing `a`.
|
||||||
1. Stop inserting text by pressing `Ctrl+[`.
|
1. Stop inserting text by pressing `Ctrl+[`.
|
||||||
1. Exit with `ZZ`.
|
1. Exit with `ZZ`.
|
||||||
1. Congratulations, you now know `vim`.
|
1. Congratulations, you now know `vim`.
|
||||||
|
|
||||||
## Extras
|
## Extras
|
||||||
|
|
||||||
|
- [Learning Vim](vim/vi.md)
|
||||||
- [Navigation](vim/navigate.md)
|
- [Navigation](vim/navigate.md)
|
||||||
- [Completion](vim/completion.md)
|
- [Completion](vim/completion.md)
|
||||||
- [Search](vim/search.md)
|
- [Search](vim/search.md)
|
||||||
|
46
writing/vim/vi.md
Normal file
46
writing/vim/vi.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
title: "How to Learn `vim`"
|
||||||
|
tags: [ "vim", "learning" ]
|
||||||
|
requires: [ "vim basics" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
1. Uninstall `vim`.
|
||||||
|
1. Install `vi`.
|
||||||
|
1. Write a few blog posts.
|
||||||
|
|
||||||
|
The [ancient wisdom](https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118) is correct - everyone should start with `vi`.
|
||||||
|
But the standard wisdom fails to mention writing.
|
||||||
|
So people just 'try to remember', then they edit a couple of configuration files with `vim`, then stop, because it's a pain to think about keystrokes while thinking about how the configuration file works.
|
||||||
|
Nobody can learn like that.
|
||||||
|
|
||||||
|
Learn with a blog, or writing emails in `vim`, or writing anything, as long as it's *real writing*.
|
||||||
|
Write a journal or some recipes.
|
||||||
|
Write literally anything which is written in paragraphs.
|
||||||
|
|
||||||
|
And while you're writing, remember one rule: if you want something, `vi` can do it, you just need to look up how.
|
||||||
|
|
||||||
|
Blog first, then try out some of these commands:
|
||||||
|
|
||||||
|
- `hjkl`
|
||||||
|
- `x`
|
||||||
|
- `:!grep very %`
|
||||||
|
- `onew line<Esc>...`
|
||||||
|
- `Onew line<Esc>...`
|
||||||
|
- `~`
|
||||||
|
- `~~~~`
|
||||||
|
- `$r!`
|
||||||
|
- `w %-2`
|
||||||
|
- `x!`
|
||||||
|
- `0RTipex`
|
||||||
|
- `_4rX`
|
||||||
|
- `bc2e`
|
||||||
|
- `c2E`
|
||||||
|
- `cw`
|
||||||
|
- `cW`
|
||||||
|
- `ci'`
|
||||||
|
- `zz`
|
||||||
|
- `:set number`
|
||||||
|
- `:set nonumber`
|
||||||
|
- `:set relativenumber`
|
||||||
|
- `:set number relativenumber`
|
||||||
|
|
Reference in New Issue
Block a user