Skip to content

Instantly share code, notes, and snippets.

@kumaryu
kumaryu / rtmp-testpattern.sh
Last active September 5, 2022 14:37
ffmpegでテストパターンをRTMPサーバーに配信するコマンド
ffmpeg -re -f lavfi -i testsrc2=s=320x240 -f lavfi -i sine -c:v libx264 -g 60 -c:a libmp3lame -f flv -r 30 rtmp://localhost/live/livestream
@kumaryu
kumaryu / ngn-route.rb
Created September 24, 2017 13:55
NGNの経路情報取るやつ
require 'socket'
# 西日本はwestにしてください
sock = TCPSocket.new("route-info.flets-east.jp", 49881)
req = [
'GET /v6/route-info HTTP/1.1',
'Host: route-info.flets-east.jp:49881', # 西日本はwestにしてください
'Accept: */*',
'Accept-Charset: UTF-8',
@kumaryu
kumaryu / upnp-portmappter.rb
Last active December 27, 2015 04:47
UPnPでポート開けてみるやつ
require 'socket'
require 'set'
require 'uri'
require 'net/http'
require 'rexml/document'
SearchAddr = '239.255.255.250'
SearchPort = 1900
@kumaryu
kumaryu / MSYS2でCorradeとかいう謎のライブラリをビルドするのです.md
Last active August 29, 2015 14:25
MSYS2でCorradeとかいう謎のライブラリをビルドするのです

MSYS2でCorradeとかいう謎のライブラリをビルドするのです(MinGW64のgcc)

  • MSYS2のインストーラを落とす(http://msys2.github.io/)

  • 適当にインスコする

  • C:\msys64\bin\mingw64_shell.batを実行する

  • 以下のコマンドを入れてアップデートする

    $ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

  • 一旦ウィンドウを閉じてもっかい起動する(←これ大事)

@kumaryu
kumaryu / msys2-clang.md
Last active August 29, 2015 14:25
MSYS2でclang(64bit版)

MSYS2でclang(64bit版)

  • MSYS2のインストーラを落とす(http://msys2.github.io/)

  • 適当にインスコする

  • C:\msys64\bin\mingw64_shell.batを実行する

  • 以下のコマンドを入れてアップデートする

    $ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

  • 一旦ウィンドウを閉じてもっかい起動する(←これ大事)

  • 以下のコマンドでその他の物をアップデートする

@kumaryu
kumaryu / beziertess.rb
Created November 7, 2014 17:25
IronRubyとOpenTKを使ってOpenGL4.0のテッセレーションで文字を描く
#coding: utf-8
# IronRubyで実行してください(http://ironruby.net/)
# OpenTKが必要です(http://www.opentk.com/)
# OpenTK.dllとOpenTK.dll.configを読み込めるディレクトリに置いて実行してください
# OpenGL4.0以降が使えるGPUが必要です
#
# ESCで終了
# 上下キーで長さごとの分割数を増減
# 左右キーで曲がり具合による分割数を増減
#
@kumaryu
kumaryu / mmbenchmark.rb
Last active August 29, 2015 13:56
Ruby micro micro benchmark
#!ruby -W0
require 'rbconfig'
class Benchmark
def self.benchmark(tries=10, &block)
self.new.benchmark(tries, &block)
end
def initialize
@counts = {}
@kumaryu
kumaryu / main.fs
Created November 17, 2013 11:43
ぬめろんAIのソース
let numbers = ["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"]
type NumeronAI (number, potential_list) =
static let rand = new System.Random()
static let rec permutations count source =
if count = 0 then
[[]]
else
match source with