diff --git a/docs/etc/sed.md b/docs/etc/sed.md new file mode 100644 index 0000000000000000000000000000000000000000..58d8a88c23c92fe54d9e36329dfb248e5d977c15 --- /dev/null +++ b/docs/etc/sed.md @@ -0,0 +1,44 @@ +# Sed + +## Greedy Regexp in sed + +<http://www.skybert.net/unix/non-greedy-matching-in-sed/> + +> What you need to do, is to match against everything +> but the closing delimiter, in our case, the '@'. +> This is done with the character group notation +> and the negator ^ in front of the closing delimiter: + +```sh +echo 'The @HashMap@ and @ArrayList@ classes are great!' | sed 's|@\([^@]*\)@|<code>\1</code>|g' +``` + +## Multiple sed cmds in cli + +```sh +sed "s/:/\//g; s/git@/https:\/\//" +``` + +## Change date format + +```sh +sed -i -E "s|([0-9]{4})/([0-9]{2})/([0-9]{2})|\1-\2-\3|" transactions-* +``` + +## Remove empty lines and comments + +<https://stackoverflow.com/a/23808815> + +```sh +sed -e '/^\s*#.*$/d' -e '/^\s*$/d' inputFile +``` + +## Replace after matching line + +<https://stackoverflow.com/a/18620241> + +i.e. Replace third line after match (`foo`): + +```sh +sed -i '/foo/{n;n;n;s/bar/baz/}' test.txt +``` diff --git a/docs/templating/jinja.md b/docs/templating/jinja.md new file mode 100644 index 0000000000000000000000000000000000000000..40801a5dde76e354ed8a23d3934f94aaba3e2b82 --- /dev/null +++ b/docs/templating/jinja.md @@ -0,0 +1,43 @@ +# Jinja + +- [Website](https://jinja.palletsprojects.com/) +- [Docs: Templates](https://jinja.palletsprojects.com/en/3.1.x/templates/) + +## CLI usage + +## jinja2-cli + +- [jinja2-cli](https://github.com/mattrobenolt/jinja2-cli) + +### Install + +```sh +brew install jinja2-cli +``` + +or + +```sh +pipx install jinja2-cli +``` + +### Usage + +#### Yaml + +```sh +cd ~/projects/templating/jinja +jinja2 indentation.j2 data.yml +``` + +### Other jinja cli tools + +- [j2cli](https://github.com/kolypto/j2cli): Last commit 2019 +- [jinja-cli](https://github.com/cykerway/jinja-cli): Last commit 2021-12 + +## Ansible + +[Playboooks templating](https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html) + +> Ansible uses Jinja2 templating to enable dynamic expressions and access to +> variables diff --git a/docs/terminal/tmux.md b/docs/terminal/tmux.md new file mode 100644 index 0000000000000000000000000000000000000000..3e6eeb6c1411368e2fd5a90d898c96dcca9ad54c --- /dev/null +++ b/docs/terminal/tmux.md @@ -0,0 +1,36 @@ +# Tmux + +Tmux cheat sheet: <https://gist.github.com/MohamedAlaa/2961058> + +- `~/projects/terminals/tmux` + +## Plugins + +- [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) +- [Tmux plugin list](https://github.com/tmux-plugins/list) + +## Tmux issues + +`open terminal failed: missing or unsuitable terminal: xterm-kitty` + +```sh +export TERM=screen +``` + +## Script tmux window layout + +### tmuxp + +[tmuxp](https://tmuxp.git-pull.com/) + +### Other + +- [tmuxinator](https://github.com/tmuxinator/tmuxinator) (ruby) + +## tmux like cluster-ssh + +- [xpanes](https://github.com/greymd/tmux-xpanes) +- [intmux](https://github.com/dsummersl/intmux) +- [tmux-cssh](https://github.com/peikk0/tmux-cssh) +- [davidscholberg/tmux-cluster](https://github.com/davidscholberg/tmux-cluster) stalled at 2016 +- [tcluster](https://github.com/ntnn/tcluster) stalled at 2016 diff --git a/docs/web/hugo.md b/docs/web/hugo.md new file mode 100644 index 0000000000000000000000000000000000000000..9adeb89842847a7a8277ff45fce00323e532d789 --- /dev/null +++ b/docs/web/hugo.md @@ -0,0 +1,16 @@ +# Hugo + +<https://gohugo.io/> +<https://themes.gohugo.io/> + +<https://gohugo.io/getting-started/quick-start/> + +## Create new site + +```sh +hugo new site openappstech-website +git submodule add https://github.com/themefisher/vex-hugo.git themes/vex-hugo +echo 'theme = "vex-hugo"' >> config.toml + +hugo server +```