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
@ThinGuy
ThinGuy / del-stuck-ip.sh
Created June 11, 2021 22:00
Delete Observed "stuck" IP from MAAS
#!/bin/bash
[[ -z ${1} || ${1} =~ -h ]] && { printf "\n\e[2GUsage: ${0##*/} <ip_address>\n\n";exit 2; } || { export STUCK_IP=${1}; }
# MAAS IP Address Allocation
# Type Name
# ━━━━ ━━━━
# 0 AUTO
# 1 STICKY
@yuya-takeyama
yuya-takeyama / README.md
Last active January 14, 2023 11:15
DevOps な組織で Monorepo から Argo CD を使って Kubernetes にデプロイする仕組みの草案

概要

image

前提条件

  • アプリケーションは Mono Repo 上にサブディレクトリとして数十ほど存在
  • 各アプリケーションは独立してリリース可能とする
    • そのためにリリースブランチ等には */release といった形でそのアプリケーションの名前を持つ
  • 開発チームは self-contained な DevOps チームへの変化を目指している
@carolynvs
carolynvs / svcat-plugin-experience-report.md
Last active April 5, 2022 20:38
Experience Report: Building a kubectl plugin for Service Catalog

Experience Report: Building a kubectl plugin for Service Catalog

Why a kubectl plugin?

The goal of the service catalog cli (svcat) is to reduce the learning curve for developers and follow precedent set by kubectl when reasonable so that "finger memory" built-up from using kubectl translates to being able to use svcat without reading the help text much.

It isn't intended to be a replacement for kubectl, and instead users will jump back and forth between kubectl and svcat. As a plugin, it reinforces the mental model that svcat conforms to the way kubectl works, and makes the switch between the two less noticeable.

@hobbsh
hobbsh / kubecon_curl.sh
Created December 9, 2017 04:23
Download Kubecon Austin 2017 presentations from Sched
#!/bin/bash
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}"
#Find file link on event page
FILE_URL=$(curl -s https://kccncna17.sched.com${LINK} | grep "file-uploaded" | cut -d\" -f 4)
@rkrzr
rkrzr / auto_tags.py
Last active April 10, 2024 11:14
Automatically generate ansible tags of the same name for each role in a playbook
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@iAugur
iAugur / ansible-add-string-to-line.yml
Last active February 22, 2024 14:25
Ansible: Add a String to an existing line in a file
# Adapted from solution provided by http://stackoverflow.com/users/57719/chin-huang http://stackoverflow.com/a/31465939/348868
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config
# before:
# AllowGroups Group1
# After:
# AllowGroups Group1 Group2
- name: Add Group to AllowGroups
replace:
backup: yes
@codemedic
codemedic / vpn-docker-fix
Last active June 15, 2023 18:17
Docker network through host IPSec / Strongswan VPN
#!/usr/bin/env bash
# Link up docker network via IPSec VPN on docker-host.
#
# NOTE: This script can either be "sourced" into your .bashrc or executed directly. Be
# it sourced or executed, the usage syntax below is the same.
#
# Usage: [dry_run=1] [debug=1] vpn-docker-fix [docker-network-1 [docker-network-2 ...]]
#
# Env Variables:
@maxvt
maxvt / infra-secret-management-overview.md
Last active February 28, 2024 20:53
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@yifan-gu
yifan-gu / dex-kubernetes.md
Last active May 8, 2019 06:52
dex/kubernetes guide

Create CA cert/key files

In order to enable oidc authenticator in kube-apiserver, we need to have TLS enabled between kubectl and kube-apiserver, as well as between kube-apiserver and OpenID Provider(dex-worker here)

For simplicity, we will use cfssl to create the bundles.

Start dex worker

Checkout and build dex

cat Dockerfile
# 4.3.12 should probably be something like 4.3.10 or somesuch
#
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \