CPUコア毎のCPU使用率を確認する[mpstat]

CPUのコア毎のCPU使用率を確認するには、「top」コマンドで「1」を入力すれば表示できます
参考記事:topコマンドでコア単位でCPU使用率を確認する
今回はTOPコ ...
特定のユーザーでsudoを利用できるようにする

特定のユーザーで「sudo」コマンドを利用できるようにします。
sudoを許可していないユーザーで「sudo su -」のコマンドを利用すると以下のように「xxx is ...
除外リストにある文字を含む行を削除する方法「シェルスクリプト」

アカウント・ディレクトリ等の一覧のをファイルが有り、そのファイル内で特定の文字を含む行を削除したい場合は、「sed」コマンドを利用すればできます。
その削除したい文字列を除外リストのようなファイルにある場合は、while re ...
echoコマンドで改行コードを入れる方法[Linux]

echoコマンドで改行コード(\n)をいれて、改行したい場合はですが、何もオプションをつけないと改行されません
$ echo "Test\n1234"Test\n1234ただし、echoコマンドを実行すると改行されるので、 ...
sedコマンドでHTMLタグの中身を取得する

HTMLソースで以下のようなタグの場合、<h2>~</h2>に囲まれた「TEST」のみを取得したい場合ですが、sedコマンドを利用するとタグで囲まれた中身を取得できます
<h2>test< ...行頭にゼロに入った数値の文字列で0を解除する【シェルスクリプト】

0で埋められた「001」、「0010」等の文字列になっている数字で、先頭からある「0」を外したい場合があります。
sedコマンド「s/0*\(*$\)/ ...
シェルスクリプトの if文で複数の条件を指定する

シェルスクリプトでif文でAND条件やOR条件を複数指定したい場合ですが、以下のようにすればOKです
if文でAND条件の場合AND条件では「条件1 -a 条件2」と条件を「-a」を付与して続け ...
仮想マシンの時刻がずれが生じた場合(hwclock)

クラウドで運用しているサーバーで時刻が10分ほどずれているサーバーがありました。このクラウドではntpdやchronyで時刻同期をおこなっても、上位のどこかでNTPポート(123ポート)が閉じているようでNTPサーバーで時刻同期ができ ...
MySQLで、ユーザーのパスワード変更

MySQL、MariaDBでの登録していてるユーザーのパスワード変更するには、MySQLにログイン後に「SET PASSWORD 〜」と「mysqladmin」を利用する2つの方 ...
迷惑メール回避対策 DKIM設定【Postfix】

構築したメールサーバのメールがGmailで受信したメールが迷惑メール扱いになっていたりすることは無いでしょうか?
この対策として有効なのが、SPF(Send ...
Gmail、キャリア向けメール送信時に、Postfix 流量制限をする

docomo, au, softbank 等の携帯キャリア向けのメール、Gmailのメールなどは、大量のメールを送信されてると、「554:Transaction failed」等のエラーコードを応答してセッショ ...
wgetでcookieを利用して、ログイン認証のページにアクセスする

前回の「curlでcookie情報を取得・送信して利用する」と同様で、cookieを利用して、ログイン後のページにアクセスします。。今回は「wget」コマンドを使用してアクセスします。
curlでcookie情報を取得・送信して利用する

curlでログイン情報をPOST情報を送信してログインしたり、cookieを保存したり、送信する方法を説明します。
wgetコマンドで、cookie情報を保存・送信する場合「wgetで ...
Apacheのバーチャルホストの一覧表示と内容確認

ApacheでVirtualHost で設定されているドメインの一覧や内容を確認するには、VirtualHost の設定ファイルを見ればわかりますが、複数のVirtualHost を設定している場合は、その設定ファイルを一個一個みるに ...
大きめのCSVファイルをアップロードして際のMySQLのエラー【MariaDB,MySQL】

MySQL(MariaDB)で、大きなCSVファイ ...