Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / Trying Kata Containers with Firecracker (and QEMU).md
Last active December 9, 2020 11:24
Trying Kata Containers with Firecracker (and QEMU)

Trying Kata Containers with Firecracker (and QEMU)

asciicast

Clearlinux bundles Kata Containers as well a firecracker.

To quickly experience how Kata Containers can be used to setup a cluster that can run Kubernetes with different types of isolation mechanisms we have created a simple developer enviornment. With this you can run workloads with runc (using cgroups, namespaces provided by the host kernel for isolation), Kata with QEMU/KVM (uses VT-x for isolation and QEMU as the hypervisor) and Kata with Firecracker (uses VT-x for isolation and the minimal Firecracker VMM).

@hakib
hakib / time_limited_paginator.py
Last active April 23, 2024 21:31
CountTimeoutLimitPaginator - Paginator that enforced a timeout on the count operation.
class TimeLimitedPaginator(Paginator):
"""
Paginator that enforced a timeout on the count operation.
When the timeout is reached a "fake" large value is returned instead,
Why does this hack exist? On every admin list view, Django issues a
COUNT on the full queryset. There is no simple workaround. On big tables,
this COUNT is extremely slow and makes things unbearable. This solution
is what we came up with.
"""

What is this gist?

Explanation of a fullstack deployment of wagtail in a dockerized environment with Nginx, Elasticsearch, Postgres and Memcached

Required Skills:

  • docker
  • docker-compose
  • get a local wagtail site running
@wallyqs
wallyqs / aiohttp-example-thread-pool-executor.py
Created August 30, 2018 07:04
aiohttp-example-thread-pool-executor.py
import asyncio
import json
import logging
import signal
import aiohttp
import platform
from aiohttp import web
from datetime import datetime
from nats.aio.client import Client as NATS
@jdoss
jdoss / wireguard-monitor.path
Created April 15, 2018 16:38
Reload systemd-networkd on WireGuard config change
[Path]
PathChanged=/etc/systemd/network/wg0.network
PathChanged=/etc/systemd/network/wg0.netdev
[Install]
WantedBy=multi-user.target
@andrewstuart
andrewstuart / .gitlab-ci.yml
Last active June 12, 2023 17:44
One Deployment Per branch, plus CI CD, gitlab and helm setup
image: docker.mydomain.com/build/kube-go-make
variables:
DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay
PROD_RSYNC_HOST: myprodserver.com
DOMAIN: mydomain.com
CHART_DIR: chart
#!/bin/bash
modprobe ipv6
modprobe udp_tunnel
modprobe ip6_udp_tunnel
ip link add dev wg0 type wireguard
wg setconf wg0 /etc/wireguard/config
wg showconf wg0
brctl addbr internet
brctl stp internet on
ip link set up dev wg0
@ruanbekker
ruanbekker / lxd-usage.txt
Created November 14, 2016 06:34
LXD Usage
Docs - LXD Helpful Docs:
https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/
https://www.flockport.com/flockport-first-look-at-lxd/
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - Installation:
http://insights.ubuntu.com/2016/03/14/the-lxd-2-0-story-prologue/
Docs - API:
https://linuxcontainers.org/lxd/getting-started-cli/
@JPvRiel
JPvRiel / apt_pinning_priorities.md
Last active April 22, 2024 19:42
Apt package pinning and priorities
@andrewchilds
andrewchilds / clubhouse.sh
Last active January 23, 2020 00:07
Clubhouse/git/deploy utility functions
# Clubhouse / git / deploy utility functions
#
# API docs: https://clubhouse.io/api
#
# Assuming the following:
# 1. We have a range of git commits that represent the changes being deployed
# 2. Our git branches and pull requests use the username/ch123/story-name format,
# so that "ch123" ends up in a commit message
# 3. We have a Clubhouse API token set to the $CLUBHOUSE_API_TOKEN environment variable
#