Skip to content

Instantly share code, notes, and snippets.

@GusAntoniassi
GusAntoniassi / README.md
Last active July 3, 2024 16:35
How to install Hashicorp Nomad on aarch64 Alpine Linux (Moto G6 / PostmarketOS)

How to install Hashicorp Nomad on aarch64 Alpine Linux (Moto G6 / PostmarketOS)

Since as of now there is no binary release for Hashicorp Nomad in aarch64, we'll have to compile it from scratch.

Install dependencies

sudo pkg add --update linux-headers bash binutils alpine-sdk
@GusAntoniassi
GusAntoniassi / README.md
Last active July 3, 2024 09:52
Moto G6 PostmarketOS initial configuration

How to configure Moto G6 with PostmarketOS

Flashing instructions

Install pmbootstrap

Follow the official docs to install pmbootstrap in the host machine.

Run pmbootstrap init, and use the following configuration:

@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 / 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
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 / 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
Last active July 3, 2024 19:47
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