Skip to content
Snippets Groups Projects
Unverified Commit e5de0b4d authored by Varac's avatar Varac
Browse files

add more old docs

parent 7ee4d3f1
No related branches found
No related tags found
No related merge requests found
# 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
```
# 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
# 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
# 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
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment