Skip to content

Linux

Ubuntu 24.04LTS へ peco をインストールする

peco は Python で書かれた percol をベースに、同じコンセプトを Go 言語で実装したもの、だそうです。 percol も peco もかなり歴史があり、開発されてから 10 年程度経過しているようです。 peco の GitHub には以下のように書かれています。

peco (pronounced peh-koh) is based on a python tool, percol. percol was darn useful, but I wanted a tool that was a single binary, and forget about python. peco is written in Go, and therefore you can just grab the binary releases and drop it in your $PATH.

peco can be a great tool to filter stuff like logs, process stats, find files, because unlike grep, you can type as you think and look through the current results.

For basic usage, continue down below. For more cool elaborate usage samples, please see the wiki, and if you have any other tricks you want to share, please add to it!

今回は peco を Ubuntu 24.04LTS へインストールする手順をメモしておきます。

Amazon Linux 2023 + Apache + mod_auth_mellon + Entra で SSO を設定する

mod_auth_mellon というモジュールを利用すると Apache でも SAML 認証による SSO を実施出来るようになります。 mod_auth_mellon を利用すると「Web サーバ上のコンテンツやアプリケーションに手を加えずに SSO 化出来る」為、便利です。 今回は Amazon Linux 2023 上で mod_auth_mellon を利用して Entra と SAML 認証し、SSO 出来るようにする手順をメモしておきます。

Amazon Linux 2023 + GitLab で TCP/22 を GitLab 用に設定する

先日、Amazon Linux 2023 へ GitLab をインストールする というメモを書きました。 公式サイトの gitlab-sshd によると Omnibus 版 GitLab の場合、GitLab で SCP 機能を有効化する場合は以下の設定をしろ、という記載があります。

/etc/gitlab/gitlab.rb
gitlab_sshd['enable'] = true
gitlab_sshd['listen_address'] = '[::]:2222' # Adjust the port accordingly

ですが、OS 標準の sshd を TCP/22 以外へ設定し、その代わりに GitLab に TCP/22 を利用させようとしても「GitLab がポートを Listen しない」という事象が起こりました。 この問題を解決するには以下のように capset 実行します。

sudo setcap 'cap_net_bind_service=+ep' /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-sshd

その上で GitLab の設定ファイルである /etc/gitlab/gitlab.rb へ以下のように設定します。

/etc/gitlab/gitlab.rb
gitlab_sshd['enable'] = true
gitlab_sshd['listen_address'] = '0.0.0.0:22'

あとは GitLab を再起動します。

sudo gitlab-ctl reconfigure

これで GitLab が TCP/22 を Listen するようになりました。

cisshgo で擬似的に Cisco デバイスを再現する

「SDN コントローラのサウスバンド側に Cisco デバイスを用意したい」「Ansible から Cisco デバイスを操作するテストをしたい」といった場合に、擬似的に Cisco デバイスを再現する cisshgo を利用することが出来そうです。 cisshgo を実行すると以下の動作をするようです。

  • デフォルトでは TCP/10,000 〜 10,049 まで 50 セッション分の SSH を待ち受ける
  • 登録済みの Cisco コマンドに対して、決まった出力を応答する

「決まった出力を応答する」という振る舞いをする為、例えば「CLI で設定」を実施してもコンフィグには反映されませんので、その点には注意が必要です。 今回は cisshgo を利用する方法をメモしておきます。

Amazon Linux 2023 へ GitLab をインストールする

以前に以下のメモを書きました。

インストール手順は公式サイトの GitLab Self-Managedのインストール に記載されています。 今回は Amazon Linux 2023 へ GitLab をインストールする手順をメモしておきます。

Ubuntu 24.04LTS へ docker / docker-compose / docker-purge をインストールする

以前に以下のメモを書きました。

Ubuntu へ Docker をインストールする手順は Install Docker Engine on Ubuntu に書かれています。 内容はほぼ同じですが、今回は Ubuntu 24.04LTS へ Docker エンジンと関連ソフトウェアをインストールする手順をメモしておきます。