Skip to content

Instantly share code, notes, and snippets.

View Mahito's full-sized avatar

Mahito Mahito

View GitHub Profile
@Mahito
Mahito / pumba-ab-manifest.yml
Created April 10, 2019 02:36
Apache Benchのデプロイ用マニフェスト
apiVersion: apps/v1
kind: Deployment
metadata:
name: pumba-ab-delay
namespace: pumba
labels:
app: pumba-ab-delay
spec:
replicas: 1
selector:
@Mahito
Mahito / pumba-ab-manifest.yml
Created April 10, 2019 02:36
Apache Benchのデプロイ用マニフェスト
apiVersion: apps/v1
kind: Deployment
metadata:
name: pumba-ab-delay
namespace: pumba
labels:
app: pumba-ab-delay
spec:
replicas: 1
selector:
@Mahito
Mahito / invite_all_members.rb
Created December 21, 2018 02:19
`invite all members to [channel name] for [topic]` でチャンネルを作ってトピックを設定して全メンバをチャンネルに入れるBOTのコード
require 'slack-ruby-client'
Slack::Web::Client.configure do |config|
config.token = ENV['SLACK_API_USER_TOKEN']
raise 'Missing ENV[SLACK_API_USER_TOKEN]!' unless config.token
STDOUT.sync = true
config.logger = Logger.new(STDOUT)
config.logger.level = Logger::INFO
@Mahito
Mahito / restaurant.md
Last active March 5, 2018 09:29
田町駅近辺の個室かつプロジェクタが使えそうなお店
@Mahito
Mahito / docker-compose.yml
Created October 10, 2017 07:16
jaegertracing/all-in-one:latest
version: '2'
services:
jaeger_ui:
image: jaegertracing/all-in-one:latest
ports:
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
version: '2'
services:
nginx:
image: nginx
ports:
- 80:80
depends_on:
- redmine
@Mahito
Mahito / docker-compose.yml
Created March 30, 2017 08:38
RabbitMQ monitoring with Prometheus and Grafana
version: '2'
services:
rabbitmq:
image: rabbitmq:3.6.4-management
hostname: rabbitmq
expose:
- "9090"
ports:
- "4369:4369"
- "5671:5671"
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
return self.func(req, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/oslo_middleware/base.py", line 114, in __call__
response = req.get_response(self.application)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1317, in send
@Mahito
Mahito / hadoop_spec.rb
Created August 12, 2014 08:13
Serverspec to xml file
require 'serverspec'
require 'nokogiri'
describe file('/etc/hadoop/hadoop-0.20.2/conf/mapred-site.xml') do
it { should be_file }
it do
doc = Nokogiri::Slop(subject.content)
doc.configuration.each do |property|
case property.name.content
when 'mapred.child.java.opts'
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
print '\n{0}:\n{1}'.format(field, res[field])
class CallbackModule(object):