Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
ipedrazas / gist:334244703c55a937cf536cfa50643e79
Created November 29, 2022 09:33
Renew certs in proxmox, vnc time out issues
# SSH into the node where the failing VMs are running and run these commands:
pvecm updatecerts --force
systemctl restart pvedaemon.service
systemctl restart pveproxy.service
@ipedrazas
ipedrazas / deployment.yaml
Created October 17, 2017 18:45
iterate over secrets in helm
env:
{{- range $secret := .Values.secrets }}
{{- if eq $secret.type "env" }}
{{- range $key := $secret.keys }}
{{- $envPrefix := $secret.prefix | default "" | upper }}
{{- $envKey := $key | upper | replace "." "_" | replace "-" "_" }}
- name: {{ $envPrefix }}{{ $envKey }}
valueFrom:
secretKeyRef:
name: {{ $secret.name }}
# syntax = docker/dockerfile:1.4
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9-slim AS builder
WORKDIR /app
COPY requirements.txt ./
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt
@ipedrazas
ipedrazas / debug-dd-extensions.json
Last active October 20, 2022 10:11
Debug statements for Makefile extensions
{
"extd": {
"scope": "makefile,make",
"prefix": "extd",
"body": [
"debug: # Show Chrome-dev tools",
" docker extension dev debug $(IMAGE):$(TAG)",
"debug-reset: # Reset Chrome-dev tools",
" docker extension dev reset $(IMAGE):$(TAG)",
"debug-ui: # Set UI hot reload",
@ipedrazas
ipedrazas / gist:83326e03c9d893a3ab1bdbd048d2e6be
Last active March 7, 2022 21:05
Curl Kubernetes API Server from a Pod
curl -k -X GET \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
https://$KUBERNETES_PORT_443_TCP_ADDR:$KUBERNETES_SERVICE_PORT_HTTPS
@ipedrazas
ipedrazas / knife cheat
Last active December 13, 2021 11:50
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@ipedrazas
ipedrazas / dump
Created April 22, 2017 04:10
Mongo dump/restore with docker
# Backup DB
docker run \
--rm \
--link running_mongo:mongo \
-v /data/mongo/backup:/backup \
mongo \
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’
# Download the dump
scp -r USER@REMOTE:/data/mongo/backup ./backup
- name: oauth2-proxy
image: a5huynh/oauth2_proxy
args:
- "-upstream=http://localhost:5601/"
- "-provider=github"
- "-cookie-secure=true"
- "-cookie-expire=168h0m"
- "-cookie-refresh=60m"
- "-cookie-secret=SECRET COOKIE"
- "-cookie-domain=kibana.fromatob.com"
@ipedrazas
ipedrazas / gist:6b0b8bc5ae2339b4f21aef342375d656
Last active December 22, 2020 08:35
upload chart using curl
curl --data-binary "@mychart-0.1.0.tgz" http://localhost:8080/api/charts
minikube start --vm-driver=xhyve --container-runtime=docker --show-libmachine-logs --v=10 --alsologtostderr --cpus 4 --memory 8192