Skip to content

Instantly share code, notes, and snippets.

View hbokh's full-sized avatar
🔪
Yak shaving

Henk hbokh

🔪
Yak shaving
View GitHub Profile
@tomwalsh
tomwalsh / preseed.cfg
Last active April 21, 2024 22:21
Debian Installer/preseed Partman Setup for RAID and LVM
# Force the system to unmount any previously found file systems
d-i preseed/early_command string umount /media || true
# We are using RAID as our method - This is important
d-i partman-auto/method string raid
# Define which disks we want to use in our RAID configuration
d-i partman-auto/disk string /dev/sda /dev/sdb
# Remove any previous LVM metadata
d-i partman-lvm/device_remove_lvm boolean true
# Remove any previous MD metadata
d-i partman-md/device_remove_md boolean true
@m-radzikowski
m-radzikowski / script-template.sh
Last active April 25, 2024 18:43
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
variable "hcloud_token" {
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
resource "hcloud_server" "kube-master" {
name = "kube-master"
image = "ubuntu-18.04"
@mika
mika / gist:c2a0df79f9fcf59c96f99adb9d3eac83
Created August 11, 2017 08:14 — forked from benwalton/gist:1777718
Clean up emails in the queue. usage ./postfix-delete.pl email@example.com
#!/usr/bin/perl
$REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!";
@data = qx</usr/sbin/postqueue -p>;
for (@data) {
if (/^(\w+)(\*|\!)?\s/) {
$queue_id = $1;
}
if($queue_id) {
@brianshumate
brianshumate / docker-macos-terraform.md
Last active April 16, 2024 02:18
The Simplest Terraform with Docker on macOS

If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:

1. Install Docker

Install Docker for Mac if you have not already.

@ashald
ashald / ghost.tf
Created March 16, 2017 03:59
Ghost in the Container
variable "socket" {}
variable "BLOG_HOST" {}
variable "EMAIL_LETSENCRYPT" {}
variable "DOCKER_PREFIX" { default = "ghost" }
variable "image_letsencrypt" { default = "jrcs/letsencrypt-nginx-proxy-companion:v1.4" }
variable "image_nginx_proxy" { default = "jwilder/nginx-proxy:alpine" }
variable "image_ghost" { default = "ashald/alpine-ghost:hydrogen" }
@valpackett
valpackett / no-ubt.conf
Created November 26, 2016 14:03
Disable automatic Bluetooth stack loading on FreeBSD (put into /usr/local/etc/devd and restart devd)
# Do nothing when a ubt device is attached
attach 999 {
device-name "ubt[0-9]+";
};
detach 999 {
device-name "ubt[0-9]+";
};
# Do not even load ubt
@valentin2105
valentin2105 / ha-wordpress.service
Last active March 19, 2021 09:09
High-Available Wordpress PoC on Docker Swarm 1.12.x with MariaDB Galera cluster.
#! /bin/bash
wordpressPath=/srv/wp01
wordpressName=wordpress01
wordpressPwd=pAssw0rd
wordpressUrl=wordpress01.example.com
##################################
mkdir -p "$wordpressPath"/db
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@Informatic
Informatic / README.md
Last active April 9, 2024 07:09
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.