Skip to content

Instantly share code, notes, and snippets.

@fl64
fl64 / help.md
Last active September 18, 2024 10:45
dump-vm-debug-bundle

how to run

curl -s https://gist.githubusercontent.com/fl64/75a5904f9bbadcb3d5a12c3dec3c7708/raw/7bffcc1fb47fa0297da4c1331fa4fa3a535bc530/vm-debug-bundle.sh | bash -s -- -n demo-pure-virtualization -v vm-3
@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}
@fl64
fl64 / gruvbox-pallete
Last active July 9, 2024 10:19
mm-gruvbox
let s:gb.dark0_hard = ['#1d2021', 234] " 29-32-33
let s:gb.dark0 = ['#282828', 235] " 40-40-40
let s:gb.dark0_soft = ['#32302f', 236] " 50-48-47
let s:gb.dark1 = ['#3c3836', 237] " 60-56-54
let s:gb.dark2 = ['#504945', 239] " 80-73-69
let s:gb.dark3 = ['#665c54', 241] " 102-92-84
let s:gb.dark4 = ['#7c6f64', 243] " 124-111-100
let s:gb.dark4_256 = ['#7c6f64', 243] " 124-111-100
let s:gb.gray_245 = ['#928374', 245] " 146-131-116
status:
stats:
# Нужно для отслеживания перехода из фазы в фазу
phasesTransitions:
- phase: Pending
timestamp: "2024-06-19T09:39:56Z"
- phase: Starting
timestamp: "2024-06-19T09:39:56Z"
launchTimeDuration:
# |----->
sizingPolicies:
- cores:
min: 1
max: 4
memory:
min: 1G
max: 4G
dedicatedCores: [false]
coreFractions: [5, 10, 20, 50, 100]
- cores:
@fl64
fl64 / ng-aio.yaml
Created June 4, 2024 09:36
virtualization AIO fix
apiVersion: deckhouse.io/v1alpha1
kind: NodeGroupConfiguration
metadata:
name: virtualization-kernel-settings.sh
spec:
bundles:
- '*'
content: |
bb-sync-file /etc/sysctl.d/99-virtualization-kernel-settings.conf - virtualization-kernel-settings-changed <<"EOF"
fs.aio-max-nr = 1048576
@fl64
fl64 / gcp.yaml
Last active May 31, 2024 16:20
gcp
apiVersion: v1
kind: Namespace
metadata:
name: vms
---
apiVersion: v1
data:
userData: |
I2Nsb3VkLWNvbmZpZwpwYWNrYWdlX3VwZGF0ZTogdHJ1ZQpwYWNrYWdlczoKICAtIHN0cm
Vzcy1uZwogIC0gdG11eAogIC0gaHRvcAogIC0gcWVtdS1ndWVzdC1hZ2VudAogIC0gaXB1
@fl64
fl64 / v12-get-vm-info.sh
Last active May 29, 2024 08:26
get all vm resources in ns
#!/usr/bin/env bash
green=$(tput setaf 2)
red=$(tput setaf 1)
yellow=$(tput setaf 3)
cyan=$(tput setaf 6)
magenta=$(tput setaf 5)
blue=$(tput setaf 4)
sgr0=$(tput sgr0)
bold=$(tput bold)
@fl64
fl64 / find-kv.sh
Last active May 28, 2024 15:09
find all kubevirt and cdi resources
#!/usr/bin/env bash
query_meta='
.items[]
| select(
(.metadata // {} | tojson | test("(kubevirt|cdi)") )
)
|
{