Skip to content

Instantly share code, notes, and snippets.

View mhutter's full-sized avatar
🤘

Manuel Hutter mhutter

🤘
View GitHub Profile
@mhutter
mhutter / ha.yml
Created January 17, 2024 12:56
HA Kubernetes Deployments
# In Kubernetes clusters, it is common that Pods are being evicted from a node.
# Reasons include maintenance, out-of-resource situations (OOM), or failure of
# a node.
#
# This YAML document describes how to set up your Kubernetes Deployment in a
# way that your application will stay available even if this happens.
#
# Unlike during rollouts, during an eviction Kubernetes will NOT first start a
# "replacement" Pod and then stop the old one, but instead just check
# PodDisruptionBudgets and then terminate the Pod (unless the PDB would be
@mhutter
mhutter / not_shuttle.rs
Created December 14, 2023 20:44
Shuttle.rs in less than 100 lines of Rust
use std::{future::Future, pin::Pin};
use async_trait::async_trait;
use tokio::net::TcpListener;
type PinFuture<O> = Pin<Box<dyn Future<Output = O> + Send>>;
/// Run your application
pub fn run<M, S, T>(app: M)
where
{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"name":"core","sshAuthorizedKeys":["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRFlkyW0MXxYjA1HUzJ18nlTLtXOHKV0rVJD/46v7Sb"]}]}}
---
stages:
- build
build-image:
stage: build
image:
# Use Google's Kaniko builder
name: gcr.io/kaniko-project/executor:debug
@mhutter
mhutter / 0-nixos.sh
Last active February 18, 2023 16:13
NixOS setup
#!/usr/bin/env bash
set -e -u -o pipefail -x
DISK='/dev/disk/by-id/ata-QEMU_HARDDISK_QM00003'
PART1="${DISK}-part1"
PART2="${DISK}-part2"
parted --script --align=optimal "$DISK" -- \
mklabel gpt \
mkpart ESP fat32 1MB 512MB set 1 esp on set 1 boot on \
@mhutter
mhutter / 0-pre-chroot.sh
Last active October 3, 2021 14:35
Arch Linux installation with full disk encryption
#!/usr/bin/env bash
set -e -u -o pipefail -x
# General setup
timedatectl set-ntp true
# Partitioning
sgdisk /dev/sda \
--new=1:0:+512M \
@mhutter
mhutter / state.rs
Created May 22, 2021 18:43
Rust Rocket examples
#![feature(proc_macro_hygiene, decl_macro)]
use rocket::State;
#[macro_use]
extern crate rocket;
struct ExampleA(&'static str);
type ExampleB = &'static str;
@mhutter
mhutter / rubiks.adoc
Last active August 19, 2020 12:38
Rubiks Kube algorithms
  1. The Daisy

  2. White Cross

  3. Bottom layer

    • Triggers

  4. Second layer:

    • Non-yellow edges

    • T-Shape

    • More Triggers!

  5. Yellow Cross

    • F U R U' R' F'

@mhutter
mhutter / LICENSE
Last active January 5, 2022 01:18
adoc project boilerplate
MIT License
Copyright (c) 2022 Manuel Hutter
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:

Keybase proof

I hereby claim:

  • I am mhutter on github.
  • I am mhu (https://keybase.io/mhu) on keybase.
  • I have a public key ASCtV_yPvc1D8MS_O4_8KDpZLbsxyTZLZBp0uuZyfYolSQo

To claim this, I am signing this object: