This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import com.amazonaws.regions.Region; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.ec2.AmazonEC2; | |
import com.amazonaws.services.ec2.AmazonEC2Client; | |
import com.amazonaws.services.ec2.model.DescribeTagsRequest; | |
import com.amazonaws.services.ec2.model.DescribeTagsResult; | |
import com.amazonaws.services.ec2.model.StopInstancesRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import com.amazonaws.regions.Region; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.ec2.AmazonEC2; | |
import com.amazonaws.services.ec2.AmazonEC2Client; | |
import com.amazonaws.services.ec2.model.DescribeTagsRequest; | |
import com.amazonaws.services.ec2.model.DescribeTagsResult; | |
import com.amazonaws.services.ec2.model.StartInstancesRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DigestUtilsSample { | |
public static void main(String[] args) { | |
String data = "test1234"; | |
String cryptpass = PasswordHashUtil.crypt(data); | |
System.out.println("password :"+cryptpass); | |
System.out.println("isMuch? "+PasswordHashUtil.passwordMatch(data, cryptpass)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 以下のように$HOME/./configに記載されたプロファイル名を指定して実行してください。 | |
./cm-ec2-describe-events.rb --profile hoge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
AWS_PROFILE='YOUR awscli PROFILE NAME HERE' | |
INSTANCE_ID='YOUR INSTANCE ID HERE' | |
INSTANCE_TYPE='YOUR INSTANCE TYPE HERE' | |
PUBLIC_IP='YOUR INSTANCE EIP HERE' | |
while : | |
do | |
EC2_STATE=`aws ec2 describe-instances --profile ${AWS_PROFILE} --instance-ids ${INSTANCE_ID} | jq '.Reservations [] .Instances [] .State | .Name'` | |
if [ $EC2_STATE = '"running"' ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick Look | |
brew install caskroom/cask/brew-cask | |
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json quicklook-csv betterzipql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSAccessKeyId=your AccessKey | |
AWSSecretKey=your SecretKey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
// 初期設定 | |
require_once("/opt/aws/AWSSDKforPHP/sdk.class.php"); | |
date_default_timezone_set("Asia/Tokyo"); | |
$ec2 = new AmazonEC2(array( | |
"key" => "YOUR ACCESS KEY", | |
"secret" => "YOUR SECRET KEY" | |
)); | |
$ec2->set_region(AmazonEC2::REGION_APAC_NE1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1407249501000", | |
"Effect": "Allow", | |
"Action": [ | |
"rds:*" | |
], | |
"Resource": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
source /usr/local/bin/aws_zsh_completer.sh | |
complete -C aws_completer aws | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. |