Skip to content

Instantly share code, notes, and snippets.

Yasuhiro Matsuo understeer

Block or report user

Report or block understeer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@understeer
understeer / latency.txt
Created Jan 12, 2017 — forked from eshelman/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@understeer
understeer / cfn-ec2-runinstance-sample.json
Created May 17, 2016
各種パラメータ決め打ちでインスタンスを起動するCFnテンプレート
View cfn-ec2-runinstance-sample.json
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "EC2",
"Resources" : {
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"KeyName" : "id_rsa",
"ImageId" : "ami-xxxx",
"SecurityGroupIds" : ["sg-xxxx"],
@understeer
understeer / run-instances-into-all-regions.sh
Created May 17, 2016
全リージョンで同じAmazon Linux AMIでインスタンスを起動する
View run-instances-into-all-regions.sh
#!/bin/sh
AMINAME='amzn-ami-hvm-2015.03.0.x86_64-gp2'
# get region list
REGIONS=`aws ec2 describe-regions --output text --region ap-northeast-1 | awk '{print $3;}'`
for R in $REGIONS
do
AMI=`aws ec2 describe-images \
@understeer
understeer / run-with-sequence-IPs.sh
Created May 17, 2016
プライベートIPアドレスを連番でインスタンスを起動する
View run-with-sequence-IPs.sh
#!/bin/sh
INSTANCE_TYPE=c4.8xlarge
for IP in `seq 101 157`
do
aws ec2 run-instances \
--region ap-northeast-1 \
--image-id ami-xxxxxx \
--security-group-ids sg-xxxxx \
--key-name test20140204 \
@understeer
understeer / run-scheduled-instance.sh
Created Jan 15, 2016
AWS CLI example for run-scheduled-instances
View run-scheduled-instance.sh
aws ec2 run-scheduled-instances \
--region us-west-2 \
--scheduled-instance-id sci-7821-2dbf-4992-807f-xxxxxxxx \
--launch-specification file://launch-specification.json \
--instance-count 1
@understeer
understeer / launch-specification-for-scheduled-reserved-instances.json
Last active Jan 15, 2016
launch specification json for RunScheduledInstances
View launch-specification-for-scheduled-reserved-instances.json
{
"ImageId": "ami-f0091d91",
"KeyName": "id_rsa",
"SecurityGroupIds": [
"sg-zzzzzz"
],
"Placement": {
"AvailabilityZone": "us-west-2b",
"GroupName": ""
},
View setup.sh
sudo yum install gcc -y
wget http://stats.es.net/software/iperf-3.0.1.tar.gz
tar zxvf iperf-3.0.1.tar.gz
cd iperf-3.0.1
./configure
make
sudo make install
## for server
iperf3 s
View get-iam-credential-report.sh
#!/bin/sh
aws iam generate-credential-report
aws iam get-credential-report --output text --query Content | base64 -D
@understeer
understeer / sendsqs.js
Created Nov 23, 2014
AWS Lambda sample: Send received events to SQS as Message
View sendsqs.js
var QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/{AWS_ACCUOUNT_}/matsuoy-lambda';
var AWS = require('aws-sdk');
var sqs = new AWS.SQS({region : 'us-east-1'});
exports.handler = function(event, context) {
var params = {
MessageBody: JSON.stringify(event),
QueueUrl: QUEUE_URL
};
sqs.sendMessage(params, function(err,data){
@understeer
understeer / create-role.sh
Created Nov 6, 2014
AWS CLIでEC2用の IAM Roleを作る( 特定のDynamoDBへの参照権限を付与する例)
View create-role.sh
#!/bin/sh
ROLE_NAME=testdynamodb
# Assume Role Policyを指定して共にRoleを作成
aws iam create-role --role-name $ROLE_NAME --assume-role-policy-document file://policy.json
# Role Policyを付与する(例として、DynamoDBの参照権限だけにしている)
aws iam put-role-policy --role-name $ROLE_NAME --policy-name testdynamo-only --policy-document file://role-policy.json
# ROLEをEC2に見せるようにするためインスタンスプロファイルを作成する。
You can’t perform that action at this time.