Skip to content

Instantly share code, notes, and snippets.

@nkhine
nkhine / main.ts
Created June 17, 2021 11:25
S3 SPA Pipeline
import { App, RemovalPolicy } from '@aws-cdk/core';
import { MultistackStack, MultistackProps } from './stacks/multistack';
import { PipelineStack, PipelineStackProps } from './stacks/pipeline';
const prodEnv = {
account: '***',
region: 'eu-west-1',
};
const app = new App();
@nkhine
nkhine / zfs-docker.md
Created May 12, 2021 21:20 — forked from AnatomicJC/zfs-docker.md
ZFS and Docker

Create a dedicated ZFS docker pool with deduplication disabled in case of dedup enabled on your system:

zfs create -o mountpoint=/var/lib/docker -o dedup=off rpool/docker

Sometimes, you don't want ZFS for docker storage. ZFS can be sadly quite painful with Docker in Docker and similar scenarios. It might be best to avoid the problem by creating a volume in your ZFS pool, formatting that volume to ext4, and having docker use "overlay2" on top of that, instead of "zfs".

zfs create -s -V 30G rpool/docker

mkfs.ext4 /dev/zvol/rpool/docker

@nkhine
nkhine / containerd.log
Created May 12, 2021 16:32
kind create cluster, fails on ubuntu 20.04 with ZFS
-- Logs begin at Wed 2021-05-12 15:18:03 UTC, end at Wed 2021-05-12 15:21:24 UTC. --
May 12 15:18:03 kind-control-plane systemd[1]: Starting containerd container runtime...
May 12 15:18:03 kind-control-plane systemd[1]: Started containerd container runtime.
May 12 15:18:03 kind-control-plane containerd[188]: time="2021-05-12T15:18:03.817611995Z" level=info msg="starting containerd" revision=ce4439a8151f77dc50adb655ab4852ee9c366589 version=v1.4.0-106-gce4439a8
May 12 15:18:03 kind-control-plane containerd[188]: time="2021-05-12T15:18:03.844535348Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
May 12 15:18:03 kind-control-plane containerd[188]: time="2021-05-12T15:18:03.844626453Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1
May 12 15:18:03 kind-control-plane containerd[188]: time="2021-05-12T15:18:03.844672989Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.aufs" error
@nkhine
nkhine / Install-WSLAndUbuntuFocal.ps1
Created August 22, 2020 10:57 — forked from ScriptAutomate/Install-WSLAndUbuntu.ps1
Enable WSL and Install Ubuntu 20.04
<#
- BIOS of host machine also needs to be configured to allow hardware virtualization
- This gist WSLv2, but can use WSLv1 instead. I needed v1 as I run Windows 10 in a VM in Virtualbox.
- WSLv2 has been giving me problems in Virtualbox 6.1, but WSLv1 works properly.
- vbox has issues with the GUI settings when it comes to nested virtualization on certain systems,
so run the following if needing to give a VM this enabled setting:
VBoxManage modifyvm <vm-name> --nested-hw-virt on
#>
@nkhine
nkhine / gist:2da7cecb4ed9164e3fe5a04d4c64e284
Created August 12, 2020 08:25
backup / restore mysql using docker
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@nkhine
nkhine / crucible.yml
Created April 28, 2020 16:52
HA Crucible
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Crucible: highly available Fisheye/Crucible template.'
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: 'Parent Stacks'
Parameters:
- ParentVPCStack
@nkhine
nkhine / vpnclient
Created September 2, 2019 20:48 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.
```
Thread Dump
DestroyJavaVM
"DestroyJavaVM" Id=22 Group=main RUNNABLE
FilePath.localPool [#7]
"FilePath.localPool [#7]" Id=94 Group=main RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
Administrator CMD
C:\> hcsdiag list
C:\> hcsdiag kill wsl
C:\> wsl -l
C:\> wsl -d alpine
LOE-WSL:/mnt/c#
@nkhine
nkhine / docker-selinux.md
Last active April 28, 2019 19:16
SELinux and docker notes
layout title date categories
post
SELinux and docker notes
2018-02-13 13:13:59 +0200
docker selinux

SELinux and docker notes

What it takes to run our containers with SELinux enabled.