@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

複数プロジェクトのGitリポジトリでSSH公開鍵をよしなに切り替える

tl;dr

~/.ssh/config にホスト名のエイリアスを書いて

Host github-project1
  HostName github.com
  IdentityFile ~/.ssh/project1/id_rsa-project1

~/.gitconfig にURLの読み替え設定をすれば

[url "ssh://git@github-project1/"]
  insteadOf = git@github.com:project1/

SSH用のURLで普通に git clone できるはず

$ git clone git@github.com:project1/some-cool-repo.git
Cloning into 'some-cool-repo' ...
remote: Enumerating objects: xxx, done.
remote: Counting objects: 100% (xxx/xxx), done.
remote: Compressing objects: 100% (xxx/xxx), done.
remote: Total xxx (delta xxx), reused xxx (delta xxx), pack-reused xxx
Receiving objects: 100% (xxx/xxx), xx MiB | xx MiB/s, done.
Resolving deltas: 100% (xxx/xxx), done.
続きを読む

DockerでMariaDBのRead-only Replicaを動かす

tl;dr

リードレプリカの command--read-only をつければよい

services:
  primary:
    image: mariadb
    command: --log-bin --log-basename=mariadb --rpl_semi_sync_master_enabled

  replica:
    image: mariadb
    command: --server-id=3 --log-basename=mariadb --rpl_semi_sync_slave_enabled --read-only
    environment:
      MARIADB_MASTER_HOST: primary
続きを読む

Emacsのorg-modeに画像を貼り付けたかのように振る舞う

tl;dr

画面キャプチャを所定のフォルダ1から所定のフォルダ2へコピーしてコピー後のパスをorg-modeのリンクにすれば画像を張り付けたように見える。という発想で関数を ChatGPTに書いてもらった。

続きを読む

ripgrepの結果をファイル名のパスでソートしたい

-j1 オプションをつければよい。

github.com

これが

dir1/file1.rs:blah
dir2/file4.rs:blah
dir1/file2.rs:blah

こうなる

dir1/file1.rs:blah
dir1/file2.rs:blah
dir2/file4.rs:blah

地味に気になってたのをようやく調べた。