Skip to content

Instantly share code, notes, and snippets.

View guitarrapc's full-sized avatar
:octocat:

Ikiru Yoshizaki guitarrapc

:octocat:
View GitHub Profile
@guitarrapc
guitarrapc / Program.cs
Last active December 4, 2024 06:30
Amazon Aurora DSQL connect from C# by Npgsql
using System;
using System.Linq;
using System.Text;
using Amazon;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Util;
using Npgsql;
@guitarrapc
guitarrapc / README.md
Last active November 26, 2024 09:16
Clean up specified workflow run history
mkdir ./run && cd ./run
# copy files into directory...
npm install octokit
node ./app.js
@guitarrapc
guitarrapc / ホロキュアキュア.md
Last active November 18, 2024 16:48
ほろきゅあおすすめビルド

武器1つのクリア用安定ビルド

アイテム

  1. 防御: 抱き枕 -> シールド
  2. 防御: ヘッドホン -> 35%回避
  3. 火力: お菓子の国のスイーツ -> ATK75%になるが3倍ヒット
  4. 移動: エナジードリング (スピード+ヘイスト) -> スピードが300%いくと安定 4'. 勉強眼鏡
  5. 火力: 集中グラサン (射撃/連射武器用) -> クリティカル500%ダメージ
@guitarrapc
guitarrapc / list_scheduled_workflow.sh
Last active August 30, 2024 13:38
List GitHub Actions workflow which has on.schedule
#/bin/bash
set -euo pipefaiil
echo "| Name | Path | Schedule (UTC) |"
echo "| ---- | ---- | ---- |"
json=$(gh workflow list --json name,path,state --limit 300)
echo "$json" | jq -c '.[] | select(.state == "active") | {name: .name, path: .path}' | sort | while read -r item; do
name=$(echo "$item" | jq -r '.name')
path=$(echo "$item" | jq -r '.path')
if [[ ! -f "$path" ]]; then continue; fi
@guitarrapc
guitarrapc / restart_all_deployments.sh
Created July 11, 2024 16:37
Restart deployments for all namesapces
#!/bin/bash
for nsfull in $(kubectl get ns -o name | grep -v -E "kube.*"); do
ns=$(echo $nsfull | cut -d "/" -f 2)
deploy=""
echo "# Running $ns"
for deploy in $(kubectl get deploy -o name | grep -E ".*"); do
if [[ "$deploy" == "" ]]; then
continue
fi
kubectl rollout restart $deploy -n $ns
@guitarrapc
guitarrapc / versions.tf
Last active June 23, 2024 16:15
Run setup-terraform based on required_versions written on versions.tf
# ./aws/versions.tf
terraform {
required_providers {
aws = {
version = "= 5.55.0"
source = "hashicorp/aws"
}
}
required_version = "~> 1.8.0" # use latest 1.8.x
# required_version = "= 1.8.4" # use 1.8.4

Setup

scoop install rustup
scoop install llvm
scoop install gcc

run

@guitarrapc
guitarrapc / eks_addon_configurationvalues_coredns.json
Created April 9, 2024 07:22
EKS Addon Additional Configurations for CoreDNS. Do not place CoreDNS to Karpenter Managed Node. https://aws.amazon.com/jp/blogs/containers/amazon-eks-add-ons-advanced-configuration/
{
"affinity": {
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "karpenter.sh/nodepool",
"operator": "DoesNotExist"
@guitarrapc
guitarrapc / README.md
Last active March 26, 2024 02:56
ShellScript to assume role by single command
  1. Prepare profile in ~/.aws/credentials.
  2. Change from_profile and to_profile to your profile name, then Run command.
from_profile=profile-A to_profile=profile-B sts=$(aws sts assume-role --profile "${from_profile}" --role-arn $(aws configure get "${to_profile}.role_arn") --role-session-name "${to_profile}-assume"); \
export AWS_ACCESS_KEY_ID=$(echo "${sts}" | jq -r '.Credentials.AccessKeyId'); \
export AWS_SECRET_ACCESS_KEY=$(echo "${sts}" | jq -r '.Credentials.SecretAccessKey'); \
export AWS_SESSION_TOKEN=$(echo "${sts}" | jq -r '.Credentials.SessionToken') \
export AWS_EXPIRE=$(echo "${sts}" | jq -r '.Credentials.Expiration')
@guitarrapc
guitarrapc / enumerate_txt.sh
Created March 12, 2024 03:34
Enumerable files under
#!/bin/bash
set -e
extension="txt"
result=$(find . -type f -name "*.${extension}" | cut -d / -f 2 | sort -u)
if [[ -n "$result" ]]; then
while read -r item; do
echo "$PWD/$item"
done <<< "$result"