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 -*- | |
| require 'json' | |
| require 'net/http' | |
| require 'uri' | |
| def post_to_elasticsearch(json, id) | |
| uri = "http://xxx.xxx.xxx.xxx:9200/.kibana/visualization/#{id}" | |
| uri = URI.parse(uri) | |
| http = Net::HTTP.new(uri.host, uri.port) |
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 -*- | |
| require 'json' | |
| require 'net/http' | |
| require 'uri' | |
| def post_to_elasticsearch(json, id) | |
| uri = "http://xxx.xxx.xxx.xxx:9200/.kibana/search/#{id}" | |
| uri = URI.parse(uri) | |
| http = Net::HTTP.new(uri.host, uri.port) |
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
| users: | |
| - default | |
| disable_root: 1 | |
| ssh_pwauth: 0 | |
| locale_configfile: /etc/sysconfig/i18n | |
| mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2'] | |
| resize_rootfs_tmp: /dev | |
| ssh_deletekeys: 0 |
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
| /* | |
| (snip) | |
| */ | |
| import java.util.List; | |
| import java.util.Map.Entry; | |
| import com.amazonaws.AmazonClientException; | |
| import com.amazonaws.AmazonServiceException; | |
| import com.amazonaws.auth.AWSCredentials; | |
| import com.amazonaws.auth.profile.ProfileCredentialsProvider; |
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 python | |
| import json, urllib2, sys, time, random | |
| argvs = sys.argv | |
| cities = argvs[1].split(",") | |
| timestamp = int(time.time()) | |
| def temperature_humidity_index(): |
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
| service mysqlchk_read01 | |
| { | |
| flags = REUSE | |
| socket_type = stream | |
| port = 33061 | |
| wait = no | |
| user = nobody | |
| server = /opt/bin/mysqlchk_slave.sh | |
| server_args = hogehoge-replica01.xxxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com | |
| log_on_failure += USERID |
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
| #!/bin/bash | |
| MYSQL_HOST="$1" | |
| MYSQL_PORT="3306" | |
| MYSQL_USERNAME="your_user" | |
| MYSQL_PASSWORD="your_pass" | |
| MSG=`/usr/bin/mysql --connect_timeout=1 -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u${MYSQL_USERNAME} -p${MYSQL_PASSWORD} -e 'show status like "Slave_running"' | awk '{print $2}'` | |
| if [ "$MSG" = "2" ] |
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
| #!/bin/bash | |
| MYSQL_HOST="$1" | |
| MYSQL_PORT="3306" | |
| MYSQL_USERNAME="your_user" | |
| MYSQL_PASSWORD="your_pass" | |
| MSG=`/usr/bin/mysql --connect_timeout=1 -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u${MYSQL_USERNAME} -p${MYSQL_PASSWORD} -e "show slave status\G" | grep Running | grep Yes | wc -l` | |
| if [ "$MSG" = "2" ] |
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 | |
| require "csv" | |
| require 'json' | |
| require 'net/http' | |
| #CSV.open("data/201507.csv", encoding: "Shift_JIS:UTF-8") do |f| | |
| # f.each_with_index do |item, i| | |
| # next if i == 0 | |
| # p item |
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 python | |
| import json, urllib2, sys, base64, time, datetime | |
| # check nodes | |
| node_url = 'http://127.0.0.1:8500/v1/catalog/nodes' | |
| r = urllib2.urlopen(node_url) | |
| j = json.loads(r.read()) | |
| nodes = [] | |
| for attr in j: |