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 January 20, 2025 03:52
Export NuGet Packages referenced in C# Solution, then list Licenses.
using System.Collections.Concurrent;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Xml.Linq;
var path = @"output.json";
var bytes = File.ReadAllText(path);
var packages = JsonSerializer.Deserialize<DotnetCliListPackages>(bytes);
ArgumentNullException.ThrowIfNull(packages);
var licenses = new ConcurrentBag<DotnetLicense>();
@guitarrapc
guitarrapc / README.md
Last active January 14, 2025 18:07
Remove "Open with Visual Studio" in the Windows Explorer Context menu

Summy

There are 2 registry keys you need to remove.

  • HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
  • HKEY_CLASSES_ROOT\Directory\shell\AnyCode

Steps

Step1. Check you value before deletetion

@guitarrapc
guitarrapc / run.sh
Created December 9, 2024 05:40
run terraform-graph-beautifier.
#!/bin/bash
set -euo pipefail
terraform graph -type=apply | docker run --rm -i --name terraform-graph-beautifier ghcr.io/pcasteran/terraform-graph-beautifier:latest-linux --embed-modules=false --output-type=cyto-html > config1.html
@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