Skip to content

Instantly share code, notes, and snippets.

View cyrinux's full-sized avatar
💻
Developing cool stuff !

Cyril Levis cyrinux

💻
Developing cool stuff !
View GitHub Profile
@rverchere
rverchere / kube-state-metrics-vpa.yaml
Last active February 29, 2024 14:04
kube-state-metrics configuration for VPA metrics
## Kube State Metrics to get VPA metrics
# Old vs New metrics:
# - kube_verticalpodautoscaler_labels -> kube_customresource_verticalpodautoscaler_labels
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_target
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget
# Resources:
# - https://github.com/kubernetes/kube-state-metrics/blob/main/docs/customresourcestate-me
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
#!/bin/sh
log=/var/log/cpu_fix.log
printf "Log File - " >$log
while :; do
date >>$log
PLUGGED=$(acpi -a | grep on-line)
if [ ! -z "$PLUGGED" ]; then
echo setting values >>$log
# MSR
# PL1
@BenKato151
BenKato151 / VTube Studio [Arch Linux Guide].md
Last active January 25, 2024 13:44
A Guide to get VTube Studio and VSeeFace working on Linux. Tested on Arch Linux

VTube Studio/OpenSeeFace/VSeeFace Guide (tested on Arch Linux)

Requirements:

  • Latest Proton (GE-Proton, Proton-Experimental are both okay)
  • git
  • wine64
  • lutris (winetricks)
  • Install system packages for python (3.11.3 is okay):
@satrobit
satrobit / xdp.md
Created August 8, 2021 16:17
Absolute Beginner's Guide to BCC, XDP, and eBPF

Introduction

If you're reading this, chances are you have some idea of eBPF and XDP. In this article, we'll write an eBPF program that will count and categorize packets based on the destination port.

eBPF

Writing low-level tracing, monitoring, or network programs in Linux is not easy. Through all the layers of the kernel, people have been squeezing every bit of performance they could get.

And that's where eBPF comes in. eBPF is basically an extended and modern variation of BPF which is like a virtual machine inside the Linux kernel. It can execute user-defined programs inside a sandbox in the kernel.

These programs can be executed in various hook points but we will focus on XDP for now.

@rusty-snake
rusty-snake / xdg-open.c
Last active January 27, 2024 08:05
xdg-open.c – A xdg-open drop-in wrapper to make xdg-open work nicely with firejail.
/*
* Copyright © 2021 rusty-snake
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@thalamus
thalamus / ArchLinuxARM-M1
Last active March 11, 2024 16:55
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu

PWM fan control in Linux with a Gigabyte Aorus motherboard

  • install lm-sensors with your package manager

sensors

If it won't show any fan/speed, continue

sensor-detect

@p7cq
p7cq / SSH_Authentication_TPM2_PKCS11_Arch_Linux.md
Last active January 17, 2024 03:30
SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

Hardware: a TPM 2.0 module based on Infineon SLB9665 cryptographic processor available in the system as /dev/tpmrm0.

Installation

Required software:

# pacman -S tpm2-tools tpm2-pkcs11
@p7cq
p7cq / Arch_Linux_Root_On_ZFS.md
Last active January 5, 2024 14:58
Install Arch Linux with Root on ZFS

Arch Linux Root on ZFS

Installation steps for running Arch Linux with root on ZFS using UEFI and systemd-boot. All steps are run as root.

Requires an Arch Linux image with ZFS built-in (see References).

In live environment

If using KVM, add a Serial number for each virtual disk and reboot the VM. The disks should now be available in /dev/disk/by-id as virtio-<Serial>.