メンテナンスモードで「fstab」の書き込みができなくなった場合の対処方法

LinuxサーバーでHD故障でディスクを外してたりして再起動しました。故障したHDの「fstab」の故障したHDのマウントしている箇所のコメントアウトを忘れていたので、起動時に失敗しました。
画面ではメンテナンスモードに移 ...
ModSecurityでホワイトリスト・ブラックリストを追加

無料のWAFの「ModSecurity」でホワイトリストとブラックリストを設定する方法を説明します。「ModSecurity」のインストール方法は「無料のWAF(Web Application Firewall)のModSecurit ...
一時的にManページを日本語で表示する

以前の記事で「CentOS manコマンドを日本語表示にする」で、manページを日本語に変更する方法を紹介していました。
以前の方法では環境自体が日本語環境になるので、普段は英語環境のほうが良いってユーザーもいるかと思います。 ...
dovecotの設定内容の確認(doveconf)

メールサーバーの設定を見直していて、Dovecot側設定一覧を確認したくて、postfix の「postconf」のようなコマンドがないか探していたら「doveconf」のコマンドがありました
$ doveconf# 2.2.3 ...シェルスクリプトで特定の文字がある場合の分岐

シェルスクリプトの「if」文で特定の文字が含まれる場合の分岐は、 ] のように検索したい文字を*で囲みます。「*」は任意の文字列を表すワイルドカードとして使用されています
以下のシェルスクリプトでは、変数内(VARNAME ...
SSL証明書のチェックで脆弱性のまたは強度の弱い暗号スイートを使用している可能性の警告

CentOS 6で運用しているサーバーでSSL証明書を更新して、CMANの「SSLチェック【証明書・プロトコル・暗号スイート確認】」でSSL証明書をチェックすると下記のように「脆弱性または強度が弱い暗号化スイートを使用している可能性が ...
gzファイルをgrepで文字列検索する

過去のログファイルをgrepで検索する機会が多いと思いますが、ログファイルのファイルサイズの容量を小さくする為に「gzファイル」で圧縮されているケースがあります。今までは下記のように、zcat で展開してからgrep していました
無料のWAF(Web Application Firewall)のModSecurityを導入

ModSecurityは、オープンソースで開発され無料で利用できるWAF(Web Application Firewall)です。
WAPはApache・Nagios等のWebサーバーからHT ...
rsyncコマンドでパーミッションエラーが表示される

rsyncコマンドを利用してコピーすると以下のようにエラーがでます
$ rsync -avz --delete --rsync-path="sudo rsync" 192.168.0.1:/var/www/html//backu ...awkでファイル内の値を集計

awkコマンドを利用すると簡単にファイル内のある数値を集計できます。
下記のような数字が入っているファイルがあります
XFSファイルシステムでのディスク容量の拡張

使用しているクラウドで、ディスクの空きが少なくなってきたので、ディスク容量拡張する事にしました。
クラウドのサポートページにディスク容量を拡張する下記のような手順がありましたが、ファイルシステムがext4だったので、xfs ...
SNMPを利用して1日の通信量を取得する

最近のクラウド、VPSでは管理画面で外部との通信量はクラウドやVPSの管理画面で確認できますが、物理サーバーでYAMAHAのルーターにつながっているサーバーのインターネット回線の通信量を計 ...
CUI環境でネット速度を測定する方法【speedtest-cli】

CentOSのCUI環境で高負荷の状態ではないのにコンソール操作の反応が遅いので回線速度が遅くなっているかも思って、回線速度を調べようと思ったのですが、GUIのブ ...
「新しいBing」でプロセスを監視するシェルスクリプトを作成

前回はChatGPTでプロセス監視の記事(ChatGPTでプロセスを監視するシェルスクリプトを作成)を書きましたが、マイクロソフトの「新しいBing」も使用できるようになったので、こちらでもプロセス監視のシェルスクリプトを作って貰いま ...
cronでS3のファイルをダウンロードするシェルスクリプトを実行するとダウンロードできない

AWS CLIで、s3からファイルをダウンロードするシェルスクリプトがあって、シェルスクリプトを実行すると問題なく実行できてCron経由だとエラーになる状況でした
s3からダウンロードするスクリプトは下記のようになっています ...