Skip to content

Instantly share code, notes, and snippets.

@metajiji
metajiji / nsenter.sh
Created April 19, 2023 15:58
k8s nsenter script
View nsenter.sh
#!/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 '
{
@pavel-kirienko
pavel-kirienko / setup_slcan
Last active June 27, 2023 09:34
setup_slcan -- a simple script for managing SocketCAN SLCAN interfaces on GNU/Linux
View setup_slcan
#!/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 October 27, 2023 20:50
Proxmox Nested Virtualization Tutorial- Harvester/ESXI
@dancheskus
dancheskus / traefik.md
Last active October 20, 2023 07:39
Traefik, как обратный прокси в Docker (пример с 2 react проектами)
View traefik.md

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
View a-infinality-w10-config.sh
# 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 January 7, 2023 08:55
Aster MegaRAC IPMI q&d fix for broken iKVM jviewer.jnlp
View rac_ipmi_jviewer.sh
#!/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 2, 2023 03:18
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
View .. MediaCreationTool.bat ..md
@Pliner
Pliner / import
Last active September 4, 2023 12:04
Mikrotik antifilter.download update script
View import
: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={
@rstacruz
rstacruz / keybindings.js
Last active March 2, 2020 03:30
Rico's vscode config
View keybindings.js
// keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+w ctrl+w",
"command": "workbench.action.closeActiveEditor",
"when": "editorTextFocus"
},{
// <C-S-c> -- maximize terminal
"key": "ctrl+shift+c",