Skip to content

Instantly share code, notes, and snippets.

View riywo's full-sized avatar
🏈
Go 49ers!

Ryosuke Iwanaga riywo

🏈
Go 49ers!
View GitHub Profile
Host i-*
GSSAPIAuthentication no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
IdentityFile ~/.ssh/id_rsa
ProxyCommand sh -c 'aws ec2-instance-connect send-ssh-public-key --instance-id %h --instance-os-user %r --ssh-public-key file://~/.ssh/id_rsa.pub && exec aws ec2-instance-connect open-tunnel --instance-id %h'
@riywo
riywo / gist:5023060
Created February 24, 2013 07:58
Join mp3 files with homebrew
$ brew install -v mp3wrap ffmpeg id3lib
$ mp3wrap tmp.mp3 1.mp3 2.mp3 3.mp3 ....
$ ffmpeg -i tmp_MP3WRAP.mp3 -acodec copy all.mp3 && rm tmp_MP3WRAP.mp3
$ id3cp 1.mp3 all.mp3
@riywo
riywo / reference.md
Last active May 12, 2021 05:37
gdbとかassemblyのアンチョコ

2進数

  • 0xXX
    • 1 byte = 16進数2桁 = 8 bit
  • 0xXXXXXXXX
    • 4 byte = 16進数8桁 = 32 bit
    • int
  • 0xYYYYYYYYXXXXXXXX
    • 8 byte = 16進数16桁 = 64 bit
    • long int
@riywo
riywo / gist:870515
Created March 15, 2011 09:46
GNU parallel使って並列でrsyncする&ちゃんとmkdirする
find /path/to/dir/ -type f | time parallel --eta 'rsync -aRz --compress-level=1 {} remote:/'
@riywo
riywo / gist:874011
Created March 17, 2011 08:37
bashでパイプとかでつないでバッファされちゃう時

tail -fみたいに流しながら見たいんだけど、色んなコマンドが出力をバッファしちゃうので、困ったときはそのコマンドにバッファしないオプションが無いか探すのがオヌヌメ。 man command -> bufferとかで検索

grep

   --line-buffered
          Use line buffering, it can be a performance penality.

$ iostat -x 1 | grep --line-buffered 'sda'

awk

$ ./runsample open foo.db
COMMAND: scan
START KEY: {"name": "bar", "timestamp": 0}
END KEY: {"name": "foo", "timestamp": 100}
{"name": "bar", "timestamp": 1} {"value": "bbb"}
{"name": "bar", "timestamp": 10} {"value": "bbb"}
{"name": "foo", "timestamp": 1} {"value": "bbb"}
{"name": "foo", "timestamp": 10} {"value": "bbb"}
declare i32 @putchar(i32)
declare i8* @gets(i8* nocapture) nounwind
declare i32 @strcmp(i8*, i8*) nounwind
%node = type{ %node*, i8*, i32 }
@foo.key = private constant [4 x i8] c"foo\00"
@foo = private constant %node {
%node* @bar,
i8* getelementptr([4 x i8], [4 x i8]* @foo.key, i32 0, i32 0),
declare i32 @putchar(i32)
@xt_A = private constant i8* blockaddress(@main, %i_A)
@xt_B = private constant i8* blockaddress(@main, %i_B)
@xt_exit = private constant i8* blockaddress(@main, %i_exit)
@code = private constant [5 x i8**] [
i8** @xt_A,
i8** @xt_B,
i8** @xt_A,
declare i32 @putchar(i32)
@code = private constant [5 x i8*] [
i8* blockaddress(@main, %A),
i8* blockaddress(@main, %B),
i8* blockaddress(@main, %A),
i8* blockaddress(@main, %B),
i8* blockaddress(@main, %exit)
]
cmake_minimum_required(VERSION 3.10)
project(myproject)
set(CMAKE_CXX_STANDARD 14)
find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})