Skip to content

Instantly share code, notes, and snippets.

mikoim

Block or report user

Report or block mikoim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 Aug 30, 2019
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
@mikoim
mikoim / alacritty-wrong-font-width-workaround.patch
Last active Jan 12, 2018
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.
View alacritty-wrong-font-width-workaround.patch
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;
@mikoim
mikoim / default.pa
Created Oct 18, 2017
Roland QUAD-CAPTURE UA-55 on Linux (PulseAudio)
View default.pa
#### 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 / optimize.sh
Created Oct 5, 2017
Optimize all png files in history of repository with "git filter-branch" command
View optimize.sh
#!/bin/sh
FILENAME="$1"
HASH=$(md5sum "${FILENAME}")
HIT=$(grep -c "${HASH}" /tmp/hash.txt)
echo "${FILENAME}"
if [ "${HIT}" -eq 0 ];then
optipng -o7 -clobber "${FILENAME}"
View conoha_vps_2GB.txt
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 3
On-line CPU(s) list: 0-2
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 3
NUMA node(s): 1
You can’t perform that action at this time.