Compare commits
2 Commits
master
...
7f9de785df
| Author | SHA1 | Date | |
|---|---|---|---|
|
7f9de785df
|
|||
|
723024db0b
|
@@ -9,27 +9,3 @@ The `vim-gnupg` plugin lets vim edit gpg-encrypted files as if they were unencry
|
||||
It's probably in your package manager.
|
||||
If not, you'll need to endure the faff of following the [instructions](http://www.vim.org/scripts/script.php?script_id=3645).
|
||||
|
||||
|
||||
## Prompt for password in terminal
|
||||
|
||||
Check your current gpg-agent configuration:
|
||||
|
||||
```sh
|
||||
gpgconf --list-options gpg-agent
|
||||
```
|
||||
|
||||
Create file, if it doesnt exit `~/.gnupg/gpg-agent.conf`:
|
||||
|
||||
```
|
||||
# Force terminal prompts for passwords
|
||||
pinentry-mode loopback
|
||||
|
||||
# Optional: specify which pinentry program to use
|
||||
pinentry-program /usr/bin/pinentry-tty
|
||||
```
|
||||
|
||||
Then restart gpg-agent:
|
||||
```sh
|
||||
gpg-connect-agent reloadagent /bye
|
||||
```
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: "Laptops with Void Linux"
|
||||
tags: [ "void", "laptop" ]
|
||||
---
|
||||
|
||||
Install and enable `tlp`.
|
||||
|
||||
Decide how to handle events like the lid closing in `/etc/acpi/handler.sh`.
|
||||
@@ -14,12 +14,27 @@ Say 'hello' to yourself:
|
||||
ansible --module-name=ping localhost
|
||||
```
|
||||
|
||||
Ansible takes a lot of information about each machine during setup:
|
||||
|
||||
```sh
|
||||
TMP=$(mktemp)
|
||||
ansible --module-name=setup localhost | tee $TMP
|
||||
less !$
|
||||
```
|
||||
|
||||
If you have `jq`, you can pull out info:
|
||||
|
||||
```sh
|
||||
sed -i 's/.*SUCC.*/{/' $TMP
|
||||
jq '.ansible_facts.ansible_distribution' < $TMP
|
||||
```
|
||||
|
||||
Upgrade through the package manager.
|
||||
|
||||
`packager=apt` (or `pacman` or `xbps`,...)
|
||||
|
||||
```sh
|
||||
packager=apt
|
||||
packager="$( jq -r '.ansible_facts.ansible_pkg_mgr' < $TMP )"
|
||||
ansible --module-name=${packager} --args "upgrade=yes" localhost
|
||||
```
|
||||
|
||||
@@ -87,4 +102,8 @@ ansible-inventory --list -y -i
|
||||
ansible-vault view sec.yml --vault-pass-file pass.sh
|
||||
```
|
||||
|
||||
community.general.say voice=en_GB msg="Testing 123"
|
||||
Install `espeak', then make the computer say something:
|
||||
|
||||
```sh
|
||||
ansible --module-name=say --args "msg='testing'" localhost
|
||||
```
|
||||
|
||||
71
vision/record_terminal.md
Normal file
71
vision/record_terminal.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
title: "Record a Terminal Session"
|
||||
tags: [ "vision", "share" ]
|
||||
---
|
||||
|
||||
Record a terminal command, then press 'Control + d' to exit.
|
||||
|
||||
```sh
|
||||
script --timing=time.log stat.txt
|
||||
ls -a
|
||||
ls -al
|
||||
stat ~/.bashrc
|
||||
^D
|
||||
```
|
||||
|
||||
Replay the session:
|
||||
|
||||
```sh
|
||||
scriptreplay --timing=time.log stat.txt
|
||||
```
|
||||
|
||||
Try a bare command, without any timing:
|
||||
|
||||
```sh
|
||||
script -c 'top | lolcat' loltop
|
||||
nl loltop
|
||||
```
|
||||
|
||||
Has your terminal messed up?
|
||||
Is the cursor hiding?
|
||||
Reset it!
|
||||
|
||||
```sh
|
||||
reset
|
||||
```
|
||||
If you can't see any keys, keep typing anyway: have faith in your terminal.
|
||||
|
||||
This `loltop` file will not play properly as it has no timings file.
|
||||
But you can cheat the system and use your other timings file:
|
||||
|
||||
```sh
|
||||
scriptreplay --timing=time.log loltop
|
||||
```
|
||||
|
||||
This will mostly not work well, but it shows how the timing file works:
|
||||
|
||||
|
||||
```text
|
||||
0.033401 23
|
||||
0.044513 8
|
||||
0.000016 219
|
||||
1.349324 114
|
||||
0.179106 1
|
||||
0.088790 1
|
||||
0.072821 1
|
||||
0.358337 2
|
||||
0.000254 9
|
||||
0.004720 52
|
||||
0.000084 21
|
||||
0.155462 671
|
||||
```
|
||||
|
||||
I think it works like this?
|
||||
|
||||
| How long it took | to type *n* characters |
|
||||
|:----------------:|:----------------------:|
|
||||
| 0.033401 | 23 |
|
||||
| 0.044513 | 8 |
|
||||
| 0.000016 | 219 |
|
||||
| 1.349324 | 114 |
|
||||
|
||||
Reference in New Issue
Block a user