Skip to content

Linux

Ubuntuのqcow2イメージサイズを拡張する

Ubuntu Cloud Images 24.04 LTS Daily Buildからダウンロードしたqcow2イメージをベースに、init-osでカスタマイズして検証に利用しています。しかし「Dockerをインストールする」という手順を追加したところ、ストレージの消費量が1GB以上増えてしまったようで、カスタマイズ時にエラーが発生するようになってしまいました。イメージサイズを拡張することで回避しましたので、その手順をメモしておきます。

dfimageでDockerコンテナイメージからDockerfileを復元する

Dockerfile From Image (dfimage)を使うとDockerコンテナからDockerfileを復元することができます。dfimage自体がDockerコンテナとして提供されており、Dockerエンジンがあれば利用可能です。ただ、毎回Dockerコンテナを実行するのは大変なので、ショートカットするには「エイリアスを設定する」「Pythonスクリプト経由で利用する」といった方法があるようです。今回は後者の「Pythonスクリプト経由で利用する」方法をメモします。

dfimageは仕組み上、Dockerを事前にインストールしておく必要があります。

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 出来るようにする手順をメモしておきます。