Skip to content

Instantly share code, notes, and snippets.

View buzztaiki's full-sized avatar

Taiki Sugawara buzztaiki

View GitHub Profile
@buzztaiki
buzztaiki / emacs_syntax_table_cheat_sheet.md
Last active August 26, 2025 04:24
Emacs lisp syntax table cheat sheet

Emacs lisp syntax table cheat sheet

Syntax character Syntax class
or - Whitespace characters
w Word constituents
_ Symbol constituents
. Punctuation characters
@buzztaiki
buzztaiki / cant_pass_closure_to_treesit_query.md
Created August 25, 2025 07:21
treesit query の pred に closure は渡せない

treesit query の pred に closure は渡せない

それはそう。

(let* ((pred (lambda (captured) (eq (treesit-node-start captured) (treesit-node-start node))))
       (query `(((element
                  (start_tag
                   (tag_name) @tag_name
 (attribute
@buzztaiki
buzztaiki / configure_lsp_bridge.md
Created August 22, 2025 14:18
lsp-bridge を使う

lsp-bridge を使う

とりあえず設定してみただけ。独自食強すぎてちょっないなって思った。補完もインターフェースとかも全部独自。すごい。

すごいなって思ったら、https://github.com/emacs-eaf/emacs-application-framework の人でなんか納得した。

(use-package lsp-bridge
  :quelpa (lsp-bridge :fetcher github :repo "manateelazycat/lsp-bridge"
 :files (:defaults "*.py" "python-lsp-bridge" "acm/*" "core" "langserver" "multiserver" "resources"))
@buzztaiki
buzztaiki / parse_xml_with_no_prefix_ns_in_linux_cli.md
Last active August 16, 2025 01:52
prefix 無しの namespace が付いた xml を cli でパースする

prefix 無しの namespace が付いた xml を cli でパースする

以下のファイルを例とする

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0">
  <version>0.0.1</version>
</project>
@buzztaiki
buzztaiki / 00_script_for_azure_vm_price_and_spot_evictions.md
Last active July 7, 2025 17:36
Azure VM の料金やスポット退去率を出すスクリプト
@buzztaiki
buzztaiki / rootless-docker.md
Last active July 15, 2025 03:56
rootless docker あれこれ

rootless docker あれこれ

とりあえずは https://wiki.archlinux.org/title/Docker#Rootless_Docker_daemon に従えばインストールできて普通に動く。コンテナ側で root ユーザーが作ったファイルのオーナーがホスト側では自分になってくれるのがとても助かる。

/etc/subuid, /etc/subgid は両方とも以下としている。自分で決めたのか、docker-rootless-extras が設定してくれたのかは覚えてない。

taiki:100000:65536

ベストプラクティス

@buzztaiki
buzztaiki / modus-operandi.yaml
Last active March 28, 2025 19:23
K9s Modus Operandi Skin
# K9s Modus Operandi Skin based on Solarized Light Skin
# https://gist.github.com/buzztaiki/0d30bf0a5c4c9e13b3efdae2b3319d2c
foreground: &foreground default
background: &background default
current_line: &current_line "#404148"
selection: &selection "#404148"
comment: &comment "#505050"
cyan: &cyan "#00538b"
green: &green "#005e00"

Entra 認証を有効にした Azure MySQL に mysql provider で接続するときは azure:// を使わなければいけない

はまったのでメモ。

現象

https://registry.terraform.io/providers/petoju/mysqlazure:// のプレフィックスを使わず authentication_plugin=true の設定にして azure-cli から取得したアクセストークンで MySQl に接続すると timeout まで待った後に 以下のエラーが出る

│ Error: failed to connect to MySQL: could not create new connection: could not connect to server: this user requires mysql native password authentication
@buzztaiki
buzztaiki / workaround_for_wsl2_mount_problem.md
Last active November 22, 2024 02:22
WSL2 で /tmp/.X11-unix/X0 や wayland-0 が消える問題対策

WSL2 で /tmp/.X11-unix/X0 が消える問題対策

どうやら、こんな事が起きてるらしい

  • WSL2 が boot した時に /mnt/wslg/.X11-unix/tmp/.X11-unix にマウントする
  • distro が起動した後 systemd が tmp.mount ターゲットを起動して /tmp が再マウントされる
    • Before=local-fs.target になってる
  • その結果、/tmp/.X11-unix が消えてしまう

対策

とりあえず解決策としては、/etc/fstab/tmp を書いてあげれば tmp.mount より優先されるから問題が解決するっぽい。

@buzztaiki
buzztaiki / who_is_github_actions_bot_user.md
Last active May 17, 2024 18:22
41898282+github-actions[bot]@users.noreply.github.com の正体

41898282+github-actions[bot]@users.noreply.github.com の正体

GHA で commit させたときのユーザーでよく見るあれ。/user/<id> API で確認すると

% gh api /user/41898282 | jq
{
  "login": "github-actions[bot]",
  "id": 41898282,
  "node_id": "MDM6Qm90NDE4OTgyODI=",