Skip to content

Instantly share code, notes, and snippets.

View pablorsk's full-sized avatar

Pablo Reyes pablorsk

View GitHub Profile
@jmound
jmound / refresh.sh
Last active August 7, 2023 10:33
Bash function to refresh all pods in all deployments by namespace
# based on the "patch deployment" strategy in this comment:
# https://github.com/kubernetes/kubernetes/issues/13488#issuecomment-372532659
# requires jq
# $1 is a valid namespace
function refresh-all-pods() {
echo
DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o json|jq -r .items[].metadata.name)
echo "Refreshing pods in all Deployments"
for deployment_name in $DEPLOYMENT_LIST ; do
[
{
"clabe": "002",
"marca": "BANAMEX",
"nombre": "Banco Nacional de México, S.A., Institución de Banca Múltiple, Grupo Financiero Banamex"
},
{
"clabe": "006",
"marca": "BANCOMEXT",
"nombre": "Banco Nacional de Comercio Exterior, Sociedad Nacional de Crédito, Institución de Banca de Desarrollo"
@AmazingTurtle
AmazingTurtle / how-to-restore.md
Last active October 14, 2025 22:09
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Apparently this guide no longer works with recent unifi controller versions (starting nov/dec 2022). Since I no longer use unifi hardware in my home system, I can not update the guide myself. In case you've gotten here to recover your data, you're likely doomed. But giving it a try won't hurt anyway, therefore: good luck.