Skip to content

Instantly share code, notes, and snippets.

@alexrecuenco
alexrecuenco / argocd-labeler-plugin.md
Created January 14, 2025 23:45 — forked from nimjor/argocd-labeler-plugin.md
ArgoCD labeler plugin via kustomize

ArgoCD Labeler Plugin

Ever wish you could pass some label to an ArgoCD application and have every child resource pick up that label? This is probably of most interest to cluster operators who may not directly control the contents of manifests deployed to their clusters via ArgoCD, but need a way to enforce some standard labeling scheme.

The solution? A simple ArgoCD plugin, easier to setup than you might think.

Write the plugin.yaml

@alexrecuenco
alexrecuenco / starship-rainbow.toml
Last active December 2, 2024 12:02
Ranbow Starship Preset (fixed)
# Get editor completions based on the config schema
# https://starship.rs/config/
# https://starship.rs/presets/
# https://starship.rs/presets/pastel-powerline
# Find other symbols here
# https://www.nerdfonts.com/cheat-sheet
# Check conditional format strings
# https://starship.rs/config/#conditional-format-strings
# MacOS terminal doesn't have true color support, so this pretty thing just won't do :')
"$schema" = 'https://starship.rs/config-schema.json'
@alexrecuenco
alexrecuenco / generate_memorable_password.py
Last active September 4, 2023 23:00
Memorable passwords with python secrets
#!/usr/bin/env python
# Imitates a bit the functionality that used to exist on macos.
# This sketch returns a entropy estimate for the password.
from math import log2
import secrets
import string
import sys
from typing import Tuple
from warnings import warn
@alexrecuenco
alexrecuenco / convert.py
Last active March 29, 2023 22:50
Conver image files
# Requires `pip install Pillow`
# RUN
# python convert.py **/*.bmp
# It will overwrite any .jpg file
from PIL import Image
from pathlib import Path
import sys
import os
import logging
@alexrecuenco
alexrecuenco / bck.20181008131209.navigator.settings.json
Created September 19, 2022 14:08
Visual Studio Code Settings Sync Gist
{
"telemetry.enableTelemetry": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"files.autoSave": "afterDelay",
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",
@alexrecuenco
alexrecuenco / chromecast-volume.py
Last active December 16, 2023 23:19
Using PyChromecast to change the volume of a chrome cast device (Useful since VLC doesn't provide volume controls)
#!/usr/bin/env python3
# requirement: PyChromecast==12.1.4
# version 0.1
import pychromecast
import argparse
from typing import List, Union
import dataclasses
UP = "up"
DOWN = "down"
# If you are putting all sources from file,
```bash
ffmpeg -i file.m3u8 -codec copy output.mp4
```
# If you are downloading from a website you have to add the protocols it will be using
This list should work
```bash
@alexrecuenco
alexrecuenco / git-pushing-multiple.rst
Created February 29, 2020 05:01 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@alexrecuenco
alexrecuenco / remoteupdate.sh
Created February 23, 2020 16:33
Tool to update a given git remote to change origin to github, instead of whichever it was tracking before. (in union with github desktop)
#! /bin/bash -e
# Note that this will echo the commands you need to run, review them before running.
# It expects the process of
# 1. Remove all origins, echo commands to add them again (somewhere that is not origin)
# 2. You add in github desktop the repo and click the button to add github as the remote
# 3. Copy paste the commands that were echoed before to readd the other origins after your repo is tracking github
#### ---- ####
REMOTES=($(git remote))
@alexrecuenco
alexrecuenco / bck.20181008131209.navigator.settings.json
Created October 9, 2019 01:28
Visual Studio Code Settings Sync Gist
{
"telemetry.enableTelemetry": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"files.autoSave": "afterDelay",
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",