diff --git a/.cspell.config.yaml b/.cspell.config.yaml new file mode 100644 index 0000000..df0c1b6 --- /dev/null +++ b/.cspell.config.yaml @@ -0,0 +1,132 @@ +# https://cspell.org/configuration/ +version: "0.2" +language: en,pt +dictionaries: + - en-us + - pt-br + - softwareTerms + - bash + - networking-terms +import: + - "@cspell/dict-pt-br/cspell-ext.json" +words: + - alice + - anubis + - asciidoctor + - bioinformaticians + - bioinformatics + - Clonezilla + - Configless + - cpus + - colortheme + - ctstate + - colorthemeswitcher + - comentario + - conntrack + - chacha + - cspell + - dport + - docker + - ESXi + - fail2ban + - findtime + - filesystems + - frontmatter + - GParted + - GSSAPI + - HELO + - hreflang + - icmpv6 + - iptables + - ignoreip + - ip6tables + - ipset + - jails + - jsonld + - lastmod + - linkcheck + - linkinator + - lychee + - markdownlint + - maxretry + - mathjax + - mermaid + - nerdalert + - netcat + - noindex + - nvme + - opencode + - oque + - pagination + - PagerSize + - QUIC + - rsync + - sshaudit + - sbatch + - scancel + - scontrol + - sinfo + - slurmd + - slurmctld + - slurmdbd + - squeue + - srun + - shortcodes + - Sysadmin + - sysadmin + - textlint + - trafego + - Thanwer + - TOML + - umami + - Umami + - VMDK + - VMX + - webserver + - yamllint + - ZgotmplZ + - arancibia + - thanwer + - bantime + - bootable + - configless + - dropadas + - dropar + - dropamos + - enablecolorthemeswitcher + - Gparted + - hugo + - icds + - JOBID + - nmap + - Nmap + - NODELIST + - nodelist + - ntasks + - readnextposts + - shinobi + - Slurm + - slurm + - slurmctl + - socialicons + - TIMELIMIT + - unbootable + - Universität + - pietro +flagWords: [] +ignorePaths: + - node_modules + - public + - resources + - .git + - "*.gif" + - "*.png" + - "*.jpg" + - "*.webp" + - "*.svg" + - "*.ico" + - themes + - "package.json" + - "package-lock.json" +enableFiletypes: + - markdown diff --git a/.lychee.toml b/.lychee.toml new file mode 100644 index 0000000..68e416a --- /dev/null +++ b/.lychee.toml @@ -0,0 +1,14 @@ +# https://github.com/lycheeverse/lychee +exclude = [ + "linkedin\\.com", + "facebook\\.com", + "instagram\\.com", + "x\\.com", + "t\\.me", + "telegram\\.me", + "youtube\\.com", + "sshaudit\\.com", +] +exclude_private = true +timeout = 20 +max_retries = 2 diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 0000000..2d16455 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,7 @@ +linkedin\.com +facebook\.com +instagram\.com +x\.com +t\.me +telegram\.me +youtube\.com diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 0000000..cffe2ce --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,63 @@ +# https://github.com/DavidAnson/markdownlint-cli2 +frontMatter: (^\+\+\+$[^]*?^\+\+\+$) + +globs: + - "content/**/*.md" + +config: + MD001: true + MD003: + style: atx + MD004: + style: dash + MD005: true + MD007: false + MD009: true + MD010: true + MD011: true + MD012: true + MD013: false + MD014: true + MD018: true + MD019: true + MD020: true + MD021: true + MD022: true + MD023: true + MD024: false + MD025: + front_matter_title: "\\s*title\\s*=" + level: 1 + MD026: true + MD027: true + MD028: false + MD029: + style: one + MD030: true + MD031: true + MD032: true + MD033: false + MD034: false + MD035: + style: --- + MD036: true + MD037: true + MD038: true + MD039: true + MD040: true + MD041: false + MD042: true + MD043: false + MD044: false + MD045: true + MD046: false + MD047: true + MD048: + style: backtick + MD049: + style: underscore + MD050: + style: asterisk + MD051: false + MD052: true + MD053: true diff --git a/.markdownlintrc b/.markdownlintrc new file mode 100644 index 0000000..78b88e4 --- /dev/null +++ b/.markdownlintrc @@ -0,0 +1,56 @@ +MD001: true +MD003: + style: atx +MD004: + style: dash +MD005: true +MD007: false +MD009: true +MD010: true +MD011: true +MD012: true +MD013: false +MD014: true +MD018: true +MD019: true +MD020: true +MD021: true +MD022: true +MD023: true +MD024: false +MD025: + front_matter_title: "\\s*title\\s*=" + level: 1 +MD026: true +MD027: true +MD028: false +MD029: + style: one +MD030: true +MD031: true +MD032: true +MD033: false +MD034: false +MD035: + style: --- +MD036: true +MD037: true +MD038: true +MD039: true +MD040: true +MD041: false +MD042: true +MD043: false +MD044: false +MD045: true +MD046: false +MD047: true +MD048: + style: backtick +MD049: + style: underscore +MD050: + style: asterisk +MD051: false +MD052: true +MD053: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ccd23a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,39 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-merge-conflict + - id: check-yaml + - id: check-toml + - id: check-json + - id: end-of-file-fixer + - id: mixed-line-ending + args: [--fix=auto] + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: check-added-large-files + args: [--maxkb=1024] + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.48.0 + hooks: + - id: markdownlint + args: [--config, .markdownlintrc] + + - repo: https://github.com/streetsidesoftware/cspell-cli + rev: v10.0.0 + hooks: + - id: cspell + args: [--no-summary, --no-progress, --config, .cspell.config.yaml] + additional_dependencies: + - "@cspell/dict-pt-br" + types: [markdown] + + - repo: local + hooks: + - id: lychee + name: lychee + entry: lychee + args: [--config, .lychee.toml, --root-dir, static, --no-progress] + language: system + types: [markdown] diff --git a/content/posts/netcat.md b/content/posts/netcat.md index 63881b3..e476969 100644 --- a/content/posts/netcat.md +++ b/content/posts/netcat.md @@ -58,9 +58,9 @@ I invite you to read the [nc man page](https://linux.die.net/man/1/nc). The main options we need to use are: -* -p : This specifies which port should we listen to. -* -k : This makes netcat to keep listening after a client disconnects. -* -u : Use UDP instead of TCP +- -p : This specifies which port should we listen to. +- -k : This makes netcat to keep listening after a client disconnects. +- -u : Use UDP instead of TCP ### Use cases diff --git a/content/posts/netcat.pt.md b/content/posts/netcat.pt.md index 8225fc7..614ba1b 100644 --- a/content/posts/netcat.pt.md +++ b/content/posts/netcat.pt.md @@ -59,9 +59,9 @@ Lhes convido a ler a [man page do nc](https://linux.die.net/man/1/nc). Os principais argumentos que precisamos são: -* -p : Isso especifica a porta que queremos escutar. -* -k : Isso mantem o netcat aberto mesmo depois do cliente desconectar. -* -u : Isso faz o netcat escutar UDP em vez de TCP. +- -p : Isso especifica a porta que queremos escutar. +- -k : Isso mantém o netcat aberto mesmo depois do cliente desconectar. +- -u : Isso faz o netcat escutar UDP em vez de TCP. ### Casos de uso @@ -89,9 +89,9 @@ Veja um exemplo disso funcionando: ![Exemplo de uso do netcat](/images/nc-example1.gif) -#### Transferencia de arquivos +#### Transferência de arquivos -O netcat tambem pode ser usado para transferir arquivos entre dois hosts, isso é util em casos de ambientes sem acessos FTP ou SCP. +O netcat também pode ser usado para transferir arquivos entre dois hosts, isso é util em casos de ambientes sem acessos FTP ou SCP. No receptor: diff --git a/content/posts/shrink-vmdk.md b/content/posts/shrink-vmdk.md index 0c52192..03a661f 100644 --- a/content/posts/shrink-vmdk.md +++ b/content/posts/shrink-vmdk.md @@ -79,4 +79,4 @@ This will leave you with the original VMDK file, and a smaller one. After verify ## Conclusion -Using Clonezilla to clone to a smaller disk is a safe and reliable method to shrink VMDK files without touching VMX files directly. While it requires more steps than the manual approach, it reduces the risk of configuration errors that could leave your VM unbootable. As always, keep backups before attempting any disk resizing operations. \ No newline at end of file +Using Clonezilla to clone to a smaller disk is a safe and reliable method to shrink VMDK files without touching VMX files directly. While it requires more steps than the manual approach, it reduces the risk of configuration errors that could leave your VM unbootable. As always, keep backups before attempting any disk resizing operations. diff --git a/content/posts/slurm.md b/content/posts/slurm.md index 34b55d5..7ede3c9 100644 --- a/content/posts/slurm.md +++ b/content/posts/slurm.md @@ -50,10 +50,10 @@ The main workflow of Slurm is quite simple: python my_script.py ``` -2. The user submits a job to the Slurm controller using the `sbatch` command -3. The Slurm controller adds the job to the queue and assigns it a job ID -4. The Slurm controller schedules the job to run on a compute node when resources are available -5. The compute node executes the job and sends the output back to the user +1. The user submits a job to the Slurm controller using the `sbatch` command +1. The Slurm controller adds the job to the queue and assigns it a job ID +1. The Slurm controller schedules the job to run on a compute node when resources are available +1. The compute node executes the job and sends the output back to the user The user can monitor the job status using the `squeue` command. The administrator can manage the jobs using the `scancel` command to cancel a job, or the `scontrol` command to modify a job. @@ -120,7 +120,7 @@ Since Slurm is very popular in the academic world, there are many universities t ### Configless mode -Since Slurm 20.02, it supports a configless mode, which means that you don't need to create a `/etc/slurm/slurm.conf` file on each node, instead, you can use the `slurmctld` to distribute the configuration to all nodes. +Since Slurm 20.02, it supports a configless mode, which means that you don't need to create a `/etc/slurm/slurm.conf` file on each node, instead, you can use the `slurmctld` to distribute the configuration to all nodes. This is a great feature, and it simplifies the installation process a lot. [The official documentation is here](https://slurm.schedmd.com/configless_slurm.html). @@ -145,6 +145,6 @@ Slurm-Mail is a drop in replacement for Slurm's e-mails to give users much more Now this is a feature that I was not aware of, but Slurm has a built-in power saving feature, which allows you to automatically power on/off compute nodes based on demand. -It relies on scripts that you need to provide, one for powering on a node, and another for powering off a node. You can find the documentation [here](https://slurm.schedmd.com/power_save.html). +It relies on scripts that you need to provide, one for powering on a node, and another for powering off a node. You can find the [Slurm power saving documentation](https://slurm.schedmd.com/power_save.html). In my case I adapted [the scripts from here](https://github.com/OleHolmNielsen/Slurm_tools/tree/master/power_save) to use IPMI to power on/off the nodes. diff --git a/content/posts/ssh-hardening.pt.md b/content/posts/ssh-hardening.pt.md index 82a8665..fbfe937 100644 --- a/content/posts/ssh-hardening.pt.md +++ b/content/posts/ssh-hardening.pt.md @@ -33,7 +33,7 @@ PermitRootLogin no ### Autenticação por dois fatores (2FA) -Se voce quiser mais um nivel de segurança, voce pode implementar [autenticação de dois fatores com o Google Authenticator](https://docs.vultr.com/how-to-use-two-factor-authentication-with-sudo-and-ssh-on-linux-with-google-authenticator). +Se voce quiser mais um nível de segurança, voce pode implementar [autenticação de dois fatores com o Google Authenticator](https://docs.vultr.com/how-to-use-two-factor-authentication-with-sudo-and-ssh-on-linux-with-google-authenticator). ### Desativar métodos de autenticação não utilizados @@ -47,7 +47,7 @@ GSSAPIAuthentication no ## Melhorar algoritmos de criptografia do SSH -Seguindo [esses guias](https://www.sshaudit.com/hardening_guides.html) voce pode desabilitar algoritmos de autenticação e criptografia vulneraveis e priorizar os mais fortes (AES-256-GCM, chacha20-poly1305). +Seguindo [esses guias](https://www.sshaudit.com/hardening_guides.html) voce pode desabilitar algoritmos de autenticação e criptografia vulneráveis e priorizar os mais fortes (AES-256-GCM, chacha20-poly1305). Quando voce terminar, verifique com a ferramenta [ssh-audit](https://github.com/jtesta/ssh-audit). diff --git a/deploy.sh b/deploy.sh index 63ff99b..84efc00 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,2 +1,16 @@ #!/usr/bin/env bash -hugo --minify && rsync -avz --delete public/ shinobi.thanwer.com:/srv/www/blog/ \ No newline at end of file +set -euo pipefail + +echo "=== Running pre-commit hooks ===" +pre-commit run --all-files + +echo "" +echo "=== Building site ===" +hugo --minify + +echo "" +echo "=== Deploying to server ===" +rsync -avz --delete public/ shinobi.thanwer.com:/srv/www/blog/ + +echo "" +echo "=== Done ===" diff --git a/layouts/partials/footer-extra.html b/layouts/partials/footer-extra.html index e5f0c99..220b5ce 100644 --- a/layouts/partials/footer-extra.html +++ b/layouts/partials/footer-extra.html @@ -6,4 +6,4 @@ 'floating-chat.donateButton.background-color': '#794bc4', 'floating-chat.donateButton.text-color': '#fff' }); - \ No newline at end of file + diff --git a/layouts/partials/post-info.html b/layouts/partials/post-info.html index fc51541..d4cb930 100644 --- a/layouts/partials/post-info.html +++ b/layouts/partials/post-info.html @@ -53,4 +53,4 @@ {{ end }} - \ No newline at end of file + diff --git a/static/favicon.svg b/static/favicon.svg index 609ab29..0d05462 100644 --- a/static/favicon.svg +++ b/static/favicon.svg @@ -1,3 +1,3 @@ \ No newline at end of file + diff --git a/static/humans.txt b/static/humans.txt index 3cf35fe..cac60ed 100644 --- a/static/humans.txt +++ b/static/humans.txt @@ -1,6 +1,6 @@ - _ _ -| | | |_ _ _ __ ___ __ _ _ __ ___ + _ _ +| | | |_ _ _ __ ___ __ _ _ __ ___ | |_| | | | | '_ ` _ \ / _` | '_ \/ __| | _ | |_| | | | | | | (_| | | | \__ \ |_| |_|\__,_|_| |_| |_|\__,_|_| |_|___/