Skip to content

Instantly share code, notes, and snippets.

View leopard627's full-sized avatar

Leopard627 leopard627

  • South Korea
  • 00:46 (UTC +09:00)
View GitHub Profile
docker service update \
--update-parallelism 1 \
--update-delay 5s \
--update-order stop-first \
--image { your docker iamge } \
--force \
--with-registry-auth \
api
docker service update \
--update-parallelism 1 \
--update-delay 5s \
--update-order stop-first \
--image 460957833:나의 이미지 예시 \
--force \
--with-registry-auth \
api
@leopard627
leopard627 / docker service update
Created January 14, 2020 02:47
docker swarm update example
docker service update \
--update-parallelism 1 \
--update-delay 5s \
--update-order stop-first \
--image 460957833:나의 이미지 예시 \
--force \
--with-registry-auth \
api
@leopard627
leopard627 / run.sh
Created January 11, 2020 12:44
git not found in alpine image
apk update && apk upgrade && \
apk add --no-cache bash git openssh
@leopard627
leopard627 / prometheus.yml
Created January 10, 2020 17:23 — forked from subicura/prometheus.yml
prometheus on swarm (2)
global:
scrape_interval: 30s
evaluation_interval: 30s
external_labels:
monitor: "prometheus-swarm"
rule_files:
scrape_configs:
- job_name: 'prometheus'
@leopard627
leopard627 / docker-stack.yml
Created January 10, 2020 17:22 — forked from subicura/docker-stack.yml
prometheus on swarm
# docker stack deploy --compose-file ./docker-stack.yml prom-stack
version: "3"
services:
prometheus:
image: prom/prometheus:latest
networks:
- monitoring
ports:
- 9001:9090
ECR=$(docker exec -it guide-aws sh -c 'aws ecr get-login --no-include-email --region ap-northeast-2')
echo "creating login temp file"
_ECR=$(echo ${ECR} | tr -d '\r')
echo ${_ECR} > ecr.out
echo 'login into ecr'
$(cat ecr.out)
echo "removing temp file"
rm ecr.out
@leopard627
leopard627 / docker-prom-stack.yml
Last active January 11, 2020 12:14 — forked from subicura/docker-prom-stack.yml
docker-prom-stack.yml
version: "3"
networks:
monitoring:
app-backend:
services:
cadvisor:
image: google/cadvisor:${CADVISOR_VERSION:-v0.26.1}
networks:
@leopard627
leopard627 / allow_sql_query_history.py
Created December 10, 2019 05:59
django 에서 테스트 케이스 돌릴때 쿼리 같이 뽑는 방법 :P
## reference
## https://stackoverflow.com/questions/13162771/django-how-to-see-sql-query-when-running-tests
from django.db import connection, reset_queries
from django.test import override_settings, TransactionTestCase
class TransactionTests(TransactionTestCase):
@override_settings(DEBUG=True)
def test_sql(self):
@leopard627
leopard627 / deleteCharHandler.js
Created October 25, 2019 05:13
react 에서 array의 index를 삭제하는 핸들러 패턴
deleteCharHandler = (index) => {
const text = this.state.content.split('');
text.splice(index, 1);
const updatedText = text.join('');
this.setState({content: updatedText});
}