Navigation Menu

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 / Makefile
Last active September 27, 2020 19:01
It makes zenn-cli easier.
# It makes zenn-cli easier.
# Supported OS: ["macOS"]
# Requirements: make, perl
# [zenn-cli guide](https://zenn.dev/zenn/articles/zenn-cli-guide)
.PHONY: all help
.DEFAULT_GOAL := help
help: ## This help
@echo "Usage: make \033[36m[subCommand]\033[0m\n"
@k-oguma
k-oguma / Compare_csr_and_key_of_TLS
Created June 19, 2019 04:57
[oneliner][openssl] You can compare TLS CSR and TLS key by using one liner.
domain=<Your domain>; [[ $(openssl rsa -text -noout -in $domain.key | grep -A 3 -w modulus: | tail -1 | grep $(openssl req -text -noout -in $domain.csr | grep -A 3 -w Modulus: | tail -1)) ]] && { echo -e "\033[32m[Success] Compared $domain.{key,csr}, these had each matched the module.\033[00m" } || { echo "\033[31m[Fail] Compared $domain.{key,csr}, these don't have each matched the module.\033[00m" }
@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

@k-oguma
k-oguma / cloudSettings
Last active August 15, 2020 18:49
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-15T18:49:17.834Z","extensionVersion":"v3.4.3"}
@k-oguma
k-oguma / Cloud9_settings
Last active December 2, 2018 21:48
Cloud9 settings. init script, user setting, project setting
# AWS Cloud9 settings
## Prepare
### AWS SSM
Push the your environment variables.
- FYI
- Like a [12 factor app](https://12factor.net/config)
# 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 / 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'
@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 / webops_policies.md
Last active August 27, 2017 12:35
[WebOps] 問題調査方法や構築時の注意点と方針

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

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

調査の概要

  1. 必要な情報を得られるだけ得る
    • トレーサビリティは高めておく (事前準備も可能な限りしておく)
  2. Web/Appおよびインフラ調査
@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}/, '')
}