This file contains 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
{ | |
"client": { | |
"name": "web01", | |
"address": "192.168.1.101", | |
"subscriptions": [ | |
"common", | |
"web" | |
] | |
}, | |
"keepalive": { |
This file contains 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
{ | |
"checks": { | |
"snmpd_proc": { | |
"handlers":["mailer"], | |
"command": "/etc/sensu/plugins/check-procs.rb -p snmpd -C 0 -W 1 ", | |
"subscribers": [ | |
"common" | |
], | |
"interval": 180, | |
"occurrences": 2, |
This file contains 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
rm -rf /data/storage-* | |
mkdir -p /data/bench/logs | |
cd /data/bench | |
cat <<'EOF' > ./dd.sh | |
#!/bin/sh | |
for i in {1..300}; do | |
echo ID: $$ PASS: $i | |
date |
This file contains 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
// NTTコムのcloudnのオブジェクトストレージをscalaから使うサンプル | |
// S3互換があるので、AWSのjava-sdkが使えた。 | |
// | |
// 参考... | |
// SDK API: http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/index.html | |
// Developers IO: http://dev.classmethod.jp/cloud/aws-s3/ | |
import com.amazonaws._ | |
import com.amazonaws.auth._ | |
import com.amazonaws.services.s3.AmazonS3 |
This file contains 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
from sqlalchemy import create_engine, Column, ForeignKey | |
from sqlalchemy.dialects.mysql import ( | |
INTEGER, | |
VARCHAR, | |
TINYINT, | |
) | |
from sqlalchemy.orm import sessionmaker, relation | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() |
This file contains 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
package main | |
import ( | |
"log" | |
"net/http" | |
//"io/ioutil" | |
) | |
func get(url string, c chan bool){ | |
resp, err := http.Get(url) |
This file contains 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 'rake' | |
require 'rspec/core/rake_task' | |
require 'yaml' | |
require 'highline/import' | |
properties = YAML.load_file('properties.yaml') | |
ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true } | |
ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false } |
This file contains 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 python | |
#-*- coding: utf-8 -*- | |
import pycontrol.pycontrol as pc | |
import os | |
host = 'xxx.xxx.xxx.xxx' | |
user = 'xxxxxx' | |
password = 'xxxxxx' |
This file contains 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
--- spec_helper.rb.org 2013-11-04 19:21:50.000000000 +0900 | |
+++ spec_helper.rb 2013-11-04 23:01:26.000000000 +0900 | |
@@ -6,12 +6,9 @@ | |
include Serverspec::Helper::DetectOS | |
RSpec.configure do |c| | |
- if ENV['ASK_SUDO_PASSWORD'] | |
- require 'highline/import' | |
- c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } | |
- else |
This file contains 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
import functools | |
def ore(func): | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
print "@ore : oreoreoreoreore" | |
return func(*args, **kwargs) | |
return wrapper | |
def plus(x, y): |