Skip to content

Instantly share code, notes, and snippets.

View calexandre's full-sized avatar
:shipit:
🤘

Carlos Alexandre calexandre

:shipit:
🤘
View GitHub Profile
@calexandre
calexandre / README.md
Last active May 13, 2024 21:55 — forked from nunofgs/README.md
Use any RTSP camera with Prusa Connect

I use a cheap Tapo C100 webcam to monitor my 3D prints. It supports RTSP.

Screenshot 2023-07-17 at 23 26 34

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera.
  3. Click the QR code link
  4. Click "Start Camera"
@calexandre
calexandre / azurerm-find-private-endpoint-zones.tf
Last active December 19, 2022 16:43
azurerm-find-private-endpoint-zones.tf
locals {
azurerm_private_endpoint = {
custom_dns_configs = [
{
"fqdn" = "something.westeurope.data.azurecr.io"
"ip_addresses" = [
"10.10.10.202"
]
},
{
@calexandre
calexandre / main.tf
Created December 4, 2022 18:25
terraform code to get all GCP shared-vpc service-projects attached to a particular host-project
# instructions:
# on the first run you to target apply otherwise terraform will complain with for_each
# 1. terraform apply -target='null_resource.projects'
# 2. terraform apply
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
@calexandre
calexandre / external-dns_and_cert-manager.tf
Created April 14, 2022 15:18
ExternalDNS + CertManager helm chart terraform
## deploys the external-dns - https://github.com/kubernetes-sigs/external-dns
## view latest version: helm search repo external-dns/external-dns
## view possible values: helm inspect values external-dns/external-dns
resource "helm_release" "external_dns" {
name = "external-dns"
repository = "https://kubernetes-sigs.github.io/external-dns"
chart = "external-dns"
version = "1.8.0"
namespace = "external-dns"
@calexandre
calexandre / validate-webhook.sh
Created April 1, 2022 09:21
dvaz script to validate if k8s `mutating/validating` webhooks have their SAN configured or not
#!/bin/sh
MUTATING_WEBHOOKS=($(kubectl get mutatingwebhookconfiguration -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'))
VALIDATING_WEBHOOKS=($(kubectl get validatingwebhookconfigurations -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'))
# Check Mutating WebHooks
echo ":: Checking Mutating WebHooks ::"
echo "::____________________________::"
@calexandre
calexandre / main.tf
Last active August 20, 2021 13:12
GCP DNS mass creation with Terraform
locals {
# the default is important in case you need it elsewhere (it points to the first zone created)
dns_default_zone = "my-dns-zone"
dns_default_fqdn = "${local.dns_default_zone}.${data.google_dns_managed_zone.parent[local.dns_default_zone].dns_name}"
dns_zones = {
"${local.dns_default_zone}" = {
parent_zone_name = "my-parent-dns-zone"
}
}
}
@calexandre
calexandre / scoop-packages.ps1
Last active September 2, 2020 12:22
My windows scoop packages
# Add scoop buckets
scoop bucket add extras
scoop bucket add scoop-completion https://github.com/Moeologist/scoop-completion
# Install scoop packages
scoop install 7zip
scoop install starship
scoop install keepass
scoop install keepass-plugin-keeanywhere
scoop install openssl
@calexandre
calexandre / Microsoft.PowerShell_profile.ps1
Created September 2, 2020 12:17
My powershell profile
Invoke-Expression (&starship init powershell)
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
# enable completion in current shell, use absolute path because PowerShell Core not respect $env:PSModulePath
Import-Module "$($(Get-Item $(Get-Command scoop).Path).Directory.Parent.FullName)\modules\scoop-completion"
@calexandre
calexandre / readme.md
Last active February 8, 2022 15:12
Tasmota Cheat Sheet
@calexandre
calexandre / merge-zsh-history.sh
Last active October 9, 2024 22:26
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1