Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
apt-get update
apt-get install -y apt-transport-https ca-certificates curl vim sudo
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubelet kubeadm kubectl
curl -fsSL https://get.docker.com/ -o get-docker.sh
sh get-docker.sh
sensor:
- platform: template
sensors:
k1_humidifier_temperature:
friendly_name: K1 Humidifier Temperature
value_template: '{{ states.fan.k1_nawilzacz.attributes.temperature }}'
unit_of_measurement: '°C'
k1_humidifier_humidity:
friendly_name: K1 Humidifier Humidity
value_template: '{{ states.fan.k1_nawilzacz.attributes.humidity }}'
@dtmilano
dtmilano / colors
Created November 26, 2019 01:31
Shows terminal colors
#! /bin/bash
n=32
arg=setaf
text='Hello World! This is %s %d'
_help()
{
printf 'usage: %s [--help|-H] [--16] [--256] [-t|--tiny] [--background|-b]\n' "$(basename $0)"
exit 0
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active April 23, 2025 08:47
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@sergeyignatov
sergeyignatov / nginx config
Last active March 14, 2023 16:47
zabbix oauth
server {
listen 80;
return 301 https://zabbix.domain.com$request_uri;
}
server {
listen 443 ssl;
server_name zabbix zabbix.domain.com;
access_log /var/log/nginx/zabbix.log;
error_log /var/log/nginx/zabbix.error;
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Socket::UNIX;
$|++;
my $SOCK_PATH = "/tmp/unix-domain-socket-test.sock";
unlink $SOCK_PATH;
@spences10
spences10 / github-cheat-sheet.md
Last active November 18, 2024 21:37
GitHub Cheat Sheet

Useful Git commands

This is just stuff that I have put down that I find I use a lot of the time for my own reference.

Latest changes from repo to your machine

$ git pull
@eldondev
eldondev / cmd
Last active December 4, 2023 16:33
Because everyone needs a good preseed
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
cp -nv ~/.ssh/id_rsa.pub .
qemu-system-x86_64 -machine accel=kvm -kernel linux -initrd initrd.gz -m 1G -smp 2 -append "blacklist=vga16fb fb=false video=false vga=normal auto=true url=http://10.0.2.10:8080/debian-preseed.txt hostname=otto domain=" -net user,guestfwd=:10.0.2.10:8080-cmd:"/bin/busybox httpd -i" -hda /dev/shm/deb.img -net nic -display none
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --disable-threaded-gpu-rasterization --disable-quic --disable-gpu --disable-display-list-2d-canvas --disable-new-avatar-menu --disable-3d-apis --disable-about-in-settings --disable-accelerated-2d-canvas --disable-accelerated-jpeg-decoding --disable-accelerated-video-decode --disable-account-consistency --disable-affiliation-based-matching --disable-answers-in-suggest --disable-app-list-dismiss-on-blur --disable-async-dns --disable-background-networking --disable-backing-store-limit --disable-blink-features --disable-blink-scheduler --disable-boot-animation --disable-breakpad --disable-bundled-ppapi-flash --disable-canvas-aa --disable-cast --disable-cast-streaming-hw-encoding --disable-click-delay --disable-client-side-phishing-detection --disable-cloud-import --disable-component-cloud-policy --disable-component-extensions-with-background-pages --disable-component-update --disable-composited-antialiasing --disable-confirmation --disable-contextual-
@pulsar256
pulsar256 / my_hetzner_xen_setup.md
Last active February 9, 2023 22:20
Hetzner Xen + v4 Subnet + v6 Subnet Setup HowTo

Hetzner Primary IPv4 IP + IPv4/2x Subnet + "Non-Routed" IPv6/64 Subnet HowTo

... so I do not forget the next time I have to figure this stuff out. And perhaps to help other poor souls fiddling with v6/v4 xen setups in a Hetzner network environment.

Basic setup

You can basically follow along the Xen Project Beginners Guide.

The short version

Install Debian Wheezy via Hetzner's installimage on the rescue system, the only important part about partitioning is that you have an LVM volume group named vg0 with enough space for your guests' disks.