Skip to content

Instantly share code, notes, and snippets.

@GusAntoniassi
GusAntoniassi / README.md
Last active June 20, 2024 11:14
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh
@GusAntoniassi
GusAntoniassi / README.md
Created May 14, 2020 00:50
Play audio files on your microphone with ffmpeg

play-audio-mic.sh

This script was adapted to allow you to play audio files through your microphone input. It does so by creating a virtual microphone and piping an audio file to it.

The work was mostly done in this StackOverflow answer, I just adapted it to use ffmpeg and add a trap to cleanup on exit.

Requirements:

  • ffmpeg
  • Bash
  • PulseAudio/pactl
@GusAntoniassi
GusAntoniassi / README.md
Created October 6, 2020 21:16
Terraform external data provider - Shell script with input without jq

This is an example workaround for getting Terraform input variables when you won't have jq available in the executing machine.

Uses sed to parse the input JSON to extract a certain key from the input JSON.

Warning: this hasn't really been well-tested, it will pretty much work only with string values and will likely break for strings that have quotes. Might give you an idea of how to improve it for your implementation though.

@GusAntoniassi
GusAntoniassi / README.md
Created May 25, 2020 13:50
AWS CloudFormation Nested Stack bucket policy

This S3 bucket policy allows CloudFormation to read your Nested Stack template without making it public for everyone.

Policy JSON:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowCloudformationAccessBucket",
 "Effect": "Allow",
@GusAntoniassi
GusAntoniassi / etc-securetty
Created July 3, 2020 12:45
/etc/securetty
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
console
# Local X displays (allows empty passwords with pam_unix's nullok_secure)
:0
:0.0
:0.1
:1
@GusAntoniassi
GusAntoniassi / README.md
Last active June 5, 2020 15:43
AWS Well Architected Framework - Anotações

AWS Well Architected Framework

O que é?

  • Melhores práticas pra utilização da AWS
  • Princípios, melhores práticas e questões
  • Pensado pelos SA em contato com os clientes
  • Como você está usando os serviços da AWS?
  • Se o alicerce não está sólido, o prédio inteiro pode ser comprometido
@GusAntoniassi
GusAntoniassi / readme.md
Last active April 21, 2020 02:46
Elastic Stack - Eth0

001 - O que é Elastic Stack

O que dá pra fazer com a stack?

  • Logs centralizados
  • Métricas de serviços e servidores
  • APM
  • Segurança (SIEM)
  • Análise de negócios
  • IoT
  • Monitoramento de redes sociais
  • Buscas inteligentes dentro do site
@GusAntoniassi
GusAntoniassi / README.md
Created April 19, 2020 14:37
[Anotações] Melhores práticas para sua pipeline de infra as code - Gomex

https://www.youtube.com/watch?v=XGSuK8kyGag

Infra imutável

  • Golden image
  • Não recebe modificação depois de criada

Infra como produto

  • Parar de ser um time baseado em atender ticket
  • Entrega um artefato, e não a infra funcionando em algum lugar