Skip to content

Instantly share code, notes, and snippets.

View alfredopalhares's full-sized avatar

Alfredo Palhares alfredopalhares

  • Prozis
  • Ponte de Lima, Portugal
  • 17:32 (UTC)
View GitHub Profile
@alfredopalhares
alfredopalhares / README.md
Last active November 14, 2024 10:43
Script to diff un-updatebale Statefulsets fiesl

List un-updatabale file Kubernetes Statefulset

https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets

There are some cases that you might be trying to update a statefulset and you get this error:

Error: cannot patch "my-statefulset" with kind StatefulSet: StatefulSet.apps "my-statefulset" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden && cannot patch "my-statefulset-tracking" with kind StatefulSet: StatefulSet.apps "my-statefulset-tracking" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

And while you can diff a file manually beteween you update and the yaml that you can fecth: kubectl -n my-ns get sts my-statefulset -o yaml

@alfredopalhares
alfredopalhares / CDG.py
Last active February 28, 2023 21:16
Beancount Importer Module for the Caixa Geral Depositos Bank
""" I need Core Number D for decimal values """
from beancount.core.number import Decimal
from beancount.ingest import importer
from beancount.core import account
from beancount.core import amount
from beancount.core import flags
from beancount.core import data
from beancount.core.position import Cost
import csv
@alfredopalhares
alfredopalhares / README.md
Last active March 1, 2021 16:47
Collect Azure Resource List and Virtual Machines into SQLite

Keybase proof

I hereby claim:

  • I am alfredopalhares on github.
  • I am alfredopalhares (https://keybase.io/alfredopalhares) on keybase.
  • I have a public key whose fingerprint is 1939 72B8 E30B 7A8D D822 535B C349 E2F2 4B94 1CE6

To claim this, I am signing this object:

Fitness - Garmin Instinct

TODO

  • Tentar Garmin Exppress no Wine
  • Investigar ferramentas para analisar fit files

Updating

Updating is always a pain, since I don't have garmin express

@alfredopalhares
alfredopalhares / backup-offline.sh
Last active January 29, 2018 15:30
Simple duplicity backup script
#!/usr/bin/env bash
# Backup script to an offline external drive
#
# Assumptions:
# * The drive is already mounted and it matches the destination
# * The encryption is taken care at the drive itself and its decypted before
# the script starts
#
# Is its recomemended to run this script without perfoming any workload
---
- hosts:
- oracle-db-prod
- teg-prd-db
become: true
vars:
oracle_base: "/u01/app/oracle"
rman_retention_policy: "RECOVERY WINDOW OF 7 DAYS"
Hello,
I would like to be able to make a custom DSL that is based on set of ther DSL, to further explain myself I will show the problem:
We have a base DSL that defines a new VPC on AWS, that code it has all the necessary network settings witha all the subnets settings, DMZ style, security groups, etc
Currently we have the base code with all the variables set, so if a team needs to set the new network settings, they will just copy the code, update the ``varibales.tf`` to their needs.
This works up to the point when I need to update base terraform syntax, it becomes a tedious and error prone to pass those changes accross all the existent networks.
@alfredopalhares
alfredopalhares / gist:d475257c84410c7fcca6
Last active July 13, 2024 15:24
Restoring a PDF file from chrome cache

So I was trying to do my duties as a good civilian by paying taxes of stuff you already own.

In this particular case it meant going to the website and try and generate a PDF document that would allow me to pay for said stuff. After 2 unsuccessful attempts to generate the PDF (got greeted by 500s), I finally got the PDF open on chromium (using the PDF preview) and trying to save, the browser crashed..

I then quickly reboot chromium and tried to generate the PDF again, only to find out that I can't, the website only allows you to generate the document and download once, this is a critical document used as prof and means to pay your taxes. It doesn't really make much sense that you only can download it once, but such is the way of life.

I've been suffering from this bug for quite a while, but it never affected me in this way.

The file wasn't on ~/Downloads, so I've tried browsing chrome://cache and after a while I found the PDF HTTP request, w

# $Id$
# Maintainer:
# Contributor: Sergej Pupykin <[email protected]>
# Contributor: Geoffroy Carrier <[email protected]>
# Contributor: Roman Kyrylych <[email protected]>
_pkgbase=xerces-c
pkgname=lib32-${_pkgbase}
pkgver=3.1.1
pkgrel=4