Skip to content

Instantly share code, notes, and snippets.

@fl64
fl64 / asdsad
Created June 5, 2025 12:11
asddadsdas
apiVersion: v1
kind: Namespace
metadata:
labels:
prometheus.deckhouse.io/monitor-watcher-enabled: "true"
prometheus.deckhouse.io/probe-watcher-enabled: "true"
prometheus.deckhouse.io/rules-watcher-enabled: "true"
name: bunch-00
---
apiVersion: v1
I0605 08:39:52.685233 1 staticmachine_controller.go:93] "Reconciling StaticMachine" controller="staticmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="StaticMachine" StaticMachine="d8-cloud-instance-manager/master-2mtfx-cwkgs" namespace="d8-cloud-instance-manager" name="master-2mtfx-cwkgs" reconcileID="d46faddc-710a-4828-8351-4c7fdcc559d4"
I0605 08:39:52.685394 1 staticmachine_controller.go:202] "No pending StaticInstance available, waiting..." controller="staticmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="StaticMachine" StaticMachine="d8-cloud-instance-manager/master-2mtfx-cwkgs" namespace="d8-cloud-instance-manager" name="master-2mtfx-cwkgs" reconcileID="d46faddc-710a-4828-8351-4c7fdcc559d4"
I0605 08:39:53.249122 1 staticmachine_controller.go:93] "Reconciling StaticMachine" controller="staticmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="StaticMachine" StaticMachine="d8-cloud-instance-manager/master-2mtfx-2
@fl64
fl64 / memory-rate.sh
Last active May 19, 2025 10:18
memory-rate.sh
#!/bin/bash
# Configuration
INTERVAL=1 # Measurement interval in seconds
DURATION=60 # Number of measurements to take
# Automatically detect page size
PAGE_SIZE=$(getconf PAGESIZE)
echo "Detected page size: ${PAGE_SIZE} bytes"
@fl64
fl64 / app.py
Last active February 20, 2025 19:44
d8conf-app
from flask import Flask, request, jsonify
from flask_cors import CORS
import psycopg2
import os
app = Flask(__name__)
CORS(app, resources={r"/api/*": {"origins": "https://demo.pt.dvp.flant.dev"}})
# Настройки подключения к PostgreSQL
DB_HOST = os.getenv('DB_HOST', 'db.demo-db.svc.cluster.local')
@fl64
fl64 / nsenter.sh
Last active February 19, 2025 15:35
nsenter.sh
#!/bin/bash
# Function to display usage instructions
usage() {
echo "Usage: nsenter.sh -n|--namespace <namespace> -p|--pod <pod-name> [-c|--container <container-name>] [-t|--nsenter-namespaces <namespaces>] [-u|--ssh-user <user>] [-h|--ssh-host <host>] [-x|--node-name-prefix <prefix>] -- <command> [args...]"
echo "Options:"
echo " -n, --namespace Namespace of the pod"
echo " -p, --pod Name of the pod"
echo " -c, --container Name of the container (optional; default is the first container)"
echo " -t, --nsenter-namespaces Namespaces for nsenter (optional; overrides defaults, e.g., 'mnt,uts') net namespace is used by deafult"
@fl64
fl64 / test.sh
Last active December 28, 2024 13:29
test-vm-due-migration-issue.sh
#!/usr/bin/env bash
NAMESPACE="env-1b4119-testcases"
SCRIPT_TEMPLATE='
for VM in %%VMS%%; do
VM_NAME=$(echo ${VM} | cut -d% -f 1);
VM_NS=$(echo ${VM} | cut -d% -f 2);
VM_IP=$(echo ${VM} | cut -d% -f 3);
VM_NODE=$(echo ${VM} | cut -d% -f4);
@fl64
fl64 / README.md
Last active October 15, 2024 09:51
migrate-cloud-init-secret
@fl64
fl64 / help.md
Last active June 3, 2025 12:47
dump-vm-debug-bundle

how to run

Usage example:

curl -s https://gist.githubusercontent.com/fl64/75a5904f9bbadcb3d5a12c3dec3c7708/raw/vm-debug-bundle.sh | bash -s -- -n env-1b4119-testcases -v env-1b4119-vm-hotplug-iso-vi-cr-2 --bundle-path . --keep --no-tar

Params:

@fl64
fl64 / test-networing-from-nodes.sh
Last active August 10, 2024 19:00
tshoot VM network issues
#!/usr/bin/env bash
NAMESPACE="testcases"
SCRIPT_TEMPLATE='
for VM in %%VMS%%; do
VM_NAME=$(echo ${VM} | cut -d% -f 1);
VM_IP=$(echo ${VM} | cut -d% -f 2);
VM_NODE=$(echo ${VM} | cut -d% -f 3);
@fl64
fl64 / data.sh
Created July 24, 2024 16:04
bash http server
#!/bin/bash
data=$(date $T)
echo "content-type: text/plain"
echo "content-length: $(echo ${data} | wc -c)"
echo
echo ${data}