This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/https' | |
https = Net::HTTP.new('google.com',443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
https.start { | |
puts https.peer_cert.not_after.class | |
puts https.peer_cert.not_after | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Capistranoのデプロイ時にコンフィグを作成する、作成元は "*.sample"ファイル | |
# | |
# 各環境用の設定を上書きした後、キー及びバリューのクラス、階層を元のsampleと比較し、 | |
# 文字・数字の区別がついていることなどを確認する。 | |
# | |
# TODO:Capistranoのモジュールにしたい | |
require 'yaml' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -l | |
# rvm get latest && rvm reload #<< current rvm older than 1.10 | |
useradd -d /opt/fluentd --system -c fluentd -s /usr/sbin/nologin --user-group fluent | |
rvm get stable | |
mkdir -p /opt/fluentd | |
cd /opt/fluentd | |
rvm install ruby-1.9.3-p194 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
vmbox = "precise64" | |
vmboxurl = "http://files.vagrantup.com/precise64.box" | |
gluster_repo = "http://download.gluster.org/pub/gluster/glusterfs/LATEST/Ubuntu/12.04/glusterfs_3.3.0-1_amd64.deb" | |
gluster_file = "glusterfs_3.3.0-1_amd64.deb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prompt = function() { | |
// set version | |
version = db.version(); | |
// case mongos | |
if (rs.status().info == 'mongos') { | |
return rs.status().info + ':[' + version + '] > '; | |
} | |
// config or replica |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _out(k,hash) | |
hash.each_pair do |k2,v2| | |
str = [k,"['#{k2}']"].join | |
ha = {str => v2} | |
out ha | |
end | |
end | |
def out(hash) | |
hash.each_pair do |k,v| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'faraday' | |
class MonitReports | |
def initialize(mmonit = "http://127.0.0.1:8080") | |
@connection = Faraday.new(:url => mmonit) | |
res = @connection.get "/index.csp" | |
@cookie = res.headers['set-cookie'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# | |
# Provides SmartMachine summary of information. | |
# Joyent 2012. | |
# JSON OPTION Author: github_id:sawanoboly | |
PATH="/opt/local/bin:/opt/local/gnu/bin:/opt/local/sbin:/usr/bin:/usr/sbin"; | |
JSON=0 | |
OPT= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
## for dataset 'hadoop' 1.0.0 | |
set -e | |
## httpfs build | |
pkgin -y install apache-mavenpkgin -y install scmgit | |
pkgin -y install sun-jdk6 | |
ln -s /opt/local/java/sun6/lib /opt/local/java/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# REPLACE APP_REPO and APP_NAME | |
set -e | |
set -x | |
export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin | |
MDATA_WRAPPER=001 |