Skip to content

Instantly share code, notes, and snippets.

@pollenjp
pollenjp / gist:cab7c26f0d38ca0440433b8f50e572b0
Created November 12, 2022 09:02 — forked from tracend/gist:912308
DirectInput keyboard scan codes
/****************************************************************************
*
* DirectInput keyboard scan codes
*
****************************************************************************/
#define DIK_ESCAPE 0x01
#define DIK_1 0x02
#define DIK_2 0x03
#define DIK_3 0x04
#define DIK_4 0x05
@pollenjp
pollenjp / 2020-07-06.txt
Last active July 7, 2020 02:55
UE4.24.3-release による Chaos サンプルプロジェクトのbuildエラー (console). クリップボードの関係で全部はコピペできていないかも.
'UE4Editor.exe' (Win32): Loaded 'D:\UE_Source\4.24Chaos\Engine\Binaries\Win64\UE4Editor.exe'. Symbols loaded.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'UE4Editor.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
@pollenjp
pollenjp / logging.conf.yml
Last active June 10, 2020 17:05
logging.conf.yml サンプル
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
version: 1
formatters:
console_formatter:
# https://docs.python.org/ja/3/howto/logging.html#logging.logging.Formatter.__init__
format: "%(asctime)s | %(name)20s | %(levelname)10s | %(threadName)8s | %(filename)20s:%(lineno)4d | %(message)s"
file_formatter:
format: "%(asctime)s | %(name)20s | %(levelname)10s | %(threadName)8s | %(filename)20s:%(lineno)4d | %(message)s"
handlers:
console_handler:
@pollenjp
pollenjp / docker-command.md
Created May 14, 2019 06:33
Dockerのコマンド備忘録 あまり使わないので忘れそうだけどたまに使うやつ

Dockerのコマンド備忘録

あまり使わないので忘れそうだけどたまに使うやつ

$ docker system df            # docker全体のディスク使用率
$ docker system df --verbose  # dockerの各imageやcontainerのディスク使用率
@pollenjp
pollenjp / multi-gpu-queue-execute.bash.sh
Last active May 9, 2019 10:19
別々の対象に対して同じスクリプトを実行したいが各実行で空いているGPUをそれぞれ割り当てていき全てのGPUを使っているときは待ち(wait)に入り空きができたら空いた箇所のGPUを割り当てる
#!/bin/bash -eux
# 別々の対象に対して同じスクリプトを実行したいが各実行で空いているGPUをそれぞれ割り当てていき全てのGPUを使っているときは
# 待ち(wait)に入り空きができたら空いた箇所のGPUを割り当てる
#!/bin/bash -eux
# [bash - What's a concise way to check that environment variables are set in a Unix shell script? - Stack Overflow](https://stackoverflow.com/a/307735/9316234)
#PCL_VERSION=1.9.1
: "${PCL_VERSION:?Need to be set. (ex: '$ PCL_VERSION=4.1.0 ./xxx.sh')}"
# 'shared' or 'static'
: "${PCL_LIBS:?Need to be set. 'static' or 'shared' (ex: '$ PCL_LIBS=shared ./xxx.sh')}"
if [ ${PCL_LIBS} == "static" ]; then
PCL_SHARED_LIBS=OFF
@pollenjp
pollenjp / convert-encoding.bash.sh
Last active May 8, 2019 00:26
エンコーディング形式の変換
#!/bin/bash -eux
# encoding形式をUTF-8(DOM無し)に変換するコード
FILES=$(find . -type f)
for FILE in ${FILES}; do
ENC=$(nkf --guess ${FILE})
# 動画等の"BINARY"ファイルには処理を行わない.
if [ "${ENC}" != "BINARY" ]; then
# この行をコメントアウトしてどのファイルがどのエンコーディングになるかを事前に確認するとよい.
nkf -Lu -d -w -w80 --in-place ${FILE}

PIDが 52626 である場合

 $ ps auxf | egrep -e "52626"
@pollenjp
pollenjp / find-command.md
Created April 21, 2019 02:41
findコマンドのよく使う用法
#!/bin/bash -eux
#for i in {1..5000}; do
# echo ${i}
#done
for i in $(seq -f "%04g" 1 5000); do
mkdir ${i}
done