Skip to content

Instantly share code, notes, and snippets.

View zironycho's full-sized avatar
🎨
I may be slow to respond.

Juncheol Cho zironycho

🎨
I may be slow to respond.
View GitHub Profile
@zironycho
zironycho / find-prefix-postfix-number.py
Created March 27, 2018 01:36
find number with prefix, suffix
s = '/example/like_123/1_t34893_.that'
int(re.findall(r'1_t([\d]+)_', s)[0])
@zironycho
zironycho / aws.md
Created July 6, 2018 03:06
aws commands

aws ec2 list

aws ec2 describe-instances \
  --query 'Reservations[].Instances[].[PrivateIpAddress,Placement.AvailabilityZone,InstanceType,State.Name,InstanceId,Platform,State.Code,VpcId]' \
  --output table
@zironycho
zironycho / portainer-agent-stack-traefik.yml
Last active June 30, 2019 23:00
portainer stack with traefik
version: '3.2'
services:
agent:
image: portainer/agent
environment:
# REQUIRED: Should be equal to the service name prefixed by "tasks." when
# deployed inside an overlay network
AGENT_CLUSTER_ADDR: tasks.agent
# AGENT_PORT: 9001
@zironycho
zironycho / rexray-s3fs-create-volume-error.log
Created August 24, 2018 11:49
rexray-s3fs-create-volume-error.log
-- Logs begin at Fri 2018-08-24 11:34:59 UTC, end at Fri 2018-08-24 11:42:29 UTC. --
Aug 24 11:36:16 core-01 systemd[1]: Starting Docker Application Container Engine...
Aug 24 11:36:16 core-01 env[1262]: time="2018-08-24T11:36:16.982531929Z" level=error msg="Failed to built-in GetDriver graph aufs /var/lib/docker"
Aug 24 11:36:17 core-01 env[1262]: time="2018-08-24T11:36:17.076086021Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Aug 24 11:36:17 core-01 env[1262]: time="2018-08-24T11:36:17.077032710Z" level=info msg="Loading containers: start."
Aug 24 11:36:17 core-01 env[1262]: time="2018-08-24T11:36:17.207362181Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Aug 24 11:36:16 core-01 env[1262]: time="2018-08-24T11:36:16.838482132Z" level=info msg="Loading containers: done."
Aug 24 11:36:16 core-01 env[1262]: time="2018-08-24T11:36:16.866658031Z" level=info msg="Daemon has co
@zironycho
zironycho / alb-ingress.yaml
Created May 19, 2019 13:32
argocd alb-ingress controller setup
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: argocd
name: argocd-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]'
alb.ingress.kubernetes.io/certificate-arn: {{ your-acm-arn }}
@zironycho
zironycho / delete-evicted-pod.sh
Created October 5, 2019 02:33
delete evicted pod in kubernetes
kubectl get po -A | grep Evicted | awk '{system ("kubectl -n " $1 " delete po " $2)}'
@zironycho
zironycho / alb-ingress-redirect.yaml
Created April 23, 2020 08:44
example for http to https redirect
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:..."
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]'
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
spec:
@zironycho
zironycho / Dockerfile
Created June 27, 2020 06:29
Outline Dockerfile for production
FROM node:12-alpine
ENV PATH /opt/outline/node_modules/.bin:/opt/node_modules/.bin:$PATH
ENV NODE_PATH /opt/outline/node_modules:/opt/node_modules
ENV APP_PATH /opt/outline
RUN mkdir -p $APP_PATH
WORKDIR $APP_PATH
ARG OUTLINE_VERSION
@zironycho
zironycho / Dockerfile
Created January 11, 2022 23:38
docker + gui + opencv + python3.6
FROM python:3.6.15-buster
RUN pip install \
Pillow==7.2.0 \
opencv-python==4.5.4.58 \
scipy==1.5.4 \
menpo==0.11.0 \
tensorflow==1.14.0 \
scikit-image==0.17.2 \
menpofit==0.7.0 \
@zironycho
zironycho / merge.py
Created December 28, 2022 17:07
merge two audio with silence
from pydub import AudioSegment
audio1 = AudioSegment.from_wav('/path/to/input1.wav')
audio2 = AudioSegment.from_wav('/path/to/input2.wav')
# 0.3s silence
silence = AudioSegment.silent(duration=300)
output = audio1 + silence + audio2
output.export('/path/to/output.wav', format='wav')