Skip to content

Instantly share code, notes, and snippets.

@tkhk
tkhk / github-actions-cache.md
Created November 1, 2022 15:07
github actions キャッシュメモ

github actions のキャッシュメモ

2022-11-02 現在

容量と削除

  • リポジトリ全体で最大 10 GB
    • キャッシュ数に制限はない
  • 7 日間アクセスがないキャッシュは削除される
  • 10GB を超えると古いものから削除される

Docker で Cloud Pub/Sub エミュレーター

Cloud Pub/Sub エミュレーターの起動

基本的に docker-compose で使うと思うので、以下 docker-compose.yml のサンプル。

version: "3.8"

services:
@tkhk
tkhk / rails_booting_process.md
Created April 8, 2022 10:42
Rails の起動プロセスの順番

Rails の起動プロセスの順番

毎回忘れるのでメモ

  # == Booting process
  #
  # The application is also responsible for setting up and executing the booting
  # process. From the moment you require "config/application.rb" in your app,

git diff で差分があるかどうかだけ知りたい

$ git diff --exit-code --quiet
$ echo $?

--exit-code で差分があれば 1, なければ 0.

--quiet で何も表示しない.

fargate のバインドマウントの所有者の設定が効かない

unicorn コンテナを ECS fargate で起動すると

Errno::EACCES: Permission denied - connect(2) for /var/run/unicorn/unicorn.sock

で起動しなかった。

@tkhk
tkhk / connect-ecs-container.sh
Created December 24, 2021 08:04
Support ECS exec '/bin/sh'
#!/bin/bash
set -eu
function cluster_arn() {
select cluster in $(aws ecs list-clusters --query "clusterArns[*]" --output text)
do
echo ${cluster}
break
done
}
@tkhk
tkhk / aurora-serverless-5.7.yaml
Last active November 18, 2021 21:16
5.7 互換の aurora serverless は CloudFormation で作成できないため、この yaml は使えない。作成できるようになった時用。
AWSTemplateFormatVersion: 2010-09-09
Parameters:
VpcId:
Type: AWS::EC2::VPC::Id
PrivateSubnetIds:
Type: List<AWS::EC2::Subnet::Id>
RdsAdminName:
Type: String
Default: admin
@tkhk
tkhk / openapi_generator_tips.md
Last active June 9, 2020 06:01
OpenAPI (OpenAPI Generator) 使う時の注意点
  • components は global におく必要がある
  • Schema オブジェクトは title をつけないと, InlineObject${index} のような名前が付けられる
  • csrf のトークンが必要な場合、Configuration で設定(下記参照)
  • 本番・開発環境で URL 変更したい場合、Configuration で設定(下記参照)
const config = new Configuration({
  basePath: 'http://localhost:3000/api',
  headers: {
 "x-csrf-token": document.head.querySelector("meta[name~=csrf-token][content]"))?.content
@tkhk
tkhk / rails_glossary.md
Created May 21, 2020 06:37
Rails機能名備忘録