fix: improved readibility following usage

This commit is contained in:
Michele Cereda
2024-01-02 22:07:07 +01:00
parent 0145db3a9a
commit 2f6eb4a422
3 changed files with 44 additions and 36 deletions

View File

@@ -5,7 +5,7 @@ A multi-machine dotfile manager, written in Go.
## Table of contents <!-- omit in toc --> ## Table of contents <!-- omit in toc -->
1. [TL;DR](#tldr) 1. [TL;DR](#tldr)
1. [Save the current data to a remote repository](#save-the-current-data-to-a-remote-repository) 1. [Save the current state to a remote repository](#save-the-current-state-to-a-remote-repository)
1. [Gotchas](#gotchas) 1. [Gotchas](#gotchas)
1. [Snippets](#snippets) 1. [Snippets](#snippets)
1. [Further readings](#further-readings) 1. [Further readings](#further-readings)
@@ -14,55 +14,59 @@ A multi-machine dotfile manager, written in Go.
## TL;DR ## TL;DR
```sh ```sh
# initialize chezmoi # Install Chezmoi.
chezmoi init brew install 'chezmoi'
chezmoi init https://github.com/username/dotfiles.git sudo zypper install 'chezmoi'
# initialize, checkout and apply # Initialize chezmoi.
chezmoi init
chezmoi init 'https://github.com/username/dotfiles.git' --branch 'chezmoi'
# Initialize, checkout and apply all at once.
chezmoi init --apply --verbose https://github.com/username/dotfiles.git chezmoi init --apply --verbose https://github.com/username/dotfiles.git
# add a file # Add existing files to the managed set.
chezmoi add .gitconfig chezmoi add '.gitconfig'
chezmoi add --follow --template .vimrc # follow symlinks, add as template chezmoi add --follow --template '.vimrc' # follow symlinks, add as template
chezmoi add --encrypt .ssh/id_ed25519 # add encrypted chezmoi add --encrypt '.ssh/id_ed25519' # add encrypted
# edit a file # Edit files.
# the file needs to be added first # The given files need to have been added first.
chezmoi edit .tmux.conf chezmoi edit '.tmux.conf'
# check what files would change during an apply # Check what files would change during an apply.
chezmoi apply --dry-run --verbose chezmoi apply --dry-run --verbose
# check what contents would change # Check what contents would change.
chezmoi diff chezmoi diff
# apply changes # Apply changes.
chezmoi apply chezmoi apply
# show the full list of variables # Show the full list of variables.
# includes custom data from the configuration file # Includes custom data from the configuration file.
chezmoi data chezmoi data
# test a template # Test templates.
chezmoi execute-template < .local/share/chezmoi/dot_gitconfig.tmpl chezmoi execute-template < .local/share/chezmoi/dot_gitconfig.tmpl
chezmoi execute-template --init --promptString email=me@home.org < ~/.local/share/chezmoi/.chezmoi.yaml.tmpl chezmoi execute-template --init --promptString email=me@home.org < ~/.local/share/chezmoi/.chezmoi.yaml.tmpl
# use git on chezmoi's data storage # Use `git` on chezmoi's data storage.
chezmoi git add -- . chezmoi git add -- '.'
chezmoi git commit -- --message "commit message" chezmoi git commit -- -m "commit message"
chezmoi git pull -- --rebase chezmoi git pull -- --rebase
chezmoi git push -- --set-upstream origin main chezmoi git push -- --set-upstream 'origin' 'main'
# fetch the latest changes from a remote repository # Fetch the latest changes from a remote repository.
chezmoi update chezmoi update
``` ```
## Save the current data to a remote repository ## Save the current state to a remote repository
```sh ```sh
$ chezmoi cd $ chezmoi cd
chezmoi $> git remote add origin https://github.com/username/dotfiles.git chezmoi $> git remote add 'origin' 'https://github.com/username/dotfiles.git'
chezmoi $> git push -u origin main chezmoi $> git push -u 'origin' 'main'
chezmoi $> exit chezmoi $> exit
$ $
``` ```
@@ -85,7 +89,7 @@ $
## Snippets ## Snippets
```golang ```go
{{- /* Overwrite settings from the host-specific configuration files, if existing. */}} {{- /* Overwrite settings from the host-specific configuration files, if existing. */}}
{{- $hostConfigFiles := list {{- $hostConfigFiles := list
@@ -131,12 +135,12 @@ All the references in the [further readings] section, plus the following:
References References
--> -->
<!-- Upstream -->
[user guide]: https://www.chezmoi.io/user-guide/setup/
<!-- In-article sections --> <!-- In-article sections -->
[further readings]: #further-readings [further readings]: #further-readings
<!-- Upstream -->
[user guide]: https://www.chezmoi.io/user-guide/setup/
<!-- Others --> <!-- Others -->
[cheat.sh]: https://cheat.sh/chezmoi [cheat.sh]: https://cheat.sh/chezmoi
[custom data fields appear as all lowercase strings]: https://github.com/twpayne/chezmoi/issues/463 [custom data fields appear as all lowercase strings]: https://github.com/twpayne/chezmoi/issues/463

View File

@@ -38,14 +38,18 @@ sudo firewall-cmd --list-services
sudo firewall-cmd --list-services --zone='public' sudo firewall-cmd --list-services --zone='public'
sudo firewall-cmd --list-services --permanent sudo firewall-cmd --list-services --permanent
# Temporarily allow services. # Allow services.
sudo firewall-cmd --add-service='http' sudo firewall-cmd --add-service='http'
sudo firewall-cmd --add-service='ssh' --zone='public' sudo firewall-cmd --add-service='ssh' --zone='public'
# Permanently allow services.
sudo firewall-cmd --add-service='ssh' --permanent sudo firewall-cmd --add-service='ssh' --permanent
sudo firewall-cmd --add-service='https' --zone='public' --permanent sudo firewall-cmd --add-service='https' --zone='public' --permanent
# Remove services.
sudo firewall-cmd --remove-service='http'
sudo firewall-cmd --remove-service='ssh' --zone='public'
sudo firewall-cmd --remove-service='ssh' --permanent
sudo firewall-cmd --remove-service='https' --zone='public' --permanent
# List the open ports in a zone. # List the open ports in a zone.
sudo firewall-cmd --list-ports sudo firewall-cmd --list-ports
sudo firewall-cmd --list-ports --zone='public' sudo firewall-cmd --list-ports --zone='public'

View File

@@ -15,13 +15,13 @@ snapper list-config
snapper list snapper list
# Create a manual standalone snapshot. # Create a manual standalone snapshot.
snapper create -t 'single' -d 'manual checkpoint' -c '' -u 'important=yes'
snapper \ snapper \
--config 'root' \ --config 'root' \
create --read-only \ create --read-only \
--type 'single' \ --type 'single' \
--description 'manual checkpoint' \ --description 'manual checkpoint' \
--userdata 'important=yes' --userdata 'important=yes'
snapper create -t 'single' -d 'manual checkpoint' -c '' -u 'important=yes'
# Rollback to snapshot #0. # Rollback to snapshot #0.
snapper rollback 0 snapper rollback 0
@@ -39,13 +39,13 @@ snapper diff 6..21
# '' (empty string, to cancel). # '' (empty string, to cancel).
# Any description must be less than 25 characters. # Any description must be less than 25 characters.
# Any userdata must contain KEY=VALUE couples. # Any userdata must contain KEY=VALUE couples.
snapper modify -c '' 2
snapper modify -u 'important=yes' -d 'new description' -c '' 12
snapper modify \ snapper modify \
--userdata 'important=yes' \ --userdata 'important=yes' \
--description 'new description' \ --description 'new description' \
--cleanup-algorithm '' \ --cleanup-algorithm '' \
12 12
snapper modify -u 'important=yes' -d 'new description' -c '' 12
snapper modify -c '' 2
``` ```
## Further readings ## Further readings