Skip to content

Instantly share code, notes, and snippets.

View ryo0301's full-sized avatar
🏠
Working from home

ryo0301 ryo0301

🏠
Working from home
View GitHub Profile
@ryo0301
ryo0301 / style.less
Last active December 22, 2021 03:10
markdown-preview-enhanced
/* Please visit the URL below for more information: */
/* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
@font-face {
font-family: "ricty";
src: local("RictyDiminishedDiscord-Regular");
font-style: normal;
font-weight: normal;
}
@ryo0301
ryo0301 / gist:788e865c94db113b7c7786e8dacd93f6
Created January 6, 2020 02:41
aws appsync graphql transfer @auth
type Building
@auth(
rules: [
{
allow: groups,
groups: ["Managers"],
queries: null,
mutations: [create, update, delete]
},
{
@ryo0301
ryo0301 / file0.txt
Last active April 12, 2016 04:49
Route53 の Weighted Routing で少しだけ流してテストする ref: http://qiita.com/ryo0301/items/b53929ff420be46dc01a
Weight / Weight合計
@ryo0301
ryo0301 / file0.txt
Last active April 5, 2016 03:55
CloudFormationのロールバック時に設定ファイルも元に戻す ref: http://qiita.com/ryo0301/items/c2141d05eda63b2d2bad
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CloudFormation rollback test",
"Parameters": {
"VersionId": {
"Type": "String"
}
},
"Resources": {
"Group": {
@ryo0301
ryo0301 / awscli
Created August 5, 2015 10:27
Route53のAレコードをawscliで更新する ref: http://qiita.com/ryo0301/items/82bd4fab7f2faefe7ce7
$ aws route53 get-change --id /change/XXXXXXXXXXXXX
@ryo0301
ryo0301 / file1.sh
Last active December 5, 2016 08:29
bashでjqを使ってJSONの配列をループさせる ref: http://qiita.com/ryo0301/items/2ac9d11f355f1cf52ea5
#!/bin/bash
json=$(cat list.json)
len=$(echo $json | jq length)
for i in $( seq 0 $(($len - 1)) ); do
row=$(echo $json | jq .[$i])
done
@ryo0301
ryo0301 / access-policy
Last active August 29, 2015 14:20
ImportImageによるVMインポート ref: http://qiita.com/ryo0301/items/e36f7602fbd762e739b2
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket"
],
@ryo0301
ryo0301 / file0.txt
Last active August 29, 2015 14:19
CloudFormationで新旧LaunchConfigurationをrolling updateで切り替える ref: http://qiita.com/ryo0301/items/7b9ab1d74c230806f492
{
"Resources": {
"Group": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"UpdatePolicy": {
"AutoScalingRollingUpdate": {
"MaxBatchSize": "2",
"MinInstancesInService": "5",
"PauseTime": "PT10M",
"WaitOnResourceSignals": "true"
@ryo0301
ryo0301 / .pryrc
Last active March 17, 2016 09:14
MacからAWSにアクセスする時はAssumeRoleすることにした ref: http://qiita.com/ryo0301/items/0730e4b1068707a37c31
begin
require 'aws-sdk-core'
rescue LoadError
else
# aws.rb may already have been initialized
Aws.config[:region] ||= 'ap-northeast-1'
Pry::Commands.import(Pry::CommandSet.new {
block_command 'aws-assume-role' do |role_name, external_id, token_code|
system "~/bin/aws-assume-role #{role_name} #{external_id} #{token_code}"
@ryo0301
ryo0301 / err
Last active March 16, 2017 09:20
S3、Kinesis/DynamoDB StreamsでのLambdaリトライ処理 ref: http://qiita.com/ryo0301/items/de5d965381d2273cf0a5
{
"message": "At least one of the pre-conditions you specified did not hold",
"code": "PreconditionFailed",
"time": "2014-12-03T02:54:39.101Z",
"statusCode": 412,
"retryable": false
}