Skip to content

Instantly share code, notes, and snippets.

MySQL Operator for Kubernetes

Install using Manifest Files

kawasaki@k8s-1:~$ kubectl apply -f https://raw.githubusercontent.com/mysql/mysql-operator/trunk/deploy/deploy-crds.yaml
customresourcedefinition.apiextensions.k8s.io/innodbclusters.mysql.oracle.com created
customresourcedefinition.apiextensions.k8s.io/mysqlbackups.mysql.oracle.com created
customresourcedefinition.apiextensions.k8s.io/clusterkopfpeerings.zalando.org created
@emanon-was
emanon-was / sdk
Created November 22, 2022 06:40
sdkman cmd
#!/usr/bin/env bash
source $SDKMAN_DIR/bin/sdkman-init.sh
if [ "$1" == 'exec' ]; then
${@:2};
else
sdk $@;
fi
@emanon-was
emanon-was / From.kt
Last active September 12, 2020 17:18
RustのFromトレイトを模倣したかったが…
interface Static<T>
data class Target(val a: Int) {
companion object : Static<Target>
}
interface From<T, U> {
fun Static<T>.from(value: U) : T
}
import java.util.Optional;
public abstract class Result<T,E extends Throwable> {
public static <T,E extends Throwable> Ok<T,E> ok(T a) { return new Ok(a); }
public static <T,E extends Throwable> Err<T,E> err(E a) { return new Err(a); }
public abstract T unwrap() throws E;
public abstract boolean isOk();
public abstract boolean isErr();
@emanon-was
emanon-was / Makefile
Last active February 4, 2020 07:37
Makefile for Docker
#
# Arguments
# ==============
# - DOCKER_IMAGE
# - DOCKER_TAG
# - AWS_ACCOUNT_ID
# - AWS_DEFAULT_REGION
#
docker.build:
@emanon-was
emanon-was / Makefile
Last active August 27, 2018 09:09
KMSを使いファイルを暗号化して管理するためのMakefile
TMPDIR ?= /tmp
.PHONY := encrypt decrypt cmk dependencies
.DEFAULT_GOAL := dependencies
encrypt: dependencies
$(call exit_invalid_arguments,$(ENCRYPT_KEY),"$$USAGE_ENCRYPT")
fibonacci :: (Num a) => [a]
fibonacci = f 0 1
where f x y = x : f y (x + y)
-- Prelude> fibonacci !! 45
-- 1134903170
-- (0.00 secs, 3131752 bytes)
startWith :: (Eq a) => [a] -> [a] -> Maybe [a]
startWith [] ys = Just ys
startWith xs [] = Nothing
startWith (x:xs) (y:ys)
| x == y = startWith xs ys
| otherwise = Nothing
split :: (Eq a) => [a] -> [a] -> [[a]]
split [] lst = [lst]
split sep lst = split' [] lst
@emanon-was
emanon-was / YesNo.hs
Created November 11, 2017 13:33
型クラスのインスタンスに型制約を指定したい時のGHC拡張
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE IncoherentInstances #-}
class YesNo a where
yesno :: a -> Bool
instance (Num a, Eq a) => YesNo a where
yesno 0 = False
yesno _ = True
@emanon-was
emanon-was / foldx.hs
Last active November 6, 2017 12:23
foldlとfoldl'の差
myFoldr :: (a -> b -> b) -> b -> [a] -> b
myFoldr _ a [] = a
myFoldr f a (x:xs) = f x $ myFoldr f a xs
myFoldr1 :: (a -> a -> a) -> [a] -> a
myFoldr1 f (x:xs) = myFoldr f x xs
myFoldl :: (b -> a -> b) -> b -> [a] -> b
myFoldl _ a [] = a
myFoldl f a (x:xs) = myFoldl f (f a x) xs