Skip to content

Instantly share code, notes, and snippets.

View kv5h's full-sized avatar
🧘
🇮🇳

Y.Yoshida kv5h

🧘
🇮🇳
  • Nagoya City, Japan
View GitHub Profile
@kv5h
kv5h / uv_usage.md
Created July 11, 2025 01:38
Python パッケージ管理ツール `uv` の基本的な使い方

uv: Python の高速なパッケージ管理ツール 🚀

このドキュメントは、Rust 製の高速な Python パッケージ管理ツール uv の基本的な使い方と、典型的な開発フローをまとめたものです。

uv は、pippip-toolsvenvvirtualenv の機能を、単一の高速なコマンドラインツールで置き換えることを目指しています。

uv とは?

  • 超高速: Rust で書かれており、依存関係の解決やパッケージのインストールが非常に高速です。
  • オールインワン: 仮想環境の作成、パッケージのインストール、依存関係の固定(コンパイル)、環境の同期など、多くの機能を単一のツールで提供します。
@kv5h
kv5h / EcsRunTaskOperator_on_LocalStack.md
Last active May 13, 2025 01:05
Using Airflow's EcsRunTaskOperator on ECS mocked with LocalStack

TL;DR

To use Airflow's EcsRunTaskOperator on ECS mocked with LocalStack, you need to implement a custom operator.

Problem

Running EcsRunTaskOperator on ECS mocked with LocalStack returns KeyError 'failures' error:

image

@kv5h
kv5h / statistic_calculation.md
Created April 2, 2025 18:08
statistic calculation

Code

import numpy as np
import polars as pl

# Data frame
df = pl.read_csv("input.csv")
df_rounded = df.with_columns(
    pl.col("au").round(2).alias("x"),
@kv5h
kv5h / notes_on_github_actions_step_timeout_and_its_result.md
Last active November 7, 2024 08:07
Notes on GitHub Actions step `timeout` and its result

Notes on GitHub Actions step timeout and its result

Preface

How timeout-minutes on GitHub Actions step is treated when it exceeded the limit?

TL;DR

When timeout-minutes is exceeded,

@kv5h
kv5h / misc_notes.md
Last active February 20, 2025 08:58
misc_notes

misc_notes

jq

json to text

$ echo '{"a":"abc","b":123}' | jq '@text'
"{\"a\":\"abc\",\"b\":123}"
@kv5h
kv5h / simply_get_diff_of_kubectl_rollout_history_deployment.md
Created August 26, 2022 12:26
Simply get diff of kubectl rollout history deployment --revision=xxx

Let's get diff of below outputs:

$ kubectl rollout history deployment dep-nginx --revision=1
deployment.apps/dep-nginx with revision #1
Pod Template:
  Labels:       app=dep-nginx
        pod-template-hash=75ddff596
  Containers:
   nginx:
@kv5h
kv5h / generate_ramdom_strings_on_console.md
Created August 23, 2022 03:31
Generate ramdom strings on console

For password generating, unique resource creating, and so on.

How

Add below to ~/.bashrc.

alias random8='cat /dev/urandom | base64 | tr -dc "a-zA-Z0-9" | fold -w 8 | head -n 1'
alias random16='cat /dev/urandom | base64 | tr -dc "a-zA-Z0-9" | fold -w 16 | head -n 1'
alias random32='cat /dev/urandom | base64 | tr -dc "a-zA-Z0-9" | fold -w 32 | head -n 1'
@kv5h
kv5h / fails_at_docker-compose_run_--rm_rails_rails_db_create.md
Created June 17, 2022 16:09
Fails at docker-compose run --rm rails rails db:create

Issue

$ docker-compose run --rm rails rails db:create
Creating lamp_rails_run ... done
Unknown MySQL server host 'mysql' (-2)
Couldn't create 'db_dev' database. Please check your configuration.
rails aborted!
Mysql2::Error::ConnectionError: Unknown MySQL server host 'mysql' (-2)
/usr/local/bundle/gems/mysql2-0.5.4/lib/mysql2/client.rb:95:in `connect'
@kv5h
kv5h / using_docker_containered_terraform.md
Created June 17, 2022 11:51
Using docker containered terraform
@kv5h
kv5h / docker_installation_on_al2.md
Last active June 16, 2022 21:27
Docker installation on AL2

Install docker with yum

sudo yum install docker
sudo systemctl start docker && sudo systemctl enable docker
sudo usermod -a -G docker ec2-user

Install docker-compose