Skip to content

Instantly share code, notes, and snippets.

View hkwi's full-sized avatar

Hiroaki KAWAI hkwi

View GitHub Profile
@hkwi
hkwi / ckan.ini
Created January 10, 2024 07:29
ckan debug setup
[app:main]
ckan.site_url=http://localhost
SECRET_KEY=secret
sqlalchemy.url=postgresql://ckan:test@localhost/ckan
solr_url=http://localhost:8983
[formatters]
keys=
[handlers]
keys=
@hkwi
hkwi / README.md
Created September 26, 2023 02:06
extending readable-stream on both browser and node

test

@hkwi
hkwi / README.md
Last active December 27, 2022 07:30
2022-12 ルピシア 福袋 松1
@hkwi
hkwi / 0_README.md
Last active March 2, 2022 06:18
envoy tcp proxy relay using ProxyProtocol

Working example using envoy ProxyProtocol, not HTTP CONNECT.

 +--------+         +-------+                   +-------+         +--------+
 | client +--(tcp)--+ envoy +--(ProxyProtocol)--+ envoy +--(tcp)--+ server |
 +--------+         +-------+                   +-------+         +--------+

See also envoy source configs/* files.

@hkwi
hkwi / 0_README.md
Last active March 2, 2022 01:37
envoy tcp proxy relay using HTTP CONNECT

Working example using envoy HTTP CONNECT proxy, not ProxyProtocol.

 +--------+         +-------+                  +-------+         +--------+
 | client +--(tcp)--+ envoy +--(HTTP CONNECT)--+ envoy +--(tcp)--+ server |
 +--------+         +-------+                  +-------+         +--------+

See also envoy source configs/* files.

@hkwi
hkwi / README.md
Last active April 3, 2021 14:47
解法メモ

灘中 入試問題 2014 年 算数 1 日目

4

コ列の残りの和は20となる。 エ列+オ列=セ列+ソ列なので、共通部分以外に目を向けると、7+20 = 4+10+? となる。 カ列の真ん中は 13 とわかる。 A+13+10=38 なので、A=15 となる。

38-11-18=9 より、サ列は9, 11, 18 となる。 38-9-15=14 より、ア列は9, 14, 15 となる。

@hkwi
hkwi / README.md
Last active July 20, 2020 00:42
M5Stack basic 作業メモ

M5Stack 開発環境は複数あるが、公式版は micropython に Microsoft Makecode を被せて web service 経由でコードを書き込む UIFlow が代表的。 arduino esp32 target として作る方法もあるし、espressif ライブラリと C++ で作る方法もある。

M5Stack の USB シリアル接続は一般的な esp32 直接接続ではなく、CP210x を経由するようになっている。 この USB ドライバが正常動作するようになると、シリアルポートとして見えるようになる。

M5 Burnerという公式ツールがあり、esp32のイメージ書き込みができる。 またいわゆるストアのような側面も持っており、UIFlowの公式イメージもこれで簡単に書き込める。 一般的な esptool を内蔵していて、それを呼び出している。

@hkwi
hkwi / README.md
Last active November 22, 2019 04:47
weather:bit micro-python implementation take 1

MicroPython Micro:bit で Weather:bit のコードの実装を試みた。

weatherbit.py でメモリ溢れした。

@hkwi
hkwi / README.md
Last active October 31, 2019 10:01
mysql apt respoitory 対応できるか検討

apt repository 側

  1. deb ファイルを集める
  2. deb ファイルのメタ情報を集めた Packages ファイルを作る
  3. mkdir -p main/binary-amd64
  4. dpkg-scanpackages で deb ファイルを検査して上記ディレクトリに Packages ファイルを出力する
  5. Packages を Release に載せる。apt-ftparchive release . > Release
  6. gpg --sign -b -a -o Release.gpg Release

https://wiki.debian.org/DebianRepository/Format#A.22Release.22_files

@hkwi
hkwi / example.py
Created July 1, 2019 08:21
opentracing instrumentation for flask_restplus and flask_sqlalchemy
from flask import Flask
from flask_restplus import Api, Resource
from flask_sqlalchemy import SQLAlchemy
from flask_opentracing import FlaskTracing
from jaeger_client import Config
from opentracing_instrumentation import get_current_span
from opentracing_instrumentation.client_hooks import install_all_patches
import requests
import sqlalchemy_opentracing