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 / 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 / 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 / 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 / plugin-inspect.json
Last active November 4, 2020 20:23
issue-rexray/s3fs:0.11.2
[
{
"Config": {
"Args": {
"Description": "",
"Name": "",
"Settable": null,
"Value": null
},
"Description": "REX-Ray FUSE Driver for Amazon Simple Storage Service (S3FS)",
@zironycho
zironycho / ps1.sh
Last active January 4, 2018 12:18
ps1
### remote
pse="\[\033[m\]"
ps_w="\[\033[33;1m\]\w$pse"
ps_t="\[\033[35m\]\t$pse"
ps_h="\[\033[32m\][\h]$pse"
ps_u="\[\033[36m\]\u$pse"
if [ "`whoami`" = "root" ]; then
ps_p="# $pse"
else
@zironycho
zironycho / trans-subs.py
Created September 30, 2017 04:12
trans-subs.py
import sys
import os
import codecs
# euc-kr to utf-8 with BOM
def convert(path):
with codecs.open(path, 'r', 'euc-kr', errors='ignore') as f:
out_lines = []
for line in f.readlines():
@zironycho
zironycho / keybase.md
Created September 19, 2017 04:55
keybase

Keybase proof

I hereby claim:

  • I am zironycho on github.
  • I am zironycho (https://keybase.io/zironycho) on keybase.
  • I have a public key ASBFpr3Bu-np1bvVeBDC7-W7Nws-zTGpaaWWP5S-r88qMQo

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.19848701357841492</real>
@zironycho
zironycho / truncate_euckr.py
Created January 6, 2017 06:09
truncated for euckr
def truncate_euckr(str, limit):
buf = bytes()
for c in str:
tmp = c.encode('euc-kr')
if len(buf) + len(tmp) < limit:
buf += tmp
else:
break
return buf