Skip to content

Instantly share code, notes, and snippets.

View naa0yama's full-sized avatar

Naoki Aoyama naa0yama

  • Tokyo, Japan
  • 00:26 (UTC +09:00)
View GitHub Profile
@naa0yama
naa0yama / hook-dns-01-lets-encrypt-route53.py
Created August 18, 2016 12:17
Python 3 script to use as a hook for the letsencrypt.sh client
#!/usr/bin/env python3
# How to use:
#
# LE_HOSTED_ZONE=XXXXXX LE_AWS_PROFILE=dns-access ./letsencrypt.sh --cron --domain example.org --challenge dns-01 --hook /tmp/hook-dns-01-lets-encrypt-route53.py
#
# More info about letsencrypt.sh: https://github.com/lukas2511/letsencrypt.sh/wiki/Examples-for-DNS-01-hooks
# Using AWS Profiles: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles
# Obtaining your Hosted Zone ID from Route 53: http://docs.aws.amazon.com/cli/latest/reference/route53/list-hosted-zones-by-name.html
@naa0yama
naa0yama / pfsense2-2.grok
Last active September 24, 2016 11:04 — forked from elijahpaul/pfsense2-2.grok
pfsense2-2.grok
# GROK match pattern for logstash.conf filter: %{LOG_DATA}%{IP_SPECIFIC_DATA}%{IP_DATA}%{PROTOCOL_DATA}
# GROK Custom Patterns (add to patterns directory and reference in GROK filter for pfSense events):
# GROK Patterns for pfSense 2.2 Logging Format
#
# Created 27 Jan 2015 by J. Pisano (Handles TCP, UDP, and ICMP log entries)
# Edited 19 Sep 2016 by FoxBoxsnet
#
# Usage: Use with following GROK match pattern
#
# %{LOG_DATA}%{IP_SPECIFIC_DATA}%{IP_DATA}%{PROTOCOL_DATA}
@naa0yama
naa0yama / file0.txt
Last active December 17, 2016 01:02
nginx 1.11.7 リリース 追加された変数など ref: http://qiita.com/FoxBoxsnet/items/4f2b4f0a6c5aa2efa899
The variable is fully supported only when using OpenSSL version 1.0.2 or higher.
With older versions, the variable is available only for new sessions and lists only known ciphers.
@naa0yama
naa0yama / file0.txt
Last active April 8, 2017 00:57
SSHログインをSlackに通知する。 ref: http://qiita.com/FoxBoxsnet/items/a496e4bf158177e263fc
$ mkdir ~/.ssh/
$ vi ~/.ssh/rc
@naa0yama
naa0yama / KUSANAGI Upgrading certbot-auto 0.12.0 to 0.13.0...
Created April 9, 2017 13:19
KSUANAGI で 深夜のCRON実行がエラーした時のログ
Message 11:
From root@www.exsample.co.jp Sun Apr 9 03:12:06 2017
Return-Path: <root@www.exsample.co.jp>
X-Original-To: root
Delivered-To: root@www.exsample.co.jp
From: "(Cron Daemon)" <root@www.exsample.co.jp>
To: root@www.exsample.co.jp
Subject: Cron <root@www> /usr/bin/kusanagi update cert
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
@naa0yama
naa0yama / README.md
Last active August 6, 2017 05:13
Appliance Automatic Installation Ubuntu

ハンズオン & 検証用 Ubuntu Server 16.04.2 LTS 半自動構築スクリプト

この設定ファイルでは、preseed を使用して、初期設定をするスクリプトになってます。

Users 

  • ID: root, user01
  • PASS: p@ssw0rd

Packages

  • bash-completion
@naa0yama
naa0yama / bash
Last active August 17, 2017 13:33
CloudGarage 早速いじってみた - Part.03 サーバー作成 & ベンチマーク ref: http://qiita.com/FoxBoxsnet/items/859723042dae238ac2d2
root@ubuntu01:~# dd if=/dev/zero of=/tmp/write.tmp ibs=1M obs=1M count=1024 && rm /tmp/write.tmp
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.03311 s, 1.0 GB/s
root@ubuntu01:~# dd if=/dev/zero of=/tmp/write.tmp ibs=1M obs=1M count=2048 && rm /tmp/write.tmp
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 2.17298 s, 988 MB/s
root@ubuntu01:~# dd if=/dev/zero of=/tmp/write.tmp ibs=1M obs=1M count=4096 && rm /tmp/write.tmp
4096+0 records in
@naa0yama
naa0yama / bash
Created September 6, 2017 06:09
docker pull -a <image name> やってしまった. ref: http://qiita.com/FoxBoxsnet/items/d6cf4e95fdae1e596066
% docker images | grep -e '^nginx'
nginx 1.12-perl 088b0900b170 5 weeks ago 146MB
nginx 1.12.1-perl 088b0900b170 5 weeks ago 146MB
nginx stable-perl 088b0900b170 5 weeks ago 146MB
nginx 1.12 7f1c878a4833 5 weeks ago 107MB
nginx 1.12.1 7f1c878a4833 5 weeks ago 107MB
nginx stable 7f1c878a4833 5 weeks ago 107MB
nginx
@naa0yama
naa0yama / file0.txt
Created September 14, 2017 15:35
RancherOS で インストール後パスワードでログインする方法 ref: http://qiita.com/FoxBoxsnet/items/127354c03b55a161a35b
[rancher@host-192-168-0-44 ~]$ cat <<EOF > cloud-config.yml
hostname: ros003
EOF
[rancher@host-192-168-0-44 ~]$ cat cloud-config.yml
hostname: ros003
#cloud-config
rancher:
network:
http_proxy: https://myproxy.example.com
https_proxy: https://myproxy.example.com
no_proxy: localhost,127.0.0.1