Skip to content

Instantly share code, notes, and snippets.

View noda-sin's full-sized avatar
😀
Happy

Noda Shimpei noda-sin

😀
Happy
View GitHub Profile
@noda-sin
noda-sin / gist:f9d9a6b25a7bef4753c9
Created February 10, 2016 03:29
aws_ssh_tunneling.sh
#!/bin/bash
tunnel_host=$(aws ec2 describe-instances | jq -r '[.Reservations[].Instances[] | select(.Tags[].Key == "Name" and .Tags[].Value == "tunnel" and .State.Name == "running")] | .[0] | .PublicDnsName')
if [ -z $tunnel_host ]; then
echo "tunnel host is not running"
exit 1
fi
COMMAND="ssh -f -N -L 3028:localhost:3128 ec2-user@$tunnel_host"
#!/bin/bash
# ------------------------------------------------------------------
# Deploy chef-repo.tar.gz of kirishima to S3 bucket
# ------------------------------------------------------------------
VERSION=1.0
SUBJECT=kiri-deploy-to-s3
USAGE="Usage: deploy env"
# --- Options processing -------------------------------------------
@noda-sin
noda-sin / awslogs.conf
Created January 24, 2016 14:38 — forked from mechamogera/awslogs.conf
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.
@noda-sin
noda-sin / gist:397102817bc497f09957
Last active December 23, 2015 15:13
apache2.sh
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache2 is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /usr/local/apache2/conf/access.conf
#!/bin/sh
yum -y install httpd php mysql php-mysql
chkconfig httpd on
service httpd start
cd /tmp
wget http://us-east-1-aws-training.s3.amazonaws.com/self-paced-lab-4/examplefiles-as.zip
unzip examplefiles-as.zip
mv examplefiles-as/* /var/www/html
@noda-sin
noda-sin / gistodo.md
Last active August 29, 2015 14:16
テストtodo
  • a
  • b
  • 5
@noda-sin
noda-sin / auto-associate-address.sh
Created December 4, 2014 16:10
AWS Command Tools
#!/bin/sh
selfId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
allocIds=$(aws ec2 describe-addresses | jq '[.Addresses[] | select(.AssociationId == null) | .AllocationId]')
allocLen=$(echo ${allocIds} | jq length)
if [ "${allocLen}" -eq 0 ]; then
echo 'Allocation address not found' 1>&2
exit 2
@noda-sin
noda-sin / serf
Last active August 29, 2015 14:10
Serf Init Script
#!/bin/sh
#
# chkconfig: - 89 11
# description: serf daemon
# processname: serf
# config: /etc/serf/serf.conf
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Description: serf agent daemon
@noda-sin
noda-sin / gist:8f13daf9bd00c92dc8e8
Created November 13, 2014 14:14
Self-Signed-Certficate-Generator
http://www.selfsignedcertificate.com/
@noda-sin
noda-sin / AWS-Vagrantfile
Last active August 29, 2015 14:06
AWS-Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# change default provider to digital_ocean
ENV['VAGRANT_DEFAULT_PROVIDER'] = "aws"
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|