Navigation Menu

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 / macro.txt
Last active August 29, 2015 14:22
Portugal LDA - Macro
/2 {skull} Portugal LDA {skull} a recrutar malta para HFC (670 min ilvl). Todas as candidaturas sao analisadas com pormenor. {star} Raidamos regularmente em ambiente descontraido mas responsável {star}.
public class Log4netTraceListener : TraceListener
{
public override void Write(object o)
{
base.Write(o);
}
public override void WriteLine(string message)
{
this.Write(message);
(docker container prune -f --filter "until=24h" && docker volume prune -f && docker image prune -f -a --filter "until=24h") | ts "[%Y-%m-%d %H:%M:%S]" >> /var/log/docker-curator/docker-curator.log 2>&1
@calexandre
calexandre / docker-prune.sh
Last active March 4, 2019 10:16
The following script executes a docker prune command and outputs the result to a log file. If the exit code is different from 0, it will output the result to stdout. This is very useful for crontabs since you'll only get alerted when the scripts write to the stdout.
(docker container prune -f --filter "until=24h" && docker volume prune -f && docker image prune -f -a --filter "until=24h") | ts "[%Y-%m-%d %H:%M:%S]" >> /var/log/docker-curator/docker-curator.log 2>&1
@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 / 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 / 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 / readme.md
Last active February 8, 2022 15:12
Tasmota Cheat Sheet
@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 / 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"