Skip to content

Instantly share code, notes, and snippets.

View mryhryki's full-sized avatar
😄

MORIYA Hiroyuki mryhryki

😄
View GitHub Profile

Parse mbox to custom files

#!/usr/bin/env bash
# https://sentry.io/settings/account/api/auth-tokens/
SENTRY_AUTH_TOKEN="${SENTRY_AUTH_TOKEN:-"YOUR-TOKEN"}"
# https://docs.sentry.io/api/events/list-an-issues-events/
ISSUE_ID="12345678"
URL="https://sentry.io/api/0/issues/${ISSUE_ID}/events/?full=false"
curl -H "Authorization: Bearer ${SENTRY_AUTH_TOKEN}" "${URL}"
@mryhryki
mryhryki / !README.md
Last active January 11, 2022 02:18
S3 usage analyzer

S3 usage analyzer

This script collect all s3 bucket objects and calculate usage bytes per prefixes.

@mryhryki
mryhryki / README.md
Last active January 11, 2022 02:17
Custom AWS Lambda runtime: provide your own bootstrap

Custom AWS Lambda runtime: provide your own bootstrap

A runtime is a program that runs a Lambda function's handler method when the function is invoked. The runtime can be included in your function's deployment package, or in a layer. Learn more about custom Lambda runtimes.

For reference, this function includes a sample Bash runtime in bootstrap.sample and a corresponding handler file hello.sh.sample. As a next step, you should provide your own bootstrap by either adding a layer implementing a custom runtime or including a bootstrap file in this function's deployment package.

@mryhryki
mryhryki / requst-aws-api-by-curl.sh
Last active September 29, 2023 13:49
curl の --aws-sigv4 オプションで AWS API にリクエストするサンプル(STSの一時的な認証情報を使用する場合)
#!/usr/bin/env bash
#
# 情報ソース
# https://twitter.com/toricls/status/1435133865857667079
#
# cURL --aws-sigv4 Option
# https://curl.se/docs/manpage.html#--aws-sigv4
#
# AWS Lambda - ListFunctions API
# https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/API_ListFunctions.html
@mryhryki
mryhryki / !README.md
Last active January 11, 2022 02:08
Create new page via Notion API

Create new page via Notion API

Setup

$ cp config.example.ts config.ts
# and edit `config.ts`

Execute

@mryhryki
mryhryki / !README.md
Last active January 5, 2022 04:18
Fetch all AWS DynamoDB Records.

Fetch all AWS DynamoDB Records.

Initialize

$ npm install

Execute

@mryhryki
mryhryki / !README.md
Last active March 14, 2022 05:20
Fetch website info by PHP

Fetch website info by PHP

This is PHP Script to fetch website info (title, description, image).

Setup

$ composer install
@mryhryki
mryhryki / !README.md
Last active July 28, 2022 07:14
Convert mbox to eml files by Node.js

Convert mbox to eml files by Node.js

Setup

  1. Install Node.js
  2. Run npm install
  3. Copy mbox file on this directory.

$ cp /path/to/your/mbox/file ./

@mryhryki
mryhryki / !README.md
Last active January 30, 2023 09:05
Node.js script pack template for private use.

{{GIST_NAME}}

Setup

$ npm install

Execute