Skip to content

Instantly share code, notes, and snippets.

View rpkim's full-sized avatar

Jay Kim rpkim

View GitHub Profile
from ctypes import *
from numpy import *
import platform
import inspect
import time
import os
from pprint import pprint
INTEROPLIB = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + "/libinterop-api.so.1"
if platform.system() == 'Windows':
@rpkim
rpkim / README.md
Created November 30, 2019 01:18
Youtube Playlist HTML Auto generation

Youtube Playlist HTML Auto generation

This is an auto generator the html for http://rpkim.net/music.html website page. Getting the playlist in my Youtube and generate the listing of music in my playlist.

Pre-required

  • Google API Enabled (Youtube Data API)
  • jq should be installed
  • httpie should be installed
  • $GKEY environment variable should be setup
@rpkim
rpkim / aws.sg.unused
Created March 22, 2019 04:47 — forked from thibautsacreste/aws.sg.unused
Bash: list unused AWS security groups
#!/usr/bin/env bash
# lists all unused AWS security groups.
# a group is considered unused if it's not attached to any network interface.
# requires aws-cli and jq.
# all groups
aws ec2 describe-security-groups \
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \
| sort > /tmp/sg.all
@rpkim
rpkim / helm.md
Last active April 30, 2019 00:00
Helm

Helm

Kubernetes package manager for managing a lot of yaml files

basic flow

[ *bundle of yamls* -> chart ]  <──────────────────────── management tool "helm"
                          └─> "tgz" file is created.         
                                  └─> upload "Chart repository"  | monocular:Web UI for Helm Chart
                                                                 | chartmuseum: Chart for S3,GCS and so on(Cloud storage)
 
@rpkim
rpkim / kong-install.md
Created January 22, 2019 12:25
how to install kong

Kong

gcloud compute instances create kong-poc \
    --machine-type n1-standard-2 --zone asia-east1-a \
    --boot-disk-size=200G \
    --image-family ubuntu-1604-lts --image-project ubuntu-os-cloud \
    --maintenance-policy TERMINATE --restart-on-failure \
    --scopes=cloud-platform,datastore,storage-ro,service-management,service-control,trace,compute-rw,storage-full,https://www.googleapis.com/auth/cloudkms \
    --metadata startup-script='#!/bin/bash
@rpkim
rpkim / api-umbrella-install.md
Created January 22, 2019 12:25
how to install api umbrella

API Umbrella

gcloud compute instances create apiumbrella-poc \
    --machine-type n1-standard-2 --zone asia-east1-a \
    --boot-disk-size=200G \
    --image-family ubuntu-1604-lts --image-project ubuntu-os-cloud \
    --maintenance-policy TERMINATE --restart-on-failure \
    --scopes=cloud-platform,datastore,storage-ro,service-management,service-control,trace,compute-rw,storage-full,https://www.googleapis.com/auth/cloudkms \
 --metadata startup-script='#!/bin/bash
@rpkim
rpkim / partial-execute-terraform.md
Created January 8, 2019 12:12
How to execute partially in Terraform

How to execute the partial execute for Terraform

There is an option -target for targetting the specific resources which you want to create with apply command or plan command. Sometimes, we faced the situation, new resources should be created first and update/destroy should be created later. In case of that, you can use the below commands.

New Resources Only

echo "terraform apply $(terraform plan -no-color | grep '\+ ' | grep -v 'new resource required' | grep -v 'create' | sed 's/\+ /\-target\=/g' | sed 's/$/ \\/g')"

Update Resources Only

echo "terraform apply $(terraform plan -no-color | grep '\~ ' | grep -v 'update in-place' | sed 's/\~ /\-target\=/g' | sed 's/\ //g' | sed 's/$/ \\/g')"

@rpkim
rpkim / gcp-regions.md
Last active April 4, 2024 12:14
GCP Region Names

Alterantive naming schemes for GCP regions

Purpose

The intent is to define terse. standard-supported names for GCP regions.

Schemes

Region Location GCP code A1 A2 B Launched