Skip to content

Instantly share code, notes, and snippets.

View mikoim's full-sized avatar

Eshin Kunishima mikoim

View GitHub Profile
@mikoim
mikoim / ssh_config
Last active November 23, 2020 15:33
Hardened OpenSSH_8.3p1 settings
# 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
[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 / firefox-inside-docker.md
Last active January 9, 2020 10:22
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 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 November 9, 2019 14:59
Clear Linux OS 31530
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 / mozc.spec
Created May 3, 2019 09:47
spec file for building mozc ut2 package
%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 / apt-get.log
Created September 17, 2015 04:27
How to fix td-agent installation error
The following NEW packages will be installed:
td-agent
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/59.2 MB of archives.
After this operation, 211 MB of additional disk space will be used.
Selecting previously unselected package td-agent.
(Reading database ... 94733 files and directories currently installed.)
Preparing to unpack .../td-agent_2.2.1-0_amd64.deb ...
Unpacking td-agent (2.2.1-0) ...
Setting up td-agent (2.2.1-0) ...
@mikoim
mikoim / fcitx4.sh
Created September 29, 2018 07:38
Install latest fcitx4 on Fedora 28 from source
#!/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
@mikoim
mikoim / layout_override
Created September 29, 2018 06:37
fcitx5 + mozc
default,us
mozc,us
@mikoim
mikoim / default.pa
Created October 18, 2017 15:24
Roland QUAD-CAPTURE UA-55 on Linux (PulseAudio)
#### Roland QUAD-CAPTURE UA-55
# Audio input is fucking unstable, it causes kernel to crash at least in my environment.
## OUTPUT1 (headphones)
load-module module-remap-sink sink_name=output1 remix=yes master=alsa_output.usb-Roland_QUAD-CAPTURE_000085D917665F98C210A52B1B8484F8-00.analog-surround-40 channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right
## OUTPUT2
load-module module-remap-sink sink_name=output2 remix=yes master=alsa_output.usb-Roland_QUAD-CAPTURE_000085D917665F98C210A52B1B8484F8-00.analog-surround-40 channels=2 master_channel_map=rear-left,rear-right channel_map=front-left,front-right
####
@mikoim
mikoim / alacritty-wrong-font-width-workaround.patch
Last active January 12, 2018 11:56
Alacritty calculates the cell width from maximum advance via freetype2. But its value is too wide with some font. So this patch makes it use the average of rasterized glyph width instead of maximum advance.
diff --git a/src/display.rs b/src/display.rs
index 14c5a66..a5a8980 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -239,7 +239,7 @@ impl Display {
// font metrics should be computed before creating the window in the first
// place so that a resize is not needed.
let metrics = glyph_cache.font_metrics();
- let cell_width = (metrics.average_advance + font.offset().x as f64) as u32;
+ let cell_width = (glyph_cache.true_average_width() + font.offset().x as f64) as u32;