Skip to content

Instantly share code, notes, and snippets.

Avatar

Eshin Kunishima mikoim

View GitHub Profile
@mikoim
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-5.2.4.4
106709156 other
104717077 bootsnap-1.5.1
80443139 http-4.4.1
71043385 addressable-2.7.0
@mikoim
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
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
# github.com currently has not supported Ed25519.
HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,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
mikoim / Sennheiser_MOMENTUM_True_Wireless_2_Linux.md
Last active Jul 29, 2020
Sennheiser MOMENTUM True Wireless 2 on Linux with BlueZ 5 and PulseAudio
View Sennheiser_MOMENTUM_True_Wireless_2_Linux.md

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
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
mikoim / firefox-inside-docker.md
Last active Jan 9, 2020
How to avoid "Bus error (core dumped)" when you run Firefox inside Docker container
View firefox-inside-docker.md

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

firefox -headless -screenshot https://developer.mozilla.com
*** You are running in headless mode.
ExceptionHandler::GenerateDump cloned child ExceptionHandler::WaitForContinueSignal waiting for continue signal...
1218
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
Unable to init server: Could not connect: Connection refused
Bus error (core dumped)
@mikoim
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
mikoim / README.md
Last active Sep 19, 2020
WireGuard example configuration for VPN
View README.md

Server

iptables -A FORWARD -i wg0 -o YOUR_INTERFACE -s 10.200.200.0/24 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o YOUR_INTERFACE -s 10.200.200.0/24 -j MASQUERADE

systemd-networkd

see vpn.netdev and vpn.network.

@mikoim
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
URL: https://github.com/google/mozc
@mikoim
mikoim / fcitx4.sh
Created Sep 29, 2018
Install latest fcitx4 on Fedora 28 from source
View fcitx4.sh
#!/bin/bash
# This script does not install dependencies. You must install them before continuing.
# ref. https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/fcitx
cd $BUILD_DIR
wget https://download.fcitx-im.org/fcitx/fcitx-4.2.9.6.tar.xz
wget https://download.fcitx-im.org/fcitx/fcitx-4.2.9.6_dict.tar.xz
wget https://download.fcitx-im.org/fcitx-configtool/fcitx-configtool-0.4.10.tar.xz