SSL証明書のチェックで脆弱性のまたは強度の弱い暗号スイートを使用している可能性の警告

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

過去のログファイルをgrepで検索する機会が多いと思いますが、ログファイルのファイルサイズの容量を小さくする為に「gzファイル」で圧縮されているケースがあります。今までは下記のように、zcat で展開してからgrep していました
acme.sh でSSL証明書発行時にエラー

古いサーバーでPythonの関係と思いますが、「Certbot」を利用できないので、Bashで書かれている「acme.sh」でLet’s EncryptのSSL証明書を発行しました。acme.shは、Bashで書かれている ...
awkでファイル内の値を集計

awkコマンドを利用すると簡単にファイル内のある数値を集計できます。
下記のような数字が入っているファイルがあります
SNMPを利用して1日の通信量を取得する

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

CentOSのCUI環境で高負荷の状態ではないのにコンソール操作の反応が遅いので回線速度が遅くなっているかも思って、回線速度を調べようと思ったのですが、GUIのブ ...
cronでS3のファイルをダウンロードするシェルスクリプトを実行するとダウンロードできない

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

シェルスクリプトで全ての引数だけfor文でループ処理するには、下記のようなコードになります
#!/bin/bashfor i in "${@}"; do echo $idonefor文の構文は以下のようになります
f .../bin/bash^M: bad interpreter: No such file or directory の時の対処法

いつもは、LinuxにSSHログインしてvim コマンドでシェルスクリプトを作るのですが、Windowsでテキストエディタでシェルスクリプトで作ると改行コードが「\r\n」で保存されて、シェルスクリプトを実行すると下記のようなエラーに ...
nohupで実行した出力結果を、nohup.out以外のファイルに保存する

nohupを実行すると、コマンド実行時の標準出力・標準エラーは「nohup.out」のファイルに追加されます。
ファイルが肥大したり、以前の ...
SSHログインでログイン失敗を確認する方法

CentOSでは、SSHログイン・コンソール操作に関するログは「/var/log/secure」に保存されています
Debian, Ubuntuでは、SSHログイン・コンソール操作に関するログは「/var/log/auth ...
ディレクトリ内のファイルをzipで圧縮する

ディレクトリ内のファイルをzipファイルに圧縮するには「zip」コマンドを圧縮できます
書式は「zip -r 」になります。「-r」でサブディレクトリを含めて圧縮できます
zip -r example_com.zi ...Linuxで使用しているポートを確認する[Netstat]

Linuxで使用しているポートを確認する方法は、lsof、ss、netstat、nmap等ありますが、本記事では「netstat」を利用した方法を紹介します
「netstat -atun」とコマンドを打つと以下のようにLi ...
ibdata1 肥大化対策

CentOS 7で運用している、少し古めのWebサーバーでMySQLの領域が増えてきたので不要なDBを削除しても容量が減りません。MySQLのdatadirを確認すると、ibdata ...
実行中のコマンドをバックグランドで実行する

100G以上ある大きなデータベースをエクスポートしたら数時間かかりそうで、実行中のコマンドをバックグランドに回したくなりました。コマンド実行時に「nohup」を使えばいいですが忘れていました
実行途中でバックグランドで実行 ...