Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
@superbrothers
superbrothers / kccnceu18-dl.sh
Last active May 10, 2019 08:05
Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
#!/usr/bin/env bash
# Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
# Forked https://gist.github.com/hobbsh/35091c54970fff0b86a64cd72f02e8e3
DAYS=("2018-04-30" "2018-05-01" "2018-05-02" "2018-05-03" "2018-05-04")
for DAY in "${DAYS[@]}"; do
mkdir -p "kccnceu18/${DAY}"
LINKS=($(curl -s https://kccnceu18.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
diff --git a/cluster/update-storage-objects.sh b/cluster/update-storage-objects.sh
index 364c1d7e..a451a2d0 100755
--- a/cluster/update-storage-objects.sh
+++ b/cluster/update-storage-objects.sh
@@ -34,7 +34,6 @@ KUBECTL="${KUBE_OUTPUT_HOSTBIN}/kubectl"
# TODO: Get this list of resources from server once
# http://issue.k8s.io/2057 is fixed.
declare -a resources=(
- "endpoints"
"events"
@superbrothers
superbrothers / kubecon_curl.sh
Last active December 11, 2017 04:52 — forked from hobbsh/kubecon_curl.sh
Download Kubecon Austin 2017 presentations from Sched
#!/bin/bash
mkdir -p kubecon_files
DAYS=("2017-12-06" "2017-12-07" "2017-12-08")
for DAY in "${DAYS[@]}"; do
#Super shitty pipefest because of grep matched groups sadness
LINKS=($(curl https://kccncna17.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
echo "Requesting https://kccncna17.sched.com/${LINK}"
function peco-kubectl-context() {
local selected_context=$(kubectl config view -o go-template --template='{{range .contexts}}{{.name}}{{"\n"}}{{end}}' | peco --query "$LBUFFER")
if [ -n "$selected_context" ]; then
BUFFER="kubectl config use-context $selected_context"
zle accept-line
fi
zle clear-screen
}
zle -N peco-kubectl-context
{
repository(owner: "kubernetes", name: "kubernetes") {
issues(labels: ["sig/cli"], first: 20, orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
title
bodyHTML
url
author {
login
url
#!/usr/bin/env zsh
set -e
__handle_flag() {
local flagname="--namespace="
local flagval="kube-system"
flaghash[${flagname}]=${flagval}
@superbrothers
superbrothers / assign-priority-attendees.js
Last active October 3, 2017 06:31
Assign priority attendees on connpass
var ids = "ian,superbrothers"; // comma-separated list of connpass ids
ids.split(",").forEach(function (id) {
var href = "/user/" + id + "/";
var node = document.querySelector('td.name a[href="' + href + '"]');
if (node === null) {
console.error(id);
return;
};
#!/usr/bin/env bash
set -e
function minikube_dnsmasq_macos() {
local ip
case $1 in
start)
command minikube "$@"
@media (min-width: 1200px) {
.sharedHeader_inner,
.teamSubHeader_inner,
.teamMain_inner {
width: 100% !important;
}
.teamSidebarContainer_main {
width: 75% !important;
}
.teamSidebarContainer_sub {
#!/usr/bin/env bash
set -e
tempfile="$(mktemp)"
trap "rm -rf $tempfile" EXIT
dd if=/dev/zero of=$tempfile bs=1M count=1
start="$(date +%s%N)"