Skip to content

Instantly share code, notes, and snippets.

@t0mmyt
t0mmyt / Dockerfile
Created December 13, 2016 14:27
Etcd Autoscaling
FROM python:2.7-alpine
MAINTAINER Tom Taylor <tom+dockerfiles@tomm.yt>
EXPOSE 2379 2380
ENV ETCD_VER=v2.3.7
RUN apk --update --no-cache --virtual .builddeps add curl tar && \
curl -Lso etcd-${ETCD_VER}-linux-amd64.tar.gz https://github.com/coreos/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz && \
tar zxf etcd-${ETCD_VER}-linux-amd64.tar.gz etcd-${ETCD_VER}-linux-amd64/etcd && \
mv etcd-${ETCD_VER}-linux-amd64/etcd / && \
@dm0-
dm0- / auto-update-kmods.ignition
Last active September 28, 2023 10:03
Automatically update custom kernel modules on CoreOS
{
"ignition": { "version": "2.0.0" },
"systemd": {
"units": [
{
"name": "auto-update-kmods.service",
"enable": true,
"contents": "[Unit]\nDescription=Install custom kernel modules\nAfter=lib-modules.mount network-online.target\nRequires=lib-modules.mount network-online.target\nConditionPathExists=!/opt/modules/%v\nConditionPathExistsGlob=/lib/modules/auto-update-kmods.d/*.sh\n\n[Service]\nType=oneshot\nExecStart=/bin/bash -ex /lib/modules/auto-update-kmods.sh\n\n[Install]\nWantedBy=multi-user.target\n"
},
{

CoreOS Workstation Notes

This is a summary of the system setup used for the demonstration on 2016-07-18.

Goals / Requirements

This was put together with the following intent:

  • It must build upon an unmodified CoreOS user space image.
@dm0-
dm0- / kernel-small.md
Last active July 30, 2019 19:53
Build a modified CoreOS kernel (no initramfs modules; X260 driver notes)

Download and start the CoreOS development image in a container. Make sure to bind writable directories over the kernel's build and install paths.

wget 'http://alpha.release.core-os.net/amd64-usr/current/coreos_developer_container.bin.bz2'
bzcat coreos_developer_container.bin.bz2 > coreos_developer_container.bin
mkdir boot modules src
sudo systemd-nspawn \
    --bind="$PWD/boot:/boot" \
    --bind="$PWD/modules:/lib/modules" \

--bind="$PWD/src:/usr/src" \

@Informatic
Informatic / README.md
Last active May 23, 2024 02:47
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.

@lkraider
lkraider / generator.py
Created April 4, 2016 17:17
Terraform AWS policy generator
#!/usr/bin/env python
"""Convert CSV policies into AWS JSON format."""
import json
import csv
POLICIES = 'terraform.csv'
CRUD_COL = 2
ACTION_COL = 3
├───documentation
├───main
│ ├───cloudtrail
│ │ └───.terraform
│ │ └───modules
│ │ ├───4e1258f2bc21b16a94b1b7016b348677
│ │ ├───a63ab54511b78a26730afea9a88c5f8b
│ │ └───e83e335c08d98f69881974a2c0864a0d
│ ├───iam
│ │ └───.terraform
@fdv
fdv / es-cheat-sheet.md
Last active February 2, 2021 14:44
An ElasticSearch management cheat sheet

These are the snippets I use most of the time when administrating my ES cluster

To be updated

Settings to change before you do something

Before restarting a data node

curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
@maxim
maxim / gh-dl-release
Last active June 5, 2024 21:11
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#