wiki:TipAndDoc/misc

Version 31 (modified by mitty, 12 years ago) (diff)

--

  • bwm-ng, dstat といモニタソフトがあった
    • dstat は CPU 利用量やスワップ量など、vmstat, iostat, ifstat で表示できる項目のうち、好きな項目をいっしょに表示できる。しかも xterm 上でカラー表示されるのでわかりやすい。 vnstat は /proc からインターフェースの転送量をとりだして、日ごとなどの集計をする。saidar は System raidar の略か、システムの稼働情報を CURSES で文字端末に一括表示する。 statgrab は /proc 以下のネットワークの稼働情報を snmpwalk のように一覧表示する。sysctl ライクな表示、と man にはかかれている。bwm-ngは I/F ごとの入出力量を CURSES テキストで 0.5秒ごとに表示する。間隔を0.1秒単位で指定できる。
  • cp -av /path/to/src /path/to/dst 2> err.log | tee cp.log
    • cp.log -> コピーされたファイルリスト
    • err.log -> エラーログ
  • wikipedia:fdupes

    fdupes is a program written by Adrian Lopez to scan directories for duplicate files, with options to list and delete them. It first compares file sizes and MD5 signatures, and then performs a byte-by-byte check for verification.

adduser / useradd

  • adduser -> 対話式
    • /home/USERNAME が作られる
  • useradd -> 引数でオプションを与える
    • (デフォルトでは) /home/USERNAME が作られない

find コマンド

. (ドット) コマンド

  • シェルスクリプトと実行方法
    • 現在の環境変数を再設定するにはスクリプトをカレントシェルで実行しなければなりません。このためシェルにはドットコマンドと呼ばれるものが用意されおり、コマンドラインでドット .の後にスペースを置いて実行したいスクリプト名を書きます。
      $ . script
      
    • ドット .を先頭に置くことによりカレントシェルはscriptを自分自身で実行しますので、現在の環境変数を再設定することができます。なお、ドット .に続くscriptには実行権の必要はありません。

mailx

     -E      Do not send messages with an empty body.  This is useful for pip-
             ing errors from cron(8) scripts.

     -s subject
             Specify subject on command line.  (Only the first argument after
             the -s flag is used as a subject; be careful to quote subjects
             containing spaces.)

nologin / false

  • on Ubuntu lucid
  • /usr/sbin/nologin
    This account is currently not available.
    
  • /bin/false
    • nothing output

~/.nofinger

  • s0711489$ finger $USER
    Login: s0711489                         Name: Keniti MITO
    Directory: /XXXXXXXXXXXXX/s0711489      Shell: /bin/bash
    On since Thu Nov 18 13:39 (JST) on ttys004 from 130.158.ABC.XYZ
    On since Thu Nov 18 13:39 (JST) on ttys005
    No Mail.
    No Plan.
    
  • s0711489$ touch .nofinger
  • s0711489$ finger $USER
    finger: s0711489: no such user
    

dd

MySQL

wget

  • |PATCH| support for Content-Encoding in wget

    The attached patch adds the option --accept-encoding-gzip to wget. If you enable this option the line: `Accent-Encoding: gzip' is added to the Header wget sends to the server. If the server responds with `Content-Encoding: gzip' the received data will be decompressed with gzip -d -c -.