Skip to content

Instantly share code, notes, and snippets.

View JhoLee's full-sized avatar
🕹️
Focusing

Jooho Lee JhoLee

🕹️
Focusing
View GitHub Profile
@JhoLee
JhoLee / semantic-commit-messages.md
Created February 4, 2022 15:11 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@JhoLee
JhoLee / reset-k8s-node.sh
Last active March 2, 2023 00:53
Reset K8S Node
echo -n "Really want to reset this node? (y/N): "
read -r check
if [[ "$check" = "y" ]]; then
echo "[INFO] Reset kubeadm"
kubeadm reset -f
echo "[INFO] Stop kubelet & docker service"
systemctl stop kubelet docker docker.socket
echo "[INFO] Remove K8S files"
rm -rvf /etc/kubernetes/*
@JhoLee
JhoLee / job.yaml
Created November 26, 2021 04:04 — forked from alexellis/job.yaml
Use a Kubernetes Job and Kaniko to build an OpenFaaS function from Git
# Alex Ellis 2018
# Example from: https://blog.alexellis.io/quick-look-at-google-kaniko/
# Pre-steps:
# kubectl create secret generic docker-config --from-file $HOME/.docker/config.json
# Other potential optimizations (suggested by @errordeveloper)
# - Store "templates" in a permanent volume
# - Download source via "tar" instead of git clone
@JhoLee
JhoLee / deploy-kube-flannel-online.sh
Last active November 16, 2021 05:31
K8S CNI - Flannel
#!/bin/bash
echo "[INFO] Deploying kube-flannel..."
echo -n "Image prefix (default: '', example: 'harbor.local/library/'): "
read -r image_prefix
echo $image_prefix
echo -n "cpu requests & limits(default: 100m): "
read -r resource_cpu
resource_cpu="${resource_cpu:='100m'}"
@JhoLee
JhoLee / docker_inspect2csv.py
Last active October 2, 2021 16:56
Inspect Docker containers' info to csv files
#!python3
import csv
from datetime import datetime
from os import listdir, path, makedirs, system
import json
DATE = datetime.now().strftime("%y%m%d")
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' "required
Plugin 'tpope/vim-fugitive' "required
Plugin 'Yggdroot/indentLine'
call vundle#end()
filetype plugin indent on
#!/bin/bash
BASE_URL="https://osmdata.openstreetmap.de/download/"
POSTFIX=".zip"
names=("simplified-water-polygons-split-3857" "water-polygons-split-3857" "antarctica-icesheet-polygons-3857" "antarctica-icesheet-outlines-3857")
for (( i=0; i<${#names[@]}; i++)); do
wget ${BASE_URL}${names[i]}${POSTFIX}
unzip ${names[i]}${POSTFIX}
create extension hstore;
create table if not exists planet_osm_line
(
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
wget -O - https://gist.githubusercontent.com/JhoLee/e117475baf16294a3d6701165986b57d/raw/ab5faa508964fc02eca55b107bde749500fc1f3c/download_shapes.sh | bash
wget -O - https://gist.githubusercontent.com/JhoLee/f10843550431865b7030276f4fd3c8bf/raw/b772140330fb380f4561b298e75f1db27b3fa784/download_osm_pbf.sh | bash
#!/bin/bash
# $1: osm_directory_path
## if directory exists, parse file lists,
EXT_LIST=(".osm" ".osm.pbf")
if [ -e $1 ]; then
# OSM2PGSQL