doc: update demo

This commit is contained in:
Glenn Y. Rolland 2023-10-25 10:53:54 +02:00
parent 716272c10b
commit abc6017eed
9 changed files with 4137 additions and 3243 deletions

1
.gitignore vendored
View file

@ -3,5 +3,6 @@
# SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net> # SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net>
# Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net> # Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net>
.vagrant
bin bin
lib lib

View file

@ -30,5 +30,5 @@ Vagrant.configure('2') do |config|
machine.vm.network 'forwarded_port', guest: 80, host: 1080, host_ip: '127.0.0.1' machine.vm.network 'forwarded_port', guest: 80, host: 1080, host_ip: '127.0.0.1'
end end
config.vm.provision 'shell', path: 'provision.sh' config.vm.provision 'shell', path: 'scripts/vagrant.provision.sh'
end end

View file

@ -9,6 +9,8 @@ Let's start by configuring `~/mnt/mfm.yml`!
--- ---
---
## Configuration ## Configuration
We can add as many filesystems we want in the `filesystems:` list. We can add as many filesystems we want in the `filesystems:` list.
@ -25,7 +27,9 @@ The current values supported by *mfm* are `gocryptfs`, `httpdirfs` and `sshfs`.
## Preparation ## Preparation
Before using `mfm`, lets have a look at the `~/mnt/` directory. Before using *mfm*, lets have a look at the `~/mnt/` directory.
---
--- ---
@ -39,13 +43,15 @@ Don't worry, the mountpoint will be created automatically.
## Usage ## Usage
Ok. Now, simply run `mfm` and choose your favorite filesystem! Ok. Now, simply run *mfm* and choose your favorite filesystem!
In this demo, I will choose `Public - Debian Repository` which is a remote web In this demo, I will choose `Public - Debian Repository` which is a remote web
page hosting debian packages and registy catalog. page hosting debian packages and registy catalog.
--- ---
---
## Usage ## Usage
Hmmm... Hmmm...
@ -67,7 +73,9 @@ navigate.
Let's detach it now! Let's detach it now!
Simply run `mfm` again, and choose the same filesystem. Simply run *mfm* again, and choose the same filesystem.
---
--- ---
@ -79,7 +87,7 @@ It is now detached, and the directory is empty again!
## Conclusion ## Conclusion
The `mfm` command works in the same way regardless of the filesystem selected. The *mfm* command works in the same way regardless of the filesystem selected.
It's simple, fast and efficient. It's simple, fast and efficient.
@ -87,7 +95,7 @@ It's simple, fast and efficient.
## Conclusion ## Conclusion
The `mfm` project is still in its infancy. The *mfm* project is still in its infancy.
We're looking for contributors to test it, to improve it, to make it even more We're looking for contributors to test it, to improve it, to make it even more
useful and enjoyable to use. useful and enjoyable to use.
@ -102,5 +110,5 @@ But if you're just a user, we're already happy.
## Conclusion ## Conclusion
Now it's your turn! Now it's your turn to use *mfm*!

23
doc/demo.mfm.yml Normal file
View file

@ -0,0 +1,23 @@
---
version: 1
global:
mountpoint: "~/mnt"
filesystems:
- type: gocryptfs
name: "Personal - Encrypted Credentials"
encrypted_path: "/path/to/credentials/vault"
- type: httpdirfs
name: "Public - Remote Debian Repository"
url: "http://ftp.debian.org/debian/"
- type: sshfs
name: "Personal - Remote Media Server"
remote_user: user
remote_host: mediaserver.local
remote_port: 22
remote_path: "/remote/path/to/media"
#

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View file

@ -1,9 +1,18 @@
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2317 # shellcheck disable=SC2317
set -u
# parameters # parameters
konsole=org.kde.konsole-2913641 konsole=org.kde.konsole-2913641
session=2 session=2
SLEEP_LONG_READ="3"
SLEEP_SHORT_READ="2"
SLEEP_TRANSITION="0.4"
SLEEP_COMMAND_BEFORE="0.4"
SLEEP_COMMAND_AFTER="0.65"
SLEEP_MICROPAUSE="0.25"
SLEEP_TYPESPEED="0.10"
qtype() { qtype() {
qdbus "$konsole" "/Sessions/$session" sendText "$1" qdbus "$konsole" "/Sessions/$session" sendText "$1"
@ -25,7 +34,7 @@ qctrlc() {
qtype_slow() { qtype_slow() {
echo -n "$1" \ echo -n "$1" \
| sed 's/\(.\)/\1\n/g' \ | sed 's/\(.\)/\1\n/g' \
| while IFS="" read -r X ; do qtype "$X" ; sleep 0.10 ; done | while IFS="" read -r X ; do qtype "$X" ; sleep "$SLEEP_TYPESPEED" ; done
} }
tmux_key() { tmux_key() {
@ -57,29 +66,53 @@ qtype_arrow_right() {
## cleanup ## cleanup
qctrlc qctrlc
qrun "clear" tmux_key "d"
qrun "cd ~/src/mfm" qctrlc
qrun "rm -f output.rec"
qrun "tmux kill-session -t demo"
qrun "sudo umount \"/home/vagrant/mnt/Public - Remote Debian Repository\""
qrun "rm -fr \"/home/vagrant/mnt/Public - Remote Debian Repository\""
qrun "# cleanup done"
sleep 5 qrun "clear"
sleep "$SLEEP_MICROPAUSE"
qrun "cd ~/src/mfm"
sleep "$SLEEP_MICROPAUSE"
qrun "cp doc/demo.mfm.yml ~/.config/mfm.yml"
sleep "$SLEEP_MICROPAUSE"
qrun "rm -f output.rec"
sleep "$SLEEP_MICROPAUSE"
qrun "tmux kill-session -t demo"
sleep "$SLEEP_MICROPAUSE"
qrun "mkdir -p /home/vagrant/mnt"
sleep "$SLEEP_MICROPAUSE"
qrun "fusermount -u \"/home/vagrant/mnt/Public - Remote Debian Repository\""
sleep "$SLEEP_MICROPAUSE"
qrun "rm -fr \"/home/vagrant/mnt/Public - Remote Debian Repository\""
sleep "$SLEEP_MICROPAUSE"
qrun "# cleanup done"
sleep "$SLEEP_LONG_READ"
## reset demo environment ## reset demo environment
qrun "tmux new -s demo" qrun "tmux new -s demo"
sleep "$SLEEP_MICROPAUSE"
tmux_key "c" tmux_key "c"
qrun "cd ~/src/mfm" qrun "cd ~/src/mfm"
qrun "mdp doc/SCRIPT.md" sleep "$SLEEP_MICROPAUSE"
qrun "mdp --noslidenum doc/SCRIPT.md"
sleep "$SLEEP_MICROPAUSE"
tmux_key "c" tmux_key "c"
qrun "export PATH=\$PATH:~/src/mfm/bin" qrun "export PATH=\$PATH:~/src/mfm/bin"
sleep "$SLEEP_MICROPAUSE"
qrun "export FZF_DEFAULT_OPTS=\"--height 40% --layout=reverse --border\""
sleep "$SLEEP_MICROPAUSE"
qrun "alias cat=\"batcat -p\""
sleep "$SLEEP_MICROPAUSE"
qrun "cd ~/src/mfm" qrun "cd ~/src/mfm"
sleep "$SLEEP_MICROPAUSE"
qrun "clear"
sleep "$SLEEP_MICROPAUSE"
tmux_key "1" tmux_key "1"
tmux_key ":" tmux_key ":"
qrun "set -g status off" qrun "set -g status off"
sleep "$SLEEP_MICROPAUSE"
tmux_key "d" tmux_key "d"
@ -87,208 +120,246 @@ tmux_key "d"
qrun "asciinema rec --cols 80 --rows 24 -c 'tmux attach' output.rec" qrun "asciinema rec --cols 80 --rows 24 -c 'tmux attach' output.rec"
# slide 1 (title) # slide 1 (title)
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 2 (config file) # slide 2 (config file)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# cmd 2 (show config file) # cmd 2 (show config file)
qtype " "
sleep "$SLEEP_TRANSITION"
tmux_key "2" tmux_key "2"
qtype_slow "cat " qtype_slow "cat "
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "~/.config" qtype_slow "~/.config"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "/mfm.yml" qtype_slow "/mfm.yml"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qrun "" qrun ""
sleep 4 sleep "$SLEEP_LONG_READ" # double
sleep "$SLEEP_LONG_READ"
tmux_key "1" tmux_key "1"
# slide 3 (config options 1) # slide 3 (config options 1)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 4 (config options 2) # slide 4 (config options 2)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 5 (preparation - mnt) # slide 5 (preparation - mnt)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# demo 5 (show mnt) # demo 5 (show mnt)
qtype " "
sleep "$SLEEP_TRANSITION"
tmux_key "2" tmux_key "2"
qtype_slow "cd " qtype_slow "cd "
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "~/mnt" qtype_slow "~/mnt"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qrun "" qtype $'\015'
sleep 0.5 sleep "$SLEEP_COMMAND_AFTER"
qtype_slow "ls" qtype_slow "ls"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qrun "" qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_LONG_READ"
tmux_key "1" tmux_key "1"
# slide 6 (preparation - empty mnt!) # slide 6 (preparation - empty mnt!)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 7 (usage - run) # slide 7 (usage - run)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# demo 7 (run mfm) # demo 7 (run mfm)
qtype " "
sleep "$SLEEP_TRANSITION"
tmux_key "2" tmux_key "2"
qtype_slow "m" qtype_slow "m"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "f" qtype_slow "f"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "m" qtype_slow "m"
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_arrow_up
sleep 0.25
qtype_arrow_up
sleep 0.25
qtype_arrow_up
sleep 0.5
qtype_arrow_down qtype_arrow_down
sleep 1 sleep "$SLEEP_MICROPAUSE"
qtype_arrow_down
sleep "$SLEEP_MICROPAUSE"
qtype_arrow_up
sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_LONG_READ"
tmux_key "1" tmux_key "1"
# slide 8 (usage - what?) # slide 8 (usage - what?)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# demo 8 (usage - what : show mnt) # demo 8 (usage - what : show mnt)
tmux_key "2" tmux_key "2"
qtype_slow "ls" qtype_slow "ls"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_slow "cd \"Pub" qtype_slow "cd \"Pub"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype "lic - Remote Debian Repository\"" qtype "lic - Remote Debian Repository\""
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 0.5 sleep "$SLEEP_COMMAND_AFTER"
qtype_slow "ls" qtype_slow "ls"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_SHORT_READ"
qtype_slow "cd pool" qtype_slow "cd pool"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 0.5 sleep "$SLEEP_COMMAND_AFTER"
qtype_slow "ls" qtype_slow "ls"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_slow "cd main" qtype_slow "cd main"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 0.5 sleep "$SLEEP_COMMAND_AFTER"
qtype_slow "ls" qtype_slow "ls"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_LONG_READ"
tmux_key "1" tmux_key "1"
# slide 9 (usage - explanation) # slide 9 (usage - explanation)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 10 (usage - prepare for detach) # slide 10 (usage - prepare for detach)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# demo 10 (run mfm for detach) # demo 10 (run mfm for detach)
qtype " "
sleep "$SLEEP_TRANSITION"
tmux_key "2" tmux_key "2"
qtype_slow "cd ~/mnt/" qtype_slow "cd ~/mnt/"
sleep 0.25 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
qtype_slow "m" qtype_slow "m"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "f" qtype_slow "f"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype_slow "m" qtype_slow "m"
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_arrow_up
sleep 0.25
qtype_arrow_up
sleep 0.25
qtype_arrow_up
sleep 0.5
qtype_arrow_down qtype_arrow_down
sleep 1 sleep "$SLEEP_MICROPAUSE"
qtype_arrow_down
sleep "$SLEEP_MICROPAUSE"
qtype_arrow_up
sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_LONG_READ"
qtype_slow "ls" qtype_slow "ls"
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_slow "cd \"Pub" qtype_slow "cd \"Pub"
sleep 0.25 sleep "$SLEEP_MICROPAUSE"
qtype "lic - Remote Debian Repository\"" qtype "lic - Remote Debian Repository\""
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_slow "ls" qtype_slow "ls"
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 2 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_SHORT_READ"
qtype_slow "ls -la" qtype_slow "ls -la"
sleep 1 sleep "$SLEEP_COMMAND_BEFORE"
sleep "$SLEEP_COMMAND_BEFORE"
qtype $'\015' qtype $'\015'
sleep 4 sleep "$SLEEP_COMMAND_AFTER"
sleep "$SLEEP_LONG_READ"
tmux_key "1" tmux_key "1"
# slide 11 (usage - detached) # slide 11 (usage - detached)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 12 (conclusion) # slide 12 (conclusion)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 13 (conclusion) # slide 13 (conclusion)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 14 (conclusion) # slide 14 (conclusion)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# slide 15 (conclusion) # slide 15 (conclusion)
qtype " " qtype " "
sleep 4 sleep "$SLEEP_TRANSITION"
sleep "$SLEEP_LONG_READ"
# detach and clean # detach and clean
tmux_key "d" tmux_key "d"

View file

@ -21,18 +21,23 @@ apt-get install -y \
gnupg2 \ gnupg2 \
software-properties-common software-properties-common
echo "Installing recording requirements"
apt-get install -y \
tmux \
mdp \
bat \
asciinema \
termtosvg
echo "Installing mfm requirements" echo "Installing mfm requirements"
apt-get install -y \ apt-get install -y \
fzf \ fzf \
sshfs \ sshfs \
httpdirfs \ httpdirfs \
asciinema \
libyaml-0-2 \ libyaml-0-2 \
libyaml-dev \ libyaml-dev \
libpcre3-dev \ libpcre3-dev \
libevent-dev \ libevent-dev
vim \
termtosvg
#!/bin/sh #!/bin/sh