Skip to content

Instantly share code, notes, and snippets.

🌴
Hoping I don't break anything

Brian Goff cpuguy83

🌴
Hoping I don't break anything
Block or report user

Report or block cpuguy83

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md

This script helps to clean up vmss nodes that may have Azure disks attached to it that should not be due to bugs in Kubernetes. The specific case for this is that a disk has been re-attached to by Kubernetes when it should not have been.

This DOES NOT detect a bad node/disk, only assists in cleaning it up.

Usage

$ ./vmssfix.sh NODE_NAME PV_NAME
@cpuguy83
cpuguy83 / gist:530e8a40eb03dc08c4072686cfaff053
Last active Jan 22, 2019
splice vs userspace copy on containerd/fifo using Go
View gist:530e8a40eb03dc08c4072686cfaff053
goos: linux
goarch: amd64
pkg: github.com/containerd/fifo
BenchmarkRawCopy/8B-4 300000 4869 ns/op 1.44 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/16B-4 300000 4688 ns/op 3.20 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/32B-4 300000 4312 ns/op 7.19 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/64B-4 300000 4447 ns/op 14.16 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/1024B-4 300000 4415 ns/op 231.66 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/4096B-4 300000 4410 ns/op 928.50 MB/s 176 B/op 8 allocs/op
BenchmarkRawCopy/8192B-4 300000 5215 ns/op 1570.37 MB/s 176 B/op 8 allocs/op
@cpuguy83
cpuguy83 / gitsynch.sh
Created Sep 12, 2018
Synchronize a git fork with origin
View gitsynch.sh
#!/bin/bash
set -e -u -o pipefail
export ORIGIN="${1}"
export FORK="${2}"
dir=$(mktemp -d)
(
View pull.go
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/images"
@cpuguy83
cpuguy83 / Vagrantfile
Created Dec 6, 2017
Sometimes I need to setup a small kube cluster without thinking about it...
View Vagrantfile
Vagrant.configure(2) do |config|
CNI_LOOPBACK = <<-EOF
{
"cniVersion": "0.3.0",
"type": "loopback"
}
EOF
View keybase.md

Keybase proof

I hereby claim:

  • I am cpuguy83 on github.
  • I am cpuguy83 (https://keybase.io/cpuguy83) on keybase.
  • I have a public key ASAo08bHNxNOVVkkmpl5T8GZMOgan7PmdCC7zM0-zVNcsQo

To claim this, I am signing this object:

View gist:e3a3baefd7d217ffeb786801c8640a69
time="2016-07-27T18:58:18.401642630Z" level=debug msg="Calling POST /v1.24/containers/create"
time="2016-07-27T18:58:18.401896983Z" level=debug msg="form data: {\"AttachStderr\":false,\"AttachStdin\":false,\"AttachStdout\":false,\"Cmd\":[\"true\"],\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":[],\"HostConfig\":{\"AutoRemove\":false,\"Binds\":null,\"BlkioDeviceReadBps\":null,\"BlkioDeviceReadIOps\":null,\"BlkioDeviceWriteBps\":null,\"BlkioDeviceWriteIOps\":null,\"BlkioWeight\":0,\"BlkioWeightDevice\":null,\"CapAdd\":null,\"CapDrop\":null,\"Cgroup\":\"\",\"CgroupParent\":\"\",\"ConsoleSize\":[0,0],\"ContainerIDFile\":\"\",\"CpuCount\":0,\"CpuPercent\":0,\"CpuPeriod\":0,\"CpuQuota\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\"CpusetMems\":\"\",\"Devices\":[],\"DiskQuota\":0,\"Dns\":[],\"DnsOptions\":[],\"DnsSearch\":[],\"ExtraHosts\":null,\"GroupAdd\":null,\"IOMaximumBandwidth\":0,\"IOMaximumIOps\":0,\"IpcMode\":\"\",\"Isolation\":\"\",\"KernelMemory\":0,\"Links\":null,\"LogConfig\":{\"Config\":{},\"Type\":\"\"},
View keybase.md

Keybase proof

I hereby claim:

  • I am cpuguy83 on github.
  • I am cpuguy83 (https://keybase.io/cpuguy83) on keybase.
  • I have a public key whose fingerprint is DC2B 8BF0 03B4 72B1 606E 2F8F A8F2 CB5F 82B3 1F49

To claim this, I am signing this object:

View Dockerfile
FROM debian
ADD my_entrypoint.sh /my_entrypoint.sh
ENTRYPOINT ["/my_entrypoint.sh"]
@cpuguy83
cpuguy83 / logforwarder.go
Last active Aug 29, 2015
libswarm logger demo
View logforwarder.go
package backends
import (
"fmt"
"io"
"strings"
"sync"
"time"
"github.com/docker/libswarm"
You can’t perform that action at this time.