Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Pedrazas ipedrazas

View GitHub Profile
@ipedrazas
ipedrazas / gist:334244703c55a937cf536cfa50643e79
Created Nov 29, 2022
Renew certs in proxmox, vnc time out issues
View gist:334244703c55a937cf536cfa50643e79
# 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
View gist:83e37e21f7c6f55f92887eb60f1e039f
# 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 Oct 20, 2022
Debug statements for Makefile extensions
View debug-dd-extensions.json
{
"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",
View gist:6b0b8bc5ae2339b4f21aef342375d656
curl --data-binary "@mychart-0.1.0.tgz" http://localhost:8080/api/charts
@ipedrazas
ipedrazas / flask-signal.py
Created Aug 22, 2020
Processing SIGTERM in python
View flask-signal.py
import signal
import time
class GracefulKiller:
kill_now = False
def __init__(self):
signal.signal(signal.SIGINT, self.exit_gracefully)
signal.signal(signal.SIGTERM, self.exit_gracefully)
def exit_gracefully(self,signum, frame):
@ipedrazas
ipedrazas / index.css
Created Jun 12, 2020
Gitops training - vue.js
View index.css
html, body {
margin: 0px;
}
h1{
background-color: #3a5e84;
color: white;
padding: 10;
margin-bottom: 20px;
}
@ipedrazas
ipedrazas / app.py
Created Jun 12, 2020
Gitops Training - python
View app.py
from flask import Flask, jsonify, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/ip', methods=["GET"])
def ip():
@ipedrazas
ipedrazas / requirements.md
Created Jun 11, 2020
Training Requirements
View requirements.md

Accounts

You will need valid accounts for the following systems:

Tools

During the training we will use the following tooling:

@ipedrazas
ipedrazas / rename.sh
Created May 18, 2020
Rename USB disk
View rename.sh
# Source: https://help.ubuntu.com/community/RenameUSBDrive
sudo apt-get install ntfsprogs
sudo fdisk -l
sudo umount /dev/sda1
sudo ntfslabel /dev/sda1 usb_ext_6t
mount /dev/sda1 /media/usb/usb_ext_6t
View gist:48e4f50913e40f064d7ddcca46505f66
-v=9 CURL command
-v=8 request and response body
-v=6 method and apipath