/var/log/wtmp の内容を確認する

ログインに成功したユーザーのIPアドレスの履歴を調べたくて、履歴が記載されているファイルの「/var/log/wtmp」を確認しようと思いましが、このファイルはバイナリファイルで「cat」,「vi」等のコマンドでは内容を確認できません ...
CentOS Stream 9 に移行しました

以前は、Rockylinux 8を使用していましたが、CentOS Stream 9が昨年の12月にリリースされRockylinux 9、AlmaLinux 9 もVultr でサポートされたので、Rockylinux 8からCent ...
Nextcloud の警告「メモリキャッシュが設定されていません。」

Nextcloud で「概要」→「セキュリティ&セットアップ警告」を確認すると、警告メッセージが表示されてました。
メモリキャッシュが有効になっていない場合や ...
Cockpit で、SSL証明書導入してSSL化

Web UI 上で Linux サーバの管理ができる「Cockpit」ですが、通常だと or のような、URLにアクセスすると利用できます。
CentOS で「whois」コマンドを利用する

管理しているドメインで、有効期限を近付いてくると管理しているレジストラからメールが来るのですが、自動更新しなかったりして更新忘れ怖いので、有効期限を定期的にチェックする方法が無いか調べていたら「whois」コマンドがありました。これを ...
curlでcookie情報を取得・送信して利用する

curlでログイン情報をPOST情報を送信してログインしたり、cookieを保存したり、送信する方法を説明します。
wgetコマンドで、cookie情報を保存・送信する場合「wgetで ...
dnf コマンドで特定のパッケージをアップデートしない

dkf update –exclude とすると、指定したパッケージはアップデートから除外されます。
下記では、「kernel」・「centos」とマッチするのを ...
nginxに変更したらメモリ不足なったので、php-fpmを設定を見直し

VPSをサーバーをLightsailに変更した際に、Apacheを使っていたWEBサーバーをnginxに変更しました。始めは問題なく動作していたのですが、しばらくするとNe ...
シェルスクリプトで変数内の改行を有効にする

シェルスクリプトを改行を含まれる変数をechoコマンドなどで表示した場合に、下記のように改行がスペースに変換される場合があります。
$ cat test.sh#!/bin/bashTEST="1 ...cron実行時に環境変数を読み込む

cronに登録しているスクリプトでログに特定の文字を含むとメールするスクリプトがあります。メールする本文やタイトルに日本語文字が場合に文字化けが発生しました。
スクリプト単体だと ...
PSコマンドでプロセスの起動時刻を調べる

PSコマンドでプロセスの起動時間を確認する方法
プロセスの起動時間を確認しようと「ps -ef」,「ps aux」で確認しても起動時間は表示されません
※ grep -v grepのオプションは、grepコマンドの ...
lsコマンド 容量を見やすい単位で表示(MB,GBなど)

lsコマンドなどで容量を自動でMB,GBなど見やすい単位で表示にする方法は、オプションで「h」を使用します
通常ですと、以下のようにバイト単位で表示されます