プルリクエストがマージ可能になったらいち早く知りたいので、承認+テストをパスしたら通知を送るmacOSのアプリを作った。 github.com approve不要なPRについてはテストが完了した時点で通知がくる(はず)。 テストがこけても通知が来る。rejectされても通…
Golangの構造体の情報をダンプするライブラリを作った。 github.com 使い方 こういう感じの設定用structがあったとして type config struct { Home string `env:"HOME,required"` Port int `env:"PORT" envDefault:"3000"` Bar *subconfig `envPrefix:"SUB_"…
https://chromewebstore.google.com/detail/github-hide-finish-commen/ejflccgjhcloeienodjdmngdhockjbdf github.com 10回に1回ぐらい「Approveしたと思ったらCommentだった」ということがあるので、Finish your reviewからCommentを消す拡張を作ってみた。
github.com 本体は ERB.new().result を呼ぶだけで、それをmrubyでdarwin/linuxのx86_64/aarch64向けにビルドした。 以下のようにシングルバイナリプログラムを通してテンプレートファイルを処理できる。 <%- to = ENV["MAIL_TO"] priorities = ENV["PRIORIT…
terraformでaws_lambda_functionとarchive_fileを使ってLambdaをデプロイする方法がある。 data "archive_file" "lambda" { type = "zip" source_file = "lambda.js" output_path = "lambda_function_payload.zip" } resource "aws_lambda_function" "test_l…
Application.Read.Allが必要。 cf. アプリケーションを取得する - Microsoft Graph v1.0 | Microsoft Learn #!/usr/bin/env python # pip install azure-identity msgraph-sdk import asyncio import pprint from azure.identity.aio import ClientSecretCre…
github.com
クエリ { search(type: ISSUE, last: 100, query: "is:open is:pr author:@me org:qubole") { nodes { ... on PullRequest { title url reviewDecision commits(last: 1) { nodes { commit { statusCheckRollup { state } } } } } } } } 結果 { "data": { "s…
GitHub - winebarrel/swift-octokit-cli-example // let package = Package( // name: "octokit-cli", // platforms: [ // .macOS(.v14), // ], import Foundation import OctoKit let env = ProcessInfo.processInfo.environment let token = env["GITHUB_T…
github.com 「SwiftUIを使ってmacOSステータスバーアプリをつくる方法 | 株式会社ヌーラボ(Nulab inc.)」を参考にしました
時間電卓。 github.com 通貨を変換するやつ。 github.com
料金じゃなくて量のほう。 月額プランのコミットが量に対してなので、ぱっと見れるように作った。 github.com
github.com marketplace.visualstudio.com AWS_PROFILEの切り替えが少しめんどくさいので、VSCodeの環境変数をいじれる拡張を調査中… 追記 direnv-vscodeを使ってみるかな github.com
SRE Advent Calendar 2023の10日目の記事です。 業務でDatadogを使っていてモニターは以下のような感じでterraformで管理しているんですが、通知メッセージに入れているものをつらつら書いてみます。 resource "datadog_monitor" "elb_http_5xx" { name = "T…
こちらの記事に触発されて terraform planでEventBridgeのcron式を検証するterraform providerを書いた。 github.com 以下のようにデータソースを定義すると data "cronplan_expr" "every_weekday" { expr = "cron(5 0 ? * ? *)" } terraform planの時にエラ…
github.com
1Password CLI経由で1Passwordのアイテムをdata sourceとして使うterraform-provider-opを作った。 github.com 以下の用のPostgreSQL providerのパスワードを自分のマシンの1Passwordからとってこれる。 provider "op" { } data "op_item" "postgres" { titl…
esa.ioのCLI、kasaにインポート機能を追加した。 github.com ファイルをインポートすることもできるし $ echo test > test.txt $ kasa import test.txt hello/world https://winebarrel.esa.io/posts/1 $ kasa cat hello/world test $ kasa import test.txt …
AWS SSOで各AWSアカウントのManage Consoleを開く場合、AWSアクセスポータルURL(d-xxxxxxxxxx.awsapps.com/start)から遷移するが、赤枠のリンクは固定値のようなので、そのリンクから個別のアカウントのManage Console開くことができる。 リンクのURLは下…
作った github.com
Datadogでマルチオーガニゼーションを利用しているが、Webコンソールでは使用量は表示されても料金が表示されず、また月ごとの料金を比べることもできないので、APIを呼び出して複数月の料金を月ごと・組織ごとに表示するツールを作った。 github.com 使い方…
業務で使っているRedashのアラートをGitHubで管理したくなったので、terraformのproviderを書いた。 github.com registry.terraform.io Redash providerはすでにいくつかあるが、テストがなかったり活発にメンテナンスされている様子がなかったりしたので、…
docker-tag: name: Tag docker images runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: aws-actions/configure-aws-credentials@v2 with: #... - name: Tag branch to docker images run: | MANIFEST=$(aws ecr batch-get-image --repos…
Slackで会話できるChatGPTボットを作った。 Getting Startedの通りにすれば10分ぐらいでインストールできると思う。 github.com すでにSlackの中の人がChatGPT-in-Slackとかchatgpt-on-denoというのを作っていてそっちの方がはるかに高機能だけど、社内のSla…
自分のために大変便利 marketplace.visualstudio.com github.com
GitHub Actions issue linkというChromeの拡張機能を作った。 chrome.google.com github.com pushイベントで実行されたGitHub ActionsにはマージされたPRへのリンクはないが、タイトルには「#1234」とPR(Issue)番号があることが多いので、それをPR(Issue…
www.aoky.net 昔読んだSteve Yeggeの「バベル案内」のC++ の話に「STL作者が OOP は嫌いだと言っていてショックを受けた」ということが書いてあって、ふーんと思っていたが、最近Alexander Stepanovのインタビュー記事を読んでいてそれっぽい話があった。 ww…
監査上の理由からFargateがreadonlyRootFilesystemで動いてほしかったので、nginxコンテナを使った検証のメモ。 基本方針 nginxイメージそのままでは動かないのでカスタムイメージを作る /var をタスクストレージにマウントする /tmp は /var/tmp へのsymlin…
複数のAWSアカウントのECRからdocker pullするときに、いちいちプロファイルを指定するのがめんどくさいことがあったので(docker-composeとか)、環境変数を追加するecs-loginのラッパーを作った。 github.com ~/.docker/ecr-login-env.json に以下のような…
github.com マスクされた値はマウスで選択すれば見れる。 以下のようなaliasを設定して使っている。 alias opeco='op item list | tail -n +2 | sort -k2 | peco | cut -b -26 | (op item get --format json $(cat -) | opmsk)' ※peco: https://github.com/p…