Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
@freyes
freyes / gist:55643b077a0d416253bd0d991c841458
Created June 3, 2026 22:08
povray - Intel(R) Core(TM) Ultra 9 285H
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) Ultra 9 285H
CPU family: 6
Model: 197
#!/bin/bash
kubectl apply -n zuul -f - <<EOF
apiVersion: v1
kind: Service
metadata:
name: fake-service
spec:
type: LoadBalancer
ports:
@freyes
freyes / k8s-move-to-another-host.sh
Created December 17, 2024 19:12
n an emergency that requires freeing resources in one specific node
#!/bin/bash
# source: https://stackoverflow.com/a/78983037
# In an emergency that requires freeing resources in one specific node, use this:
export OVERLOADED_NODE=worker-09
export DEPLOYMENT_TO_MOVE=myapp
kubectl top nodes
kubectl taint nodes ${OVERLOADED_NODE} tmp=tmp:NoSchedule
kubectl rollout restart deployment ${DEPLOYMENT_TO_MOVE}
kubectl rollout status deployment ${DEPLOYMENT_TO_MOVE}
@freyes
freyes / git-cherry-pick-openstack.sh
Created September 28, 2023 13:57
Helper script to propose backports for OpenStack projects
#!/bin/bash -eux
#
# Usage:
# ./git-cherry-pick-openstack <COMMIT> <TOPIC> <TARGET>
#
# Example:
# ./git-cherry-pick-openstack 83ffa9eb3a2418897bf2707d14efce725d775090 bug/2030094 ussuri
COMMIT_ID=${1}
TOPIC=${2}

Steps to test:

  1. Setup model-default to always include the ppa
    cat << EOF > model-config.yaml
    #cloud-config
    apt:
      sources:
        lp2023211:
          source: 'ppa:freyes/lp2023211'
    
#!/usr/bin/env python3
#
# Usage example:
# python3 client.py "ws://127.0.0.1:6083/?token=5f7854b7-bf3a-41eb-857a-43fc33f0b1ec"
#
import sys
from ws4py.client.threadedclient import WebSocketClient
class LazyClient(WebSocketClient):
@freyes
freyes / 01-setup.sh
Last active March 19, 2024 16:37
Squid configured to be very aggressive at caching deb packages and other artifacts that are known to not change over time
echo "DEBOOTSTRAP_PROXY=http://localhost:3128/" >> ~/.mk-sbuild.rc
#!/usr/bin/python3
"""A script to retrieve a Launchpad token."""
import argparse
import os
import sys
from unittest import mock
from launchpadlib.launchpad import Launchpad

Switch charmcraft aliases:

Usage examples:

charmcraft-workon 1.5
charmcraft-workon 2.0
@freyes
freyes / README.md
Last active February 7, 2023 15:11
Mirroring docker images for OpenStack Magnum deployments