Skip to content

Instantly share code, notes, and snippets.

View miyu4u's full-sized avatar

miyu kim miyu4u

  • Seoul
View GitHub Profile
@miyu4u
miyu4u / gist:2d988dbce74eee7e2f0ecaccf25d4900
Created January 14, 2020 12:32
deploy traefik at all worker node with docker swarm
version: "3.6"
services:
socket-proxy:
image: tecnativa/docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
SERVICES: 1
TASKS: 1
@miyu4u
miyu4u / docker-compose.proxy.stack.yml
Created January 14, 2020 12:32
deploy traefik at all worker node with docker swarm
version: "3.6"
services:
socket-proxy:
image: tecnativa/docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
SERVICES: 1
TASKS: 1
@miyu4u
miyu4u / docker-compose.app.stack.yml
Last active January 14, 2020 23:47
deploy test container with traefik docker swarm
version: "3.6"
services:
cats:
image: mikesir87/cats
networks:
- proxy_entry
deploy:
replicas: 10
labels:
@miyu4u
miyu4u / dockerfile
Created January 19, 2020 09:56
Proxy sql with query routing
FROM debian:stretch
RUN apt-get update && apt-get install -y wget lsb-release gnupg apt-transport-https ca-certificates && \
wget -O - 'https://repo.proxysql.com/ProxySQL/repo_pub_key' | apt-key add - && echo deb https://repo.proxysql.com/ProxySQL/proxysql-2.0.x/$(lsb_release -sc)/ ./ | tee /etc/apt/sources.list.d/proxysql.list && \
apt-get update && apt-get install proxysql && apt-get install -y mysql-client vim && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["proxysql", "-f", "-D", "/var/lib/proxysql"]
@miyu4u
miyu4u / heros.controller.ts
Last active January 23, 2020 13:24
NestJs TypeOrm create MultiTenant Connection at runtime Example (Multiple DB, Multiple Schema)
import { Controller, Scope } from '@nestjs/common';
import { Crud } from '@nestjsx/crud';
import { Heros } from '../entity/heros.entity';
import { HerosService } from './heros.service';
@Crud({
model: {
type: Heros
}
@miyu4u
miyu4u / registration.js
Created February 24, 2020 16:22
국세청 사업자등록상태조회 Promise Wrapper
/**
* 국세청 사업자등록상태조회 Promise Wrapper
*
* 사용으로 인해 발생하는 문제는 모두 사용 당사자에게 있습니다.
*/
function registration() {
if (typeof (WebSquare) == "undefined") throw "국세청 모듈이 존재하지 않습니다.";
var _eventKey = "fetch"
@miyu4u
miyu4u / mocking.ts
Last active May 27, 2020 13:33
mocking typescript class depedency with jest test framework
import { FoobarService } from "./foobar.service"
import { FooService } from "./foo.service"
import { BarService } from "./bar.service"
jest.mock("./foo.service")
jest.mock("./bar.service")
describe("foobar service", ()=>{
let service:FoobarService
let foo:FooService
let bar:BarService
@miyu4u
miyu4u / fix.sh
Created August 17, 2023 11:48 — forked from koreapyj/fix.sh
Fix PiKVM WiFi malfunction issues on Raspberry Pi Zero 2 W
rw
cd /lib/firmware/brcm
ln -s ../cypress/cyfmac43430-sdio.bin brcmfmac43436s-sdio.raspberrypi,model-zero-2-w.bin
ln -s ../cypress/cyfmac43430-sdio.clm_blob brcmfmac43436s-sdio.raspberrypi,model-zero-2-w.clm_blob
ln -s brcmfmac43430-sdio.raspberrypi,3-model-b.txt brcmfmac43436s-sdio.raspberrypi,model-zero-2-w.txt
ro
reboot