Skip to content

Instantly share code, notes, and snippets.

@oishimilk
oishimilk / rx.py
Created September 23, 2022 05:57
表示パネル移行用スクリプト
# 受け取り側 (MMD Tools 2.5.1)
with open("/tmp/panel.txt") as f:
for name in f.readlines():
C.active_object.pose.bones[name[:-1]].bone.select = True
@oishimilk
oishimilk / qt_opencv_interference.txt
Created July 9, 2021 07:36
Qt と OpenCV が干渉する
OpenCV が新しいと発生する模様
Could not load the Qt platform plugin "xcb" in 〜
※このエラーは DISPLAY 変数がおかしいときも出る模様
OpenCV 内蔵版のプラグインを読もうとして落ちる?
黙って古いバージョンを入れると直ります。
$ pip install opencv-python\<4.2
なら多分セーフです。
@oishimilk
oishimilk / capture.sh
Created June 15, 2021 15:47
動画を撮るやつ
#!/bin/sh
ffmpeg -f x11grab -video_size 1366x768 -r 30 -show_region 1 -i ${DISPLAY}+0,167 -f pulse -i default -vcodec h264_nvenc output.mp4
@oishimilk
oishimilk / concat.sh
Last active June 15, 2021 15:42
動画を繋げるやつ
#!/bin/sh
for f in uma*.mp4; do echo file $f; done | ffmpeg -protocol_whitelist file,pipe -f concat -safe 0 -r 60 -i - -vcodec h264_nvenc test_.mp4
mv progress.mp4 progress.mp4.old
ffmpeg -i test_.mp4 -stream_loop -1 -i 苦行.wav -vcodec copy -shortest progress.mp4
rm test_.mp4
@oishimilk
oishimilk / stupid_convolution.py
Last active June 15, 2021 15:45
史上最悪レベルの畳み込み
#!/usr/bin/env python
"""
生み出してしまった史上最悪レベルの畳み込みです。
できるだけスカラーを扱うようにするという制約の下で作成しています。
高速化の真逆のことをやっています。
"""
import numpy as np
try:
import tensorflow.compat.v1 as tf
except ImportError:
@oishimilk
oishimilk / xorg.conf
Created June 14, 2021 19:21
PCI のバス番号が大きい GPU から画面出力するための /etc/X11/xorg.conf
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 750 Ti"
BusID "PCI:3:0:0"
EndSection
Section "Device"
Identifier "Device1"
@oishimilk
oishimilk / focalが重い時に実行するやつ.sh
Created June 14, 2021 19:17
trackerが暴走し始めたとき用
#!/bin/bash
# 戻す時は unmask で
systemctl --user mask tracker-{extract,miner-apps,miner-fs,store,writeback}
@oishimilk
oishimilk / Dockerfile_OpenGL
Last active September 28, 2021 18:43
よく使う Dockerfile
FROM moveit/moveit:melodic-release
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
@oishimilk
oishimilk / img2eps2.sh
Created June 14, 2021 19:04
PNG を TeX の EPS2 に変えるやつ
#!/bin/bash
for f in *.png; do convert ${f} eps2:${f}.eps; done