Skip to content

Instantly share code, notes, and snippets.

@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
@hkwi
hkwi / README.md
Last active June 7, 2019 13:55
docker-ce install
#cloud-config
ssh_pwauth: yes
system_info:
  default_user:
    name: admin
    # Following hash is password "hogehoge" generated by
    #   mkpasswd --method=SHA-512 --rounds=4096
    # See: https://cloudinit.readthedocs.io/en/latest/topics/examples.html
    passwd: $6$rounds=4096$u6DZal0//p$5B7yWkliowzZnxvd5U0MFR1lh.w.elPWzmmrfMPyPP0DEzxkFl9YMs5tavxbrqVunKVJkenf/EpUN/mMmGGfD1
lxc launch ubuntu:bionic hoge -c user.user-data="$(cat config.yml)"
@hkwi
hkwi / httpie_demo.sh
Last active April 10, 2019 04:52
confluent kafka rest-proxy demo script
http POST http://rest-proxy:8082/topics/jsontest content-type:application/vnd.kafka.json.v2+json records:='[{"value":{"name":"testUser"}}]'
http http://rest-proxy:8082/topics/jsontest
http http://rest-proxy:8082/topics
http POST http://rest-proxy:8082/consumers/my_json_consumer content-type:application/vnd.kafka.v2+json accept:application/vnd.kafka.v2+json name=my_consumer_instance format=json auto.offset.reset=earliest
http POST http://rest-proxy:8082/consumers/my_json_consumer/instances/my_consumer_instance/subscription content-type:application/vnd.kafka.v2+json topics:='["jsontest"]'
---
site: https://www.city.moriya.ibaraki.jp/
missing: Cybertrust Japan Extended Validation Server CA
sent:
- Cybertrust Japan EV CA G2
- Cybertrust Global Root
---
site: https://www.city.kurashiki.okayama.jp/
missing: Cybertrust Japan Extended Validation Server CA