スキップしてメイン コンテンツに移動

投稿

DNS の TTL と minimum値

TTL:存在することをキャッシュしておく時間。 minimum:存在しないことをキャッシュしておく時間。 なので、example.com ドメインに新しく hoge.example.com というホストを追加する場合、事前に TTLを短くしておいても minimum値が長かったら、minimum値の間は名前解決できない。

連番ファイルを100個作る

連番ファイルは # touch file{1..100} ってすれば、file1からfile100という空っぽのファイルを作ってくれる。 # touch file{001..100} ってすれば、file001, file002, ...みたいにゼロ埋めしてくれて桁が揃う。 10KBのファイルを100個作りたかったら # dd if=/dev/zero of=file bs=1024 count=10 ってやって10KBのファイルを作ってから # for i in `seq -w 1 100`; do cp file file${i}; done ってやれば、file001, file002, ...って作れる。

wgetでサイトをバックアップ

これでいけるかと。 wget -e robots=off\ --output-file=./wget.log\ --no-cache\ --html-extension\ --convert-links\ --page-requisites\ --restrict-file-names=nocontrol,windows\ --domains=www.example.com\ --no-parent\ --mirror\ --wait=1\ --waitretry=1\ --timeout=5\ http://www.example.com/ WordPressサイトは、feedを取得しないようにするとこうなる。 wget -e robots=off\ --output-file=./wget.log\ --no-cache\ --html-extension\ --convert-links\ --page-requisites\ --restrict-file-names=nocontrol,windows\ --domains=www.example.com\ --no-parent\ --mirror\ --wait=1\ --waitretry=1\ --timeout=5\ --exclude-directories=/feed\ http://www.example.com/ あと、コメントのフィードリンクがページ中にあると、せっかくダウンロードしたページがフォルダに変わってしまって feed っていうファイルだけになってしまうので、先にこちらを参考にlinkを消してください。 ■[WordPress] コメントの RSS フィードリンクを削除する http://jz5.jp/2013/11/23/remove-wordpress-comment-rss/ remove_action('wp_head', 'feed_links_extra', 3); だけ追加してもOKだった。 その他、wget のオプションはここがすごくわかりやすかった。 ■ダウンロードコマンドwg...

apachectl fullstatus の Request 列の改行を制御する

[root@websv ~] # which apachectl /usr/sbin/apachectl [root@websv ~] # less /usr/sbin/apachectl ... # |||||||||||||||||||| START CONFIGURATION SECTION |||||||||||||||||||| # -------------------- -------------------- # # the path to your httpd binary, including options if necessary HTTPD='/usr/sbin/httpd' # # # a command that outputs a formatted text version of the HTML at the # url given on the command line. Designed for lynx, however other # programs may work. if [ -x "/usr/bin/links" ]; then LYNX="/usr/bin/links -dump" else LYNX=none fi # # the URL to your server's mod_status status page. If you do not # have one, then status and fullstatus will not work. STATUSURL="http://websv:80/server-status" ... [root@websv ~] # man links ... -dump-width (alias for document.dump.width) Width of the dump output. ... [root@websv ~] # /usr/bin/links -dump http://websv:80/server-status/ ... Srv PID Acc M CPU SS Re...

MySQL サーバーシステム変数 のデフォルトを確認する方法

サーバーのコンパイル時のデフォルトおよび読み取られるオプションファイルに基づいて、サーバーが使用する値を表示するには、次のコマンドを使用します。 mysqld --verbose --help すべてのオプションファイルの設定を無視し、サーバーのコンパイル時のデフォルトに基づいてサーバーが使用する値を表示するには、次のコマンドを使用します。 mysqld --no-defaults --verbose --help 実行中のサーバーによって使用される現在の値を表示するには、SHOW VARIABLES ステートメントを使用します。 引用:MySQL 5.6 リファレンスマニュアル 5.1.4 サーバーシステム変数 https://dev.mysql.com/doc/refman/5.6/ja/server-system-variables.html

yum の使い方

インストール yum install hogehoge アップデートの確認 yum check-update アップデート yum update hogehoge 削除 yum remove hogehoge インストール済みパッケージ一覧 yum list install 旧バージョンも含めてパッケージ一覧を表示する yum --showduplicates list hogehoge