Skip to content

Instantly share code, notes, and snippets.

@autch
autch / for-cpi.patch
Created February 20, 2019 10:49
P/EMU/SDL を GameShell で動くようにするパッチ
diff --git a/app.h b/app.h
index 423adb9..d1ea127 100644
--- a/app.h
+++ b/app.h
@@ -77,10 +77,11 @@ struct tagPIEMU_CONTEXT;
#define KEY_DOWN SDL_SCANCODE_DOWN
#define KEY_LEFT SDL_SCANCODE_LEFT
#define KEY_RIGHT SDL_SCANCODE_RIGHT
-#define KEY_A SDL_SCANCODE_Z
-#define KEY_B SDL_SCANCODE_X
@autch
autch / gist:44aa83a582f4a97552279547c8f43d20
Created November 30, 2018 18:24
BS の M2TS を CUVID/NVENC で deinterlace 付きでトランスコード
ffmpeg -hwaccel cuvid -c:v mpeg2_cuvid -deint 2 -drop_second_field 1 -i V:\[181007-0130][BSBS9_0]ゴブリンスレイ ヤー.m2ts -r 59.94 -c:v h264_nvenc -threads 8 -c:a copy -bsf:a aac_adtstoasc -movflags +faststart gs1.di.m4v
@autch
autch / Dockerfile
Created July 16, 2018 07:29
distcc サーバを Docker で建てる
FROM debian:stretch
RUN apt-get update && \
apt-get install -y build-essential gcc make distcc ccache && \
apt-get clean && \
rm -rf /var/lib/apt/lists
EXPOSE 3632
CMD ["/usr/bin/distccd", "--allow", "0.0.0.0/0", "--daemon", "--no-detach", "--log-stderr"]
@autch
autch / ys8dec.cpp
Last active February 2, 2019 17:15
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <iterator>
int main(int ac, char** av)
{
if(ac < 2) {
std::cerr << "Usage: " << *av << " *.ogg..." << std::endl;
@autch
autch / taginfo.tag
Created March 3, 2018 17:15
P/ECE 開発環境付属音楽データの KbMedia Player 用タグファイル
[C523.pmd]
Title=Beginning
Artist=米村高広
Album=Black Wings
[c526.pmd]
Title=Black Wings
Artist=米村高広
Album=Black Wings
@autch
autch / gen-ystaginfo.rb
Created February 28, 2018 06:26
Ys I/II Complete のループ wav を KbMedia Player でループ再生させるためにタグ情報を生成する
ARGV.each do |filename|
File.open(filename, 'rb') do |f|
musname = File.basename(filename, '.POS') + '.m4a'
start, end_pos = f.read(8).unpack('VV')
printf("[%s]\n", musname)
printf("LOOPSTART=%d\n", start)
printf("LOOPLENGTH=%d\n", end_pos - start)
puts
@autch
autch / USASGA.pmml
Last active May 1, 2018 09:18
"STAGE 5 -MOHENJO DARO-" from Treasure of USAS (Konami, 1987) for P/ECE
#Title ウシャス MOHENJO DARO (STAGE 5) 【楽】
#Title2 (C)KONAMI 1987/WAIENDEE 1991/arr: Autch 2018
!bg @6 V125 ; bass drum
!Sg @8 V125 ; snare drum 1
!sg @7 V125 ; snare drum 2
!og @9 V100 ; open H.H.
!hg @10 V120 ; closeH.H.
!cg @11 V125 ; crush cymbal
!tg @13 V125 ; synth tom (hi)
@autch
autch / dec_hls.py
Created April 8, 2017 18:39
Decrypt AES-encoded HLS streams
#!/usr/bin/env python3
from __future__ import print_function
import argparse
from Crypto.Cipher import AES
READ_AT_ONCE = 1 << 16
ap = argparse.ArgumentParser()
@autch
autch / webcam_capture.320.sh
Last active February 17, 2017 09:59
Recording webcam video by Raspberry Pi, using HW-accel. H.264 encoder
#!/bin/sh
gst-launch-1.0 -qe v4l2src ! \
videorate ! \
video/x-raw,width=320,height=240,framerate=30/1 ! \
clockoverlay time-format="%m/%d %H:%M:%S" shaded-background=true font-desc="Sans 24px" ! \
omxh264enc target-bitrate=320000 control-rate=variable ! \
video/x-h264,profile=baseline ! \
h264parse ! \
mp4mux ! \
@autch
autch / wol.c
Last active May 13, 2021 02:06
Wake-On-LAN, Usage: ./wol.rb 192.168.0.255 01:23:45:67:89:ab
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>