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 / sss.sh
Created February 22, 2019 02:56
stern search & select label
function sss ()
{
pods=$(kubectl get pods --all-namespaces \
--no-headers --show-labels | \
sed '1d' | \
fzf -x -m -e +s --reverse --no-mouse \
--bind=left:page-up,right:page-down | \
awk '{print $1" "$7}');
if [[ $pods != "" ]]; then
namespace=${pods/ *};
@leoh0
leoh0 / my-scheduler.sh
Last active March 6, 2019 22:19
assign pod spec when scheduling k8s pods https://asciinema.org/a/230498
#!/bin/bash
set -e
set -o pipefail
SERVER='localhost:8001'
while true;
do
for POD in $(kubectl --server $SERVER get pods -o json --all-namespaces | \
jq -r '.items[] |
@leoh0
leoh0 / log.txt
Last active March 6, 2019 06:49
log
#.bashrc
xset r rate 250 60
# cat /etc/X11/xorg.conf.d/30-touch.conf
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event18"
MatchDriver "libinput"
# here add your option
Option "Tapping" "1"
@leoh0
leoh0 / Dell XPS 15 9560 Manjaro Setup instructions
Created March 20, 2019 08:41 — forked from meirbon/Dell XPS 15 9560 Manjaro Setup instructions
Small, quick guide to set up Manjaro on the XPS 15 9560
# 1. First of all of course get Manjaro:
https://manjaro.org/get-manjaro/
# I recommend using Etcher to copy the image to your USB:
https://etcher.io/
# 2. Before installing make sure:
# - Secure boot is disabled in BIOS
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much
@leoh0
leoh0 / install.sh
Last active March 21, 2019 08:50
install manjaro
#!/bin/bash
set -e
set -o pipefail
# install.sh
# This script installs my basic setup for a manjaro laptop
# Choose a user account to use for this installation
get_user() {
if [ -z "${TARGET_USER-}" ]; then
#!/bin/bash
function ensure_privileged_or_exit() {
grep -xq $'CapBnd:\t0000003fffffffff' /proc/self/status || \
(echo -e "[ERROR] Run with --privileged option." ; exit 1)
}
### Main
ensure_privileged_or_exit
#!/bin/bash
curl -fSL \
--progress \
-H "Authorization: Bearer $(curl -fsSL \
"https://auth.docker.io/token?service=registry.docker.io&scope=repository:leoh0/kakaotalk:pull" | \
sed 's/.*"token":"\([^"]*\)".*/\1/g')" \
https://registry-1.docker.io/v2/leoh0/kakaotalk/blobs/sha256:030ac842b5fc9f2a86056a93bbf8c4f706b33db131952f1f571c28013f266bfc | \
tar xzvf -
@leoh0
leoh0 / README.md
Last active April 25, 2019 11:15
github contribution as a calendar

Setup

# COMMIT_USERNAME is for your commit user name
export COMMIT_USERNAME="Eohyung Lee"

# COMMIT_USERNAME is for your commit email
export COMMIT_USEREMAIL=liquidnuker@gmail.com

# GITHUB_USERNAME is for github user name(or organization name)
curl -s \
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
-H 'Content-Type: application/json' \
-d'{"apiVersion":"v1","kind":"Pod","metadata":{"name":"nginx"},"spec":{"containers":[{"name":"nginx","image":"nginx","ports":[{"containerPort":80}]}]}}' \
https://kubernetes.default.svc/api/v1/namespaces/$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)/pods
@leoh0
leoh0 / create_pod_by_curl_in_pod.sh
Last active April 21, 2020 22:56
pod μ•ˆμ—μ„œ pod λ§Œλ“€κΈ° 예제
# pod 생성을 μœ„ν•œ μ€€λΉ„
kubectl create sa a
kubectl create role a --verb=create --resource=pod
kubectl create rolebinding a --role=a --serviceaccount=default:a
# pod ν•˜λ‚˜ 생성
cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata: