Skip to content

Instantly share code, notes, and snippets.

so0k so0k

Block or report user

Report or block so0k

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
@so0k
so0k / kubectl.md
Last active Dec 10, 2019
Playing with kubectl output
View kubectl.md

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@so0k
so0k / billing-budgets-cloudwatch.tf
Last active Nov 25, 2019
Swatmobile - AWS Bootstrap gists
View billing-budgets-cloudwatch.tf
resource "aws_budgets_budget" "cloudwatch" {
provider = "aws.billing"
name = "budget-cloudwatch-monthly"
budget_type = "COST"
limit_amount = "1000"
limit_unit = "USD"
time_period_end = "2087-06-15_00:00"
time_period_start = "2017-07-01_00:00"
time_unit = "MONTHLY"
@so0k
so0k / README.md
Last active Nov 14, 2019
Alpine-shell
View README.md

Getting an Alpine shell

Often usefull for in-cluster debugging.

$ kubectl run --generator=run-pod/v1 --image=alpine:3.5 -it alpine-shell -- /bin/sh

detach (without killing the container):

@so0k
so0k / Query-Registry.ps1
Last active Oct 25, 2019
Query a docker registry v2/_catalog endpoint from powershell
View Query-Registry.ps1
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
$Filter=".*",
#TODO: handle https & no basic auth as well..
$RegistryEndpoint = "registry.mysite.com",
$UserName = "user",
$Password = "password"
)
@so0k
so0k / alpine-curl.md
Created Mar 1, 2018
Alpine curl issues
View alpine-curl.md

To fix /usr/bin/curl: curl_mime_type: symbol not found Errors when trying to run curl in a running alpine pod.

Right solution: Update base alpine image because this is a bigger issue

Quick fix: run Alpine system upgrade (or upgrade libcurl package specifically):

apk update
apk upgrade
View amazon-eks-nodegroup-with-mixed-instances-custom.yml
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Node Group'
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
default: "EKS Configuration"
Parameters:
@so0k
so0k / spec_helpers.rb
Created May 5, 2019
Ssl rspec SNI test
View spec_helpers.rb
require 'openssl'
require 'socket'
def ssl_peek(host)
ip = ENV['TIP_HOST'] || '0.0.0.0'
port = ENV['TIP_PORT'] || '8121'
tcp_client = TCPSocket.new(ip, port)
ssl_client = OpenSSL::SSL::SSLSocket.new(tcp_client)
ssl_client.hostname = host
ssl_client.connect
@so0k
so0k / gist:cdd24d0a4ad92014a1bc
Last active Apr 8, 2019 — forked from defunctzombie/gist:6518292
droplet discovery over digitalocean private networks
View gist:cdd24d0a4ad92014a1bc

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
@so0k
so0k / README.md
Last active Mar 1, 2019 — forked from jpsilvashy/README.md
Post Google Sheets form entries to Slack
View README.md

Post Google Sheets form entries to Slack

By using Google Form's script editor, you can call Slack webhooks when form submissions are made. You can use this script to do things like creating a live feedback form for taking questions from an audience or notifying your team when someone signs up for an event.

Setup

First, be sure you're collecting the email address in the form:

'img'

View bumpme
Tue Feb 26 08:41:19 UTC 2019
You can’t perform that action at this time.