山本 和英‎ > ‎

Linuxメモ

自分用のメモです。

Emacs でUTF-8 表示
C-x RET c utf-8 RET C-x C-f ファイル名
もしくは、ファイルに -*- coding: utf-8 -*- をつけておく。

強制的に時刻同期
# /etc/init.d/ntpd stop
# ntpdate NTPサーバー名
# /etcinit.d/ntpd start

手っ取り早くメール
% nkf -j filename | mail メール@アドレス

foreach の使い方
% foreach i (*.txt)
foreach?  echo >> outfile
foreach?  echo $i >> outfile
foreach?  cat $i >> outfile
foreach?  end

/etc/aliases = /etc/postfix/aliases を変更したら
# newaliases

ユーザー(foo)の作成
# adduser -g nlp foo
# passwd foo
# su foo
# ssh-keygen -t rsa
# mv id_rsa.pub authorized_keys; chmod 600 authorized_keys
id_rsa をユーザーに渡して終わり。

yum でエラー: rpmdb: 破損したヘッダインスタンス #2385 を取得しました。スキップします」と怒られる
# yum clean all
# rpm --rebuilddb

アカウントのロック
# passwd -l user    (ロック)
# passwd -u user    (解除)
# passwd -S user    (確認)

at コマンド
# at 13:00 May 18

SELinux の無効化
/etc/sysconfig/selinux 中の SELINUX= を disabled にする

他の計算機から Webサーバーが見えない
とりあえず iptables と ip6tables を切ってみる

/etc/resolv.conf がシステムが勝手に書き換えて困る
/etc/sysconfig/network-scripts/ifcfg-eth0 に書いておく
DNS1="xxx.xxx.xxx.xxx"

起動時のメッセージを表示
/etc/grub.conf 中の rhgb.と quiet を削除
Comments