Skip to content

Instantly share code, notes, and snippets.

View mikoim's full-sized avatar

Eshin Kunishima mikoim

View GitHub Profile
@mikoim
mikoim / README.md
Last active April 6, 2024 17:34
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@mikoim
mikoim / with-footprints-filter.js
Created December 24, 2023 17:15
卒業したwithのスクリプト群 足あとフィルター(年齢・住所), プロフィール文を選択可能にする
// ==UserScript==
// @name with 足あとフィルター
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://with.is/mypages/footprints
// @match https://with.is/mypages/footprints?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=with.is
// @grant none
@mikoim
mikoim / ginnan.js
Last active November 30, 2023 16:45
Remove sold out items from 夢ふうりん / Let's shopping!
Array.prototype.forEach.call(document.querySelectorAll('img[src$="../tsk/soldout.gif"], img[src$="soldout.gif"]'), function (el, i) {
el.closest('tr').remove();
});
@mikoim
mikoim / README.md
Last active November 27, 2023 09:22
WireGuard example configuration for VPN

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 / Sennheiser_MOMENTUM_True_Wireless_2_Linux.md
Last active October 26, 2023 15:18
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
mikoim / nginx.conf
Created October 28, 2016 21:22
Split RTMP Stream with nginx-rtmp-module
worker_processes 1;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 8192;
@mikoim
mikoim / 7dtd.service
Last active December 2, 2022 14:06
systemd service
[Unit]
Description=7 Days to Die
After=network.target
[Service]
User=steam
Group=steam
Type=simple
WorkingDirectory=/home/steam/7dtd
ExecStart=/home/steam/7dtd/startserver.sh -configfile=serverconfig.xml
@mikoim
mikoim / demo.py
Created October 17, 2021 19:05
Retrieve Ethereum address from private key with web3.py
from web3.auto 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)
print(address)
@mikoim
mikoim / gist:4fca4b4ce75de2ab9d3a8277be60812e
Created January 11, 2021 17:41
mastodon 3.3.0 sidekiq memory profiling
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 / daemon.conf
Last active November 30, 2020 01:20
SONY TA-ZH1ES, Kernel 5.8.18-200.fc32.x86_64, pulseaudio 13.99.1-rebootstrapped
# ~/.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.