Skip to content

Instantly share code, notes, and snippets.

View hassaku63's full-sized avatar

Takuya Hashimoto hassaku63

View GitHub Profile
@hassaku63
hassaku63 / send-get-request-to-opensearch-using-curl-with-sigv4.sh
Last active March 22, 2024 20:17
Send GET request to OpenSearch Domain using curl with sig4 signature
aws_region='ap-northeast-1'
endpoint="https://DOMAIN_NAME.${aws_region}.es.amazonaws.com/"
AWS_ACCESS_KEY_ID='foo'
AWS_SECRET_ACCESS_KEY='bar'
curl $endpoint --verbose --aws-sigv4 "aws:amz:${aws_region}:es" --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}"
@hassaku63
hassaku63 / zsh_completion.md
Created January 25, 2021 17:11 — forked from rummelonp/zsh_completion.md
zsh の補完関数の自作導入編

zsh の補完関数の自作導入編

あまり深く理解してないので識者のツッコミ大歓迎

補完を有効にする

取り敢えず最低限だけ

# 補完を有効にする
@hassaku63
hassaku63 / keybindings.json
Created July 19, 2019 17:17
VSCode_move_focus_between_editor_and_terminal.json
// VSCodeで、エディタとターミナルを往復できるショートカットの定義
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+`",
@hassaku63
hassaku63 / codepipeline-start-pipeline-execution-sampe.ts
Created June 19, 2023 12:35
AWS SDK for Node.js (v3) で CodePipeline StartPipelineExecution API を実行するサンプル
import {
CodePipelineClient,
StartPipelineExecutionCommand,
StartPipelineExecutionCommandOutput,
ConflictException,
} from "@aws-sdk/client-codepipeline";
type StartPipelineExecutionResultFailed = {
success: false,
error: Error,
@hassaku63
hassaku63 / SECCON Beginners CTF 2023.md
Last active June 4, 2023 05:29
SECCON Beginners CTF 2023

URL: https://score.beginners.seccon.jp/

今回 CTF 初挑戦だったので、やってたこと、考えてたことなどを雑にメモっていく場所。

マジで何もわかっていないで書いてるので、(これを見てしまった人向けに)正解にたどり着きたい人、参考情報を得たい人が見るような「資料」じゃないことを予め断っておく。

自分が何考えてたのかをある程度 dump したものであって、バックグラウンドを理解して書いてるものではない。

競技日程

@hassaku63
hassaku63 / determination-api-stack.ts
Created December 28, 2020 10:25
aws-cdk example - API Gateway V2 HTTP API & lambda NodejsFunction
import * as path from 'path';
import * as cdk from '@aws-cdk/core';
import * as ddb from '@aws-cdk/aws-dynamodb';
import * as apiGatewayV2 from '@aws-cdk/aws-apigatewayv2';
import { LambdaProxyIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';
import { NodejsFunction, NodejsFunctionProps } from '@aws-cdk/aws-lambda-nodejs';
import { HttpIntegration, HttpIntegrationType } from '@aws-cdk/aws-apigatewayv2';
import { dirname } from 'path';
const project_root_dir = path.join(dirname(__filename), '../')
@hassaku63
hassaku63 / main.go
Created December 25, 2022 10:42
AWS SDK for Go 使ってみる
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/lambda"
"github.com/aws/aws-sdk-go/service/sts"
)
func main() {
@hassaku63
hassaku63 / tokenizer.py
Created November 6, 2022 16:20
Python で S式(整数の四則演算だけ)を字句解析する
from enum import Enum
from functools import wraps
def assert_simgle_char(f):
@wraps(f)
def inner(c: str):
if len(c) != 1:
raise ValueError(c)
return f(c)
@hassaku63
hassaku63 / main.go
Last active November 6, 2022 13:57
Type switch
package main
import (
"fmt"
"time"
)
func main() {
typeSwitch := func(v interface{}) {
switch v.(type) {
@hassaku63
hassaku63 / main.go
Last active July 27, 2022 18:30
[Golang] map, struct を要素に持つリストをソートする例
package main
import (
"encoding/json"
"fmt"
"log"
"sort"
)
type Person struct {