Skip to content

Instantly share code, notes, and snippets.

View yuya-takeyama's full-sized avatar
🎐
Humility, Kindness, Bonds

Yuya Takeyama yuya-takeyama

🎐
Humility, Kindness, Bonds
View GitHub Profile
@yuya-takeyama
yuya-takeyama / config.yml
Last active August 29, 2015 13:55
AudioHacker introduction
pattern: "*.m4a"
input_dir:
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 1]"
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 2]"
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 3]"
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 4]"
- "/path/to/Yoichi Suzuki/Duo 3.0_Kiso [Disc 5]"
output_dir: "./out"
@yuya-takeyama
yuya-takeyama / apache_watcher.rb
Created February 10, 2014 02:04
Apache のプロセス数をリアルタイムに関しするヤツ
#!/usr/bin/env ruby
HOSTS = [] # 対象ホスト名を配列で指定
TIME_SIZE = 19
SIZE = 15
num = 0
loop do
if num == 0 then
print "|" + (" " * TIME_SIZE)
print "|"
@yuya-takeyama
yuya-takeyama / ptr_checker
Last active August 29, 2015 13:56
引数に指定した IP を逆引きして、その結果をさらに正引きするヤツ
#!/usr/bin/env ruby
# 引数に指定した IP を逆引きして、その結果をさらに正引きするヤツ
# https://gist.github.com/yuya-takeyama/8911897
# Author: Yuya Takeyama
unless ARGV[0]
puts "Usage: "
puts '$ ' + File.basename(__FILE__) + " HOST"
exit 255
end
@yuya-takeyama
yuya-takeyama / focus.rb
Last active August 29, 2015 13:56
集中
# 集中したいときに実行するやつ
BASEDIR = 'C:\WINDOWS\system32\drivers\etc'
open File.join(BASEDIR, 'hosts'), 'w' do |hosts|
hosts.puts(open(File.join(BASEDIR, 'hosts.template')).read)
hosts.puts(open(File.join(BASEDIR, 'hosts.template_to_focus')).read)
end
@yuya-takeyama
yuya-takeyama / README.md
Last active August 29, 2015 13:56
test

in PHP (composer require woothee/woothee:*)

<?php
include __DIR__ . '/vendor/autoload.php';
$classifier = \Woothee\Classifier;
$classifier->parse('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)');
// => ['name' => 'Internet Explorer', 'category' => 'pc', 'os' => 'Windows 7', 'version' => '8.0', 'vendor' => 'Microsoft']
@yuya-takeyama
yuya-takeyama / README.md
Last active August 29, 2015 13:56
mysqldump のダンプファイルをテーブル単位に分割するヤツのプロトタイプ

mysqldump のダンプファイルをテーブル単位に分割するヤツのプロトタイプ

使い方

$ ruby mysqldump_splitter.rb dumpfile [-t tables]

table.*.sql というファイルのテーブルが出力される。

@yuya-takeyama
yuya-takeyama / file0.txt
Created April 25, 2014 04:37
Linux サーバで使用している DNS の安全性をチェックするワンライナー ref: http://qiita.com/yuya_takeyama/items/a72ee65afab2c9640630
ruby -ane 'puts "Testing at #{$F[1]}...";puts `dig @#{$F[1]} +short porttest.dns-oarc.net TXT`;puts' /etc/resolv.conf
@yuya-takeyama
yuya-takeyama / crawler.ltsv
Created November 6, 2014 16:25
アクセスログからクローラだけ抽出してホストは除外してみた
time:06/Nov/2014:06:40:50 +0900 msec:1415223650.179 forwardedfor:- req:GET /page/16 HTTP/1.1 method:GET uri:/page/16 protocol:HTTP/1.1 status:200 size:17311 referer:- ua:Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) reqtime:0.365 cache:- runtime:- vhost:blog.yuyat.jp
time:06/Nov/2014:06:42:36 +0900 msec:1415223756.217 forwardedfor:- req:GET /archives/date/2010/04 HTTP/1.1 method:GET uri:/archives/date/2010/04 protocol:HTTP/1.1 status:200 size:8414 referer:- ua:Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) reqtime:0.324 cache:- runtime:- vhost:blog.yuyat.jp
time:06/Nov/2014:06:44:36 +0900 msec:1415223876.141 forwardedfor:- req:GET /archives/2177/3bb79df7183f72b5ceceb573851ee30f HTTP/1.1 method:GET uri:/archives/2177/3bb79df7183f72b5ceceb573851ee30f protocol:HTTP/1.1 status:200 size:8336 referer:- ua:Mozilla/5.0 (compatible; Baiduspider/
@yuya-takeyama
yuya-takeyama / README.md
Last active August 29, 2015 14:11
はてなフォトライフにアップロードしている写真の一括バックアップ

API 使ってやろう、とも思ったけど OAuth 認証がやたらめんどくさそうだったので断念... 登録した写真はログイン後のトップページに全て収まる程度の量だったので、その URL (http://f.hatena.ne.jp/*/) を開いた状態で、Chrome のコンソールに

Array.prototype.map.apply(document.querySelectorAll('.foto_thumb'), [function (e) { return e.src.replace('_120', ''); }])

と入力。 これで URL の一覧を JSON っぽい文字列で取得できる。