Skip to content

Instantly share code, notes, and snippets.

@metajiji
metajiji / nsenter.sh
Created April 19, 2023 15:58
k8s nsenter script
#!/bin/sh
node=${1}
kube_context=${2:-""}
nodeName=$(kubectl ${kube_context:+--context $kube_context} get node "$node" -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}')
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${nodeName:?}'" },'
podName=$USER-nsenter-$node
kubectl ${kube_context:+--context $kube_context} run "${podName:?}" --restart=Never -it --rm --image overriden --overrides '
{

To use devices inside your nspawn container do:

Edit systemd-nspawn@<machine_name>.service and add a line like the below

DeviceAllow="/dev/serial/by-id/usb-Roboteq_Motor_Controller_SDC2XXX-if00 rwm"
DeviceAllow=char-ttyACM rwm
DeviceAllow=char-usb_device rwm
DeviceAllow=ttyACM rwm

To see valid device types do:

@pavel-kirienko
pavel-kirienko / setup_slcan
Last active December 6, 2024 05:42
setup_slcan -- a simple script for managing SocketCAN SLCAN interfaces on GNU/Linux
#!/bin/bash
# https://gist.github.com/pavel-kirienko/32e395683e8b7f49e71413aebf5e1a89
# Pavel Kirienko <pavel@opencyphal.org>
HELP="Register slcan-enabled serial-to-CAN adapters as network interfaces.
Usage:
`basename $0` [options] <tty0> [[options] <tty1> ...]
Interface indexes will be assigned automatically in ascending order, i.e., the
first device will be mapped to slcan0, second to slcan1, and so on.
@bgulla
bgulla / banner_harvester.jpg
Last active November 10, 2024 04:30
Proxmox Nested Virtualization Tutorial- Harvester/ESXI
banner_harvester.jpg
@dancheskus
dancheskus / traefik.md
Last active December 11, 2024 22:08
Traefik, как обратный прокси в Docker (пример с 2 react проектами)

Traefik, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

Цели

  • Запустить traefik в одном контейнере
  • Запустить другие проекты в других контейнерах
  • Соединить все контейнеры в одну docker cеть
  • Настроить контейнеры с проектами так, что-бы они объясняли traefik'у, какие url ведут на конкретный проект
@sorenvonsarvort
sorenvonsarvort / a-infinality-w10-config.sh
Last active June 2, 2023 22:41
windows-10-like-font-rendering-config-for-linux
# make sure You have installed the infinality patches
export INFINALITY_FT_FILTER_PARAMS="8 17 50 17 8"
export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="0"
export INFINALITY_FT_FRINGE_FILTER_STRENGTH="55"
export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0"
export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0"
export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="20"
export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="0"
export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0"
@ashevchuk
ashevchuk / rac_ipmi_jviewer.sh
Last active May 7, 2024 00:17
Aster MegaRAC IPMI q&d fix for broken iKVM jviewer.jnlp
#!/bin/sh
if [ "$#" -ne 3 ]; then
echo "Usage: $0 [ip address] [user name] [password]"
exit 1
fi
IP=$1
IPMI_USER=$2
IPMI_PASS=$3
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active December 12, 2024 20:29
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@Pliner
Pliner / import
Last active November 27, 2024 14:50
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={