Skip to content

Instantly share code, notes, and snippets.

View leoh0's full-sized avatar
๐Ÿ•ถ๏ธ
Working

Eohyung Lee leoh0

๐Ÿ•ถ๏ธ
Working
View GitHub Profile
@leoh0
leoh0 / upload-github-release-asset.sh
Created July 24, 2018 03:56 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
#!/bin/bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@leoh0
leoh0 / debugdead.py
Last active January 23, 2024 01:58
debugging dead k8s pod ( copy k8s pods and inject busybox binary and change command to sleep )
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
import uuid
from tempfile import NamedTemporaryFile
import yaml
@leoh0
leoh0 / README.md
Last active August 16, 2018 23:12
Use docker hub as a public accessible storage when you need to upload and download large file for free.

docker_as_a_storage

Upload with docker, download with only curl.

  1. upload your file
REPO=YOUR_DOCKER_ID ./docker_as_a_storage.sh <file or directory>
@leoh0
leoh0 / csi-pv.py
Last active September 15, 2018 11:31
python csi-pv.py $PV # for migrating CSI RBD
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
import time
import uuid
from random import randrange
@leoh0
leoh0 / csi-pvc.py
Last active September 15, 2018 11:33
python csi-pvc.py ${PVCNAME} -n ${NAMESPACE} # for migration csi pvc
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
import yaml
def main():
@leoh0
leoh0 / csi-migration.sh
Created September 15, 2018 12:11
bash csi-migration.sh $PV
#!/usr/bin/env bash
CEPH_RBD=${CEPH_RBD:-ceph-rbd}
read POOL MONITOR ID SECRET SECRET_NS <<< \
$(kubectl get storageclass ${CEPH_RBD} \
-o go-template='{{ .parameters.pool }}
{{ .parameters.monitors }}
{{ .parameters.adminId }}
{{ .parameters.adminSecretName }}
@leoh0
leoh0 / Create_admin_token_in_k8s.sh
Last active November 28, 2018 08:49
Create admin token for admin.conf which is free from cert(PKI) in kubernetes
#!/usr/bin/env bash
# In general, operators need a `admin.conf` file when they use the kubectl
# for managing k8s.
# In `admin.conf` file, there is a user section for authenticating k8s which is
# configured by PKI datas like `certificate-data` and `key-data`.
# This PKI is great authentication system in k8s, but it has some limitations.
# For example, you need to care creating new certs before it is expired and you
@leoh0
leoh0 / CVE-2019-5736.md
Last active December 30, 2019 00:23
CVE-2019-5736 poc ์™€ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ์ •๋ฆฌ ํ–ˆ์Šต๋‹ˆ๋‹ค.

CVE-2019-5736

์„ค๋ช…

์ด ์ทจ์•ฝ์ ์€ ์•…์˜์ ์ธ ์‚ฌ์šฉ์ž๊ฐ€ ์ปจํ…Œ์ด๋„ˆ(runc๋ฅผ ์‚ฌ์šฉํ•˜๋Š” docker ๋“ฑ)๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ˜ธ์ŠคํŠธ ์‹œ์Šคํ…œ์˜ runc ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ๋ณ€์กฐํ•˜์—ฌ root ์–ต์„ธ์Šค๋ฅผ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ๋‚ด์šฉ์€ redhat์„ ์ฐธ๊ณ ํ•˜์‹œ๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค.

POC