Skip to content

Instantly share code, notes, and snippets.


Eshin Kunishima mikoim

View GitHub Profile
mikoim /
Created Oct 17, 2021
Retrieve Ethereum address from private key with
from import w3
from eth_account.messages import encode_defunct
message = encode_defunct(text='')
signed_message = w3.eth.account.sign_message(message, private_key='0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80') # Hardhat
address = w3.eth.account.recover_message(message, signature=signed_message.signature)
mikoim / gist:4fca4b4ce75de2ab9d3a8277be60812e
Created Jan 11, 2021
mastodon 3.3.0 sidekiq memory profiling
View gist:4fca4b4ce75de2ab9d3a8277be60812e
Total allocated: 898218489 bytes (8619312 objects)
Total retained: 51743915 bytes (371827 objects)
allocated memory by gem
108927024 activerecord-
106709156 other
104717077 bootsnap-1.5.1
80443139 http-4.4.1
71043385 addressable-2.7.0
mikoim / ssh_config
Last active Nov 23, 2020
Hardened OpenSSH_8.3p1 settings
View ssh_config
# OpenSSH_8.3p1, OpenSSL 1.1.1g FIPS 21 Apr 2020
# HashKnownHosts yes
# currently has not supported Ed25519.
HostKeyAlgorithms ssh-ed25519,,,,rsa-sha2-512
KexAlgorithms curve25519-sha256,,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512
View gist:d385b12861b284e6afbf0c35118f454f
[foobar@sushi zfs]$ make -j1
GEN gitrev
make all-recursive
make[1]: Entering directory '/home/foobar/src/zfs'
Making all in include
make[2]: Entering directory '/home/foobar/src/zfs/include'
Making all in sys
make[3]: Entering directory '/home/foobar/src/zfs/include/sys'
Making all in fm
make[4]: Entering directory '/home/foobar/src/zfs/include/sys/fm'
mikoim /
Last active Aug 17, 2021
Sennheiser MOMENTUM True Wireless 2 on Linux with BlueZ 5 and PulseAudio

Sennheiser MOMENTUM True Wireless 2 on Linux with BlueZ 5 and PulseAudio

Unfortunately, it does not work as out of box. After applying following workarounds, finally, it works.

  • Fedora 32 x86_64
  • Linux kernel 5.7.10 vanilla
  • PulseAudio 13.99 + pulseaudio-module-bluetooth-freeworld (for proprietary codecs aptX)
  • BlueZ 5.54


mikoim / daemon.conf
Last active Nov 30, 2020
SONY TA-ZH1ES, Kernel 5.8.18-200.fc32.x86_64, pulseaudio 13.99.1-rebootstrapped
View daemon.conf
# ~/.config/pulse/daemon.conf
default-sample-format = float32le
default-sample-rate = 96000
avoid-resampling = yes
resample-method = soxr-vhq
# default-sample-rate = 384000
# -> unstable, sometimes pulseaudio could not play sound.
mikoim /
Last active Jan 9, 2020
How to avoid "Bus error (core dumped)" when you run Firefox inside Docker container

I met "Bus error (core dumped)" when I run Firefox with Selenium to capture screenshot of web sites.

firefox -headless -screenshot
*** You are running in headless mode.
ExceptionHandler::GenerateDump cloned child ExceptionHandler::WaitForContinueSignal waiting for continue signal...
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
Unable to init server: Could not connect: Connection refused
Bus error (core dumped)
mikoim / build.log
Created Nov 9, 2019
Clear Linux OS 31530
View build.log
Mock Version: 1.4.21
ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python2-marisa.spec'], chrootPath='/var/lib/mock/clear-python2-marisa/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8', 'CCACHE_DIR': '/var/tmp/ccache', 'CCACHE_UMASK': '002'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7f6fbee291d0>timeout=0uid=1000gid=1000user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.qvk0c2d8:/etc/resolv.conf']unshare_net=TrueprintOutput=False)
Using nspawn with args ['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.qvk0c2d8:/etc/resolv.conf']
Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '1e54c0d33e0241f59c19218ab916c646', '-D', '/var/lib/mock/clear-python2-marisa/root', '-a', '--capa
mikoim /
Last active Nov 25, 2021
WireGuard example configuration for VPN


iptables -A FORWARD -i wg0 -o YOUR_INTERFACE -s -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT


see vpn.netdev and

mikoim / mozc.spec
Created May 3, 2019
spec file for building mozc ut2 package
View mozc.spec
%global pkg mozc
%undefine _hardened_build
Name: mozc
Version: 2.23.2815.102
Release: 2%{?dist}
Summary: A Japanese Input Method Editor (IME) designed for multi-platform
License: BSD and ASL 2.0 and UCD and Public Domain and mecab-ipadic