Skip to content

Instantly share code, notes, and snippets.

View y13i's full-sized avatar
☘️

Yoriki y13i

☘️
View GitHub Profile
const { config, STS } = require("aws-sdk");
const { execSync } = require("child_process");
const sts = new STS();
if (!config.region) {
console.log("Set `$AWS_REGION` environment variable.");
process.exit(1);
}
@y13i
y13i / Dockerfile
Created May 15, 2018 03:43
Ruby on Rails on Docker & Alpine Linux
FROM ruby:2.5-alpine
RUN mkdir /app
WORKDIR /app
RUN \
set -x \
&& apk upgrade --no-cache \
&& apk add --no-cache --virtual \
build-dependencies \
&& apk add --no-cache \
@y13i
y13i / push_to_ecr.sh
Last active July 9, 2019 17:44
AWS ECR にイメージを push する方法をいつも忘れるのでメモ
export AWS_ACCOUNT_ID=nnnn
export AWS_REGION=xxxx
export CONTAINER_REPOSITORY=xxxx
export CONTAINER_IMAGE_TAG=0.0.x
# Docker login to ECR
$(aws ecr get-login --no-include-email) # bash, zsh
# eval (aws ecr get-login --no-include-email) # fish
# build, tag, and push docker image
@y13i
y13i / generic_aws_network.yml
Last active February 13, 2021 11:18
Generic AWS VPC Networking Template
Description: Generic AWS VPC Networking
Parameters:
PrivateToInternetAccess:
Type: String
Description: If true, NAT Gateways and Elastic IPs will be created for the internet access from private subnets.
AllowedValues:
- "false"
- "true"
Default: "false"
CidrPrefix:
// workaround: when webpack resolve.alias not working
import * as VueAll from "vue";
import VueDefault from "vue";
export type Vue = VueDefault;
export const Vue = <typeof VueDefault><any>VueAll;
import * as VueRouterAll from "vue-router";
import VueRouterDefault from "vue-router";
export type Router = VueRouterDefault;
@y13i
y13i / passgen.js
Last active December 11, 2017 11:30
generate password
new Array(20).fill(undefined).map(() => {const chars = 'qwertyuiopasdfghjklzxcvbnm1234567890!@#$%^&*()-_=+[{]};:/?'.split(''); return chars[Math.floor(Math.random() * chars.length)]}).join('');
@y13i
y13i / .angular-cli.json
Last active December 8, 2017 01:51
AWS Lambda で Angular アプリを Server Side Rendering してみる ref: https://qiita.com/y13i/items/9401f8aeab096a727417
// ...
"apps": [
{
"platform": "browser",
"root": "src",
"outDir": "dist/browser",
// ...
{
"platform": "server",
"root": "src",
@y13i
y13i / file0.swift
Last active August 10, 2017 00:45
Swift 3 で16進数文字列と整数の相互変換 ref: http://qiita.com/y13i/items/9af41a1cb507a4b388e0
String(42, radix: 16) // => "2a"
4 |-------|-------|-------|-------
8 |---|---|---|---|---|---|---|---
16 |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
32 ||||||||||||||||||||||||||||||||
*** * *** * *** * *** * *** * **
* * *** * *** * *** * *** * ***
* *** * *** * *** * *** * *** *
@y13i
y13i / file0.txt
Created July 3, 2017 19:06
AWS Price List API から価格情報を引いてくるツールを作った ref: http://qiita.com/y13i/items/ba8f85237e96a5c72ca5
$ awsprice listOfferRegions -o AmazonEFS
[]awsprice.RegionCode{
"ap-southeast-2",
"eu-west-1",
"us-east-1",
"us-east-2",
"us-west-2",
}