Skip to content

Instantly share code, notes, and snippets.

@feiz
feiz / datt
Created April 19, 2017 06:57
dockerコンテナにガッとattachするやつ
#!/bin/sh
# usage
# datt PIECE_OF_CONTAINER_NAME
#
# example
# $ datt app1
# $ datt postg psql -U myuser mydatabase
#
# This is useful for using pdb.
@feiz
feiz / fjencode
Last active June 1, 2017 09:18
:fuji::moto::you::ichi:
#!/usr/local/bin/python3
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('text', type=str, default=sys.stdin, nargs='?')
grp = parser.add_mutually_exclusive_group(required=True)
grp.add_argument('--decode', '-d', action='store_true', default=True)
grp.add_argument('--encode', '-e', action='store_true', default=False)
@feiz
feiz / avrdude.sh
Last active December 22, 2018 18:44 — forked from nyomo/avrdude.sh
WSLでavrdudeを簡単に使う為の奴 qmk用
MODECMD='/mnt/c/Windows/System32/mode.com'
COMPORT1=$(${MODECMD}|grep -o 'COM[0-9]*')
COMPORT2=""
while [ "$COMPORT2" = "" ];do
sleep 0.5
printf "."
COMPORT2=$(${MODECMD}|grep -v '${COMPORT1}'|grep -o 'COM[0-9]*')
done
PORTNUM=$(echo $COMPORT2|sed -e 's/COM//')
avrdude -c avr109 -p atmega32u4 -P /dev/ttyS${PORTNUM} -U flash:w:$*