2017年は、元旦に「うるう秒」挿入されます

平成29 年(2017 年)1月1日(日)の午前8時59分59秒と午前9時00分00秒の間に「8時59分60秒」を挿入される模様にです
「うるう秒」挿入のお知らせ(NICT)「うるう秒」挿入の ...
Linux でディレクトリ構造のみコピーする

ディレクトリをそのままコピーするのじゃなくて、ディレクトリ構造のみをコピーしたいケースは無いででしょうか?
例えば、メールサーバーを移行した際に、ユーザーのメールボックスの領域だったり、Apacheでバーチャルホストを ...
Server@VPSでyum updateを叩くスクリプト

DTIのServer@VPSで、OSをCentOS 7を使用している場合に、「yum update」を叩くと以下のエラーになります。
Error: systemd conflicts with initscripts- ...
マウントしているファイルシステムの種類を確認

この記事を掲載しているサーバーはServerman@VPSというサーバーを借りて運用しています。クラウドですので、OSインストール作業がなかったので、どのようなファイルシステムで ...
プロセスの生存を監視するスクリプト

Linuxでスクリプトを作っていると、あるプロセスが上がってないとサービス起動するとか、あるプロセスが上がってないとメールするとか、そのような監視プログラムを利用する場合あります。
その都度、以前使用したスクリプトでそ ...
CentOS ハードウェア情報の取得

他のディストリビューションでも使用できると思いますが、LinuxのCentOSでCPUやメモリ等のハードウェア情報を取得したい場合に使用するコマンドを紹介します
CPU情報 取得CPU情報を取得するには「/proc/c ...
変数内に複数の検索する文字列があるかチェックするシェルスクリプト

特定の文字列やエラーなどの文字列が変数内のあったら、処理をわけるという処理が必要なスクリプトを作る機会があったので、そのスクリプトを紹介します
スクリプトは、以下の様な感じの処理です
egrepコマンドで検索する ...タイムゾーンを日本に変更する方法 「Linux」

AWSでAmazon Linux, CentOS を使用しているとタイムゾーンがUTCになっていて日本時間じゃなくて使い勝手が悪かったので変更方法を紹介します
AWS以外でも同じような方法で変更できるかと思います
vimで行番号を表示・非表示にする方法

vimで行番号を表示・非表示にする方法を紹介します
行番号を表示行番号を表示するには、ESCを押したあとに、下記のように「:set number」または「:set nu」と入力します
:set numberまたは ...行番号を付けて出力する(nlコマンド)

ファイルに行番号をつけて出力する方法は、catコマンド、awkコマンド、nlコマンドで出力できます。本記事では、「nlコマンド」を利用した場合の方法を説明します
catコマンドで行番号を表示cat -n <ファイ ...
grepで該当した行の前後を表示する方法

grepでログファイルなどを調べた場合、該当した(パターンマッチした)行だけはなく該当した行の前後や、該当した行の前5行とか、該当した行の前5行とか表示したい場合があります。
その場合は、grepコマンドのオプションの ...
grepで検索文字の行番号を取得

先日、当サーバーへのHPが閲覧できなくなり、SSH接続も重くなりコンソール操作も難しい状況になりました。ServerMan@VPSの管理画面より再起動しても事象は変わりません。
外部に公開しているサービスがApache ...
WordPress DoS/DDoS攻撃 (xmlrpc.phpへの大量アクセス)

先日、当サーバーへのHPが閲覧できなくなり、SSH接続も重くなりコンソール操作も難しい状況になりました。ServerMan@VPSの管理画面より再起動しても事象は変わりません。
外部に公開しているサービスがApache ...
Linux カーネルの脆弱性(CVE-2016-0728 )

Linux Kernel 3.8以降のLinux Kernelで、ゼロデイ攻撃の脆弱性が見つかりました(CVE-2016-0728)。
脆弱性はセキュリティデータや認証鍵、暗号鍵といったデータの保持やキャッシュに使われる「 ...
Apache DoS攻撃対策モジュール【mod_evasive編】

DoS攻撃(Denial of Service attack)は、サーバなどにサービス妨害攻撃またはサービス不能攻撃などと呼ばれています。大量のデータや不正パケットをサーバーに送りつけるなどの不正な攻撃を指します。
A ...