Skip to content

Instantly share code, notes, and snippets.

@mechamogera
mechamogera / Readme.md
Last active October 24, 2023 06:36
NetworkFirewallとClientVPNを伴うVPCのCloudFormationテンプレート

ここではNetworkFirewallとClientVPNを伴うVPCのCloudFormationテンプレートを管理します。 NetworkFirewallではVPC内部から外部への通信は80番と443番のみ許可し、許可ドメインのみ通信可能にしています。 ClientVPNに接続すると上記Firewall内からの通信となるので通信制限した環境でアクセスできるかの確認ができます。

テンプレートの利用手順

相互認証用の証明書のキーと証明書の作成

以下のURLを参照してサーバー証明書とキーをACMにアップロードしておきそのARNを記録しておきます。 クライアント証明書とキーのファイルはPCの適当な場所に保管しておきます。

@mechamogera
mechamogera / OrbitControls.js
Last active January 18, 2023 08:32
THETAのDualfisheye動画をthree.jsで視聴するためのサンプル
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
/*global THREE, console */
// This set of controls performs orbiting, dollying (zooming), and panning. It maintains
@mechamogera
mechamogera / Readme.md
Last active July 6, 2022 19:57
Route53のDynamicDNS設定Rubyスクリプト

使用方法

  • 以下のようにしてスクリプトを取得する。もしくは、downloadして解凍。
 $ git clone git://gist.github.com/3973319.git
  • 実行
  • 自マシンでのIPアドレスを取得してRoute53にhoge.example.com.のAレコードを設定する
@mechamogera
mechamogera / Readme.md
Created October 5, 2012 08:50
C++言語で簡単なRuby拡張ライブラリを書いてみた

この拡張ライブラリの使用手順

  • このサンプルをダウンロードして解凍したディレクトリで以下を実行
 $ ruby extconf.rb
 $ make
 $ ruby test.rb

ファイルについて

@mechamogera
mechamogera / receving-mail-server.json
Last active December 18, 2018 17:11
メール受信環境を構築するCloudFormationテンプレート
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Mail server for receiving",
"Parameters" : {
"MailServerDomain" : {
"Type" : "String",
"Default" : "mail.example.com",
"Description" : "mail server domain"
},
@mechamogera
mechamogera / rsa_key_test.rb
Last active September 23, 2018 10:16
公開鍵を用いた暗号化、秘密鍵を用いた復号化テスト用rubyスクリプト
require 'openssl'
require 'base64'
# openssl genrsa -out ./id_rsa で作成
private_key = nil
File.open("id_rsa") do |f|
private_key = OpenSSL::PKey::RSA.new(f)
end
# openssl rsa -in id_rsa -pubout -out id_rsa_pub で作成
@mechamogera
mechamogera / awslogs.conf
Last active August 7, 2018 10:46
CloudWatch Logsサンプル設定
#
# ------------------------------------------
# CLOUDWATCH LOGS AGENT CONFIGURATION FILE
# ------------------------------------------
#
# --- DESCRIPTION ---
# This file is used by the CloudWatch Logs Agent to specify what log data to send to the service and how.
# You can modify this file at any time to add, remove or change configuration.
#
# NOTE: A running agent must be stopped and restarted for configuration changes to take effect.
@mechamogera
mechamogera / Gemfile
Last active March 15, 2018 22:46
AWSの簡易S3アップロードRubyスクリプト
# A sample Gemfile
source "https://rubygems.org"
gem 'aws-sdk'
gem 'mime-types'
@mechamogera
mechamogera / Gemfile
Last active May 20, 2016 17:34
Zabbix APIをRubyから利用する場合どのライブラリが良いのか調べてみる
# A sample Gemfile
source "https://rubygems.org"
gem 'rubix'
gem 'zabbixapi'
gem 'zabby'
gem 'zbxapi'
@mechamogera
mechamogera / Gemfile
Last active March 18, 2016 03:22
Github Organizationのメンバー一覧を取得するRubyスクリプト
# A sample Gemfile
source "https://rubygems.org"
gem 'github_api'
gem 'highline'
gem 'trollop'