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 / typecast-quick-cloning.py
Created October 25, 2024 04:22
Typecast api with quick cloning (python)
import os
import time
import requests
API_TOKEN = {{your API token}}
REFERENCE_AUDIO_FILENAME = {{your audio filename}}
HEADERS = {'Authorization': f'Bearer {API_TOKEN}'}
@zironycho
zironycho / make-signature.py
Last active November 15, 2023 02:15
make signature for api
import sys
import base64
import hmac
from hashlib import sha1
from datetime import datetime, timezone
# https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/userguide/RESTAuthentication.html
def make_signature(timestamp, company, endpoint, method, secret_key):
string_to_signin = '\n'.join([
@zironycho
zironycho / news.txt
Last active November 22, 2023 05:39
Typecast api with textfile (such as news)
11월 7일 오후 (하지만 오전일 수도 있는?) 뉴스입니다.
<break time="1000ms" />
<unknown time="1000ms" />
입동을 하루 앞두고 전국 대부분 지역의 기온이 어제보다 10도 넘게 떨어졌습니다.
내일은 오늘보다 더 쌀쌀하겠고 모레 기온이 조금 오르지만, 주말부터 다시 추워질 전망입니다.
<break time="1000ms" />
병원에서 치료를 받다가 도망친 특수강도 피의자 김길수가 도주 70여 시간 만에 어젯밤 경기도 의정부에서 붙잡혔습니다.
김길수는 체포 직후 "도주계획이나 조력자가 없었다"고 주장했습니다.
<break time="1000ms" />
전 펜싱 국가대표 남현희 씨가 결혼 상대였던 전정조 씨의 사기 혐의 공범으로 입건돼 10시간 가까이 조사를 받고 귀가했습니다.
@zironycho
zironycho / typecast.py
Last active December 29, 2023 06:53
Typecast api (python)
import requests
import time
API_TOKEN = {{your token here}}
HEADERS = {'Authorization': f'Bearer {API_TOKEN}'}
# get my actor
r = requests.get('https://typecast.ai/api/actor', headers=HEADERS)
my_actors = r.json()['result']
@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')
@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 / 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 / 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 / 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.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 }}