Skip to content

Instantly share code, notes, and snippets.

View k-oguma's full-sized avatar
:octocat:
( ̄(工) ̄)

oguma k-oguma

:octocat:
( ̄(工) ̄)
View GitHub Profile
@k-oguma
k-oguma / math.py
Created March 11, 2016 10:27
Pythonで計算
# -*- coding: utf-8 -*-
# 3/8 と3/5の数値を * 7掛けして表示させる
# 合計を出す
# 平均値を出す
access_num = { '3/8': 1028, '3/5': 1542}
avg = 0
sum = 0
num = 7
@k-oguma
k-oguma / sample-Vagrantfile
Last active December 22, 2016 07:46
Sample Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# サンプルです。このままでは動かないところがあります。
require 'net/http'
VAGRANTFILE_API_VERSION = "2"
@vb_gui = false
@vb_memory = 2048
@vb_cpus = 1
@k-oguma
k-oguma / ansible_init-role
Last active January 30, 2017 10:08
Ansibleでplaybooks整理: custom role path を使う場合のgroup_vars, host_vars の自動読み込みtask の一部抜粋 (https://github.com/aim-oguma/ansible-init-for-integrated/blob/master/tasks/main.yml)
---
- name: Ansible version check
command: ansible --version
register: ansible_version
delegate_to: 127.0.0.1
changed_when: False
- block:
- name: Read group_vars and host_vars. In addition, add the secret files.
include_vars: ../{{ item.group_or_host }}_vars/{{ item.type }}.yml
@k-oguma
k-oguma / dns-bench1.sh
Created February 3, 2017 07:42
DNS Benchmark (Child forks + Parallel support)
#!/bin/sh
set -m
hostname="ns1"
domain="example.local"
target_dns="dns-unbound01"
query_count=3
forks=200
@k-oguma
k-oguma / ping_lan_and_ext.groovy
Created April 27, 2017 10:36
[Groovy] Ping to LAN and external
// arpで拾ってきたIPと外部へ疎通確認を行います
// 調整なしのJenkins master で スクリプトコンソールから実行すると Timeout するかも
def arp = "arp -a".execute().text
ArrayList queue = ['\\? \\(','\\).*']
String ext_target = "example.com"
for ( i in queue) {
arp = arp.replaceAll(/${i}/, '')
}
@k-oguma
k-oguma / webops_policies.md
Last active August 27, 2017 12:35
[WebOps] 問題調査方法や構築時の注意点と方針

[WebOps] 問題調査方法や構築時の注意点と方針

お客様から「ウェブページが表示されない」と問い合わせがあった場合

調査の概要

  1. 必要な情報を得られるだけ得る
    • トレーサビリティは高めておく (事前準備も可能な限りしておく)
  2. Web/Appおよびインフラ調査
@k-oguma
k-oguma / README_create.rb
Created October 20, 2017 03:41
If there is no README, this makes the template.
README = 'README.md'
unless File.exist? README
puts 'Not found README file'
puts "Creating #{README}"
print = <<-EOS.gsub(/^ {,4}/, "## ").gsub(/\n/, "\n\n\n")
Synopsis
Requirements
Notice
Code Example
Installation
@k-oguma
k-oguma / enable_dnsmasq_on_osx.sh
Created November 28, 2017 14:11 — forked from r10r/enable_dnsmasq_on_osx.sh
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/vbox'
# aws-IAM-STS.sh
## Description
This tool is AWS STS (AWS Security Token Service) Wrapper for safety accesss control.
Example, developmnent or test access.
By using this, it becomes possible to test safely,
for example by wrapping the local development environment at the weak IAM authority.
[AWS-Doc/STS/ja-JP](http://docs.aws.amazon.com/ja_jp/IAM/latest/UserGuide/id_credentials_temp.html)
@k-oguma
k-oguma / KSK-rollover-pre-checker.md
Created October 10, 2018 08:50
DNS: KSK Rollover pre-checker

Base

Confirm enabled of the DNSSEC validation

dig dnssec-failed.org a +noall +dnssec +comments

If following received include: ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: SERVFAIL