2016-01-01から1年間の記事一覧

d.hatena.ne.jp

#!/bin/sh while read linedo arg1=`cat script.txt | awk '{print $1}'` sh expect2.sh $arg1 if [ $? -ne 0 ]then echo "BREAK" break fi done

#!/bin/sh /etc/init.d/crond stop >> /dev/null if [ $? -eq 0 ]then echo "OK"exit 0 fi /etc/init.d/crond start >> /dev/null if [ $? -eq 0 ]then echo "Successful" fi

変更版

[root@chefserver ~]# cat expect2.sh#!/bin/sh HENSU=$1 expect -c " set timeout 10 spawn ssh kenken@$HENSU expect \"s password:\" send \"kenken\n\" expect \"~]\" send \"su -\n\" expect \"パスワード:\" send \"kenken\n\" send \"sh /home/kenken…

実行している側の中身

#!/bin/sh /etc/init.d/crond stop >> /dev/null if [ $? -eq 0 ]then echo "Successful" fi /etc/init.d/crond start >> /dev/null if [ $? -eq 0 ]then echo "Successful" fi

expectコマンド

#!/bin/sh while read HENSUdoexpect -c " set timeout 10 spawn ssh kenken@$HENSU expect \"s password:\" send \"kenken\n\" expect \"~]\" send \"su -\n\" expect \"パスワード:\" send \"kenken\n\" send \"sh /home/kenken/script\n\" expect \"OK\" …

procpsのgetstat関数の謎

unsigned int tog=0; /* toggle switch for cleaner code */ tog= !tog; この場合 仮にtogに値が1、または10等が変数に格納されている場合 togの値が0になる。 次に、togの値が0の場合は togの値が1になる 毎回、新しいデータが0に入り、前0で入っていたデー…

RHELのサポートについて ELSってなんだ

RHELには以下の二つのサポート終了がある ①サポート終了日 ②サポート終了日(ELS) 延長ライフフェーズ:別途有償のアドオン扱い。バグフィックス、セキュリティフィックスが行われる。運用フェーズ3の終了日の3年後以降のRed Hatが決定した日付まで 別途有償…

vmstatの表示の意味

マニュアル抜粋 CPU これらは CPU の総時間に対するパーセンテージである。 us: カーネルコード以外の実行に使用した時間 (ユーザー時間、nice 時間を含む)。 sy: カーネルコードの実行に使用した時間 (システム時間)。 id: アイドル時間。Linux 2.5.41 以前…

teramacroでうまくいかなかった部分

logdir = 'C:\Users\yoshida\Desktop\teramacro\'; うまくいかなかった3点 ①ディレクトリの最後に¥が必要だったこと ②logdirの場合は、「’’」が必要なこと ③最後に「;」が必要だったこと

はじめてのteramacro

パクリまくりのteramacro ; sample macro of Tera Term;; File: ssh2login.ttl; Description: auto login with SSH2 protocol; Environment: generic; Update: 2016/4/5; Author: kenkenken0102 username = 'root' ; 「nike」をログインに使用するユーザー名…

修正

コメント行を抜いてこれだけで動作することを確認 ■view auth-system.conf.ext passdb { driver = pam} passdb { driver = shadow} userdb { driver = passwd } ■view 10-auth.conf auth_mechanisms = plain !include auth-system.conf.ext ■view 10-mail.co…

Redhat7u1でpostfixとdovecotをとりあえず動作させる設定

■/etc/postfix/main.cf myhostname = saflweb.resresii.netmydomain = resresii.netmyorigin = $mydomainhome_mailbox = Maildir/ queue_directory = /var/spool/postfixcommand_directory = /usr/sbindaemon_directory = /usr/libexec/postfixdata_director…

postfixとdovecotの基本設定

とりあえずpostfixとdovecotを動作させたい場合の設定 Redhat7 update1 まずはpostfixから Version : 2.10.1 [root@saflweb postfix]# cat main.cfmyhostname = saflweb.resresii.netmydomain = resresii.netmyorigin = $mydomainhome_mailbox = Maildir/ qu…