Quantcast
Channel: インフラ技術共有サイト
Viewing all 32 articles
Browse latest View live

pcapファイルを分割する。

$
0
0

経緯

tcpdumpで生成したpcapファイルが7.5GBと大きすぎて、wiresharkで読み込むのに時間がかかる。
分割する必要があった。

方法

# 時間での分割
editcap.exe -A 開始時間 -B 終了時間 20151027.pcap *****.pcap

※時間は[yyyy-mm-dd hh:mm:ss]の形式で記載する。

例) 2015-10-27 0:10:00~2015-10-27 0:20:00の間のパケットキャプチャを201510270010_0020.pcapとして抜き出す。
“editcap.exe” -A “2015-10-27 0:10:00” -B “2015-10-27 0:20:00” 20151027.pcap 201510270010_0020.pcap

備考

ヘルプ情報を載せておく。

C:\>"C:\Program Files\Wireshark\editcap.exe" --help
C:\Program Files\Wireshark\editcap.exe: invalid option -- '-'
Editcap 1.12.6 (v1.12.6-0-gee1fce6 from master-1.12)
Edit and/or translate the format of capture files.
See http://www.wireshark.org for more information.

Usage: editcap [options] ... <infile> <outfile> [ <packet#>[-<packet#>] ... ]

<infile> and <outfile> must both be present.
A single packet or a range of packets can be selected.

Packet selection:
  -r                     keep the selected packets; default is to delete them.
  -A <start time>        only output packets whose timestamp is after (or equal
                         to) the given time (format as YYYY-MM-DD hh:mm:ss).
  -B <stop time>         only output packets whose timestamp is before the
                         given time (format as YYYY-MM-DD hh:mm:ss).

Duplicate packet removal:
  -d                     remove packet if duplicate (window == 5).
  -D <dup window>        remove packet if duplicate; configurable <dup window>
                         Valid <dup window> values are 0 to 1000000.
                         NOTE: A <dup window> of 0 with -v (verbose option) is
                         useful to print MD5 hashes.
  -w <dup time window>   remove packet if duplicate packet is found EQUAL TO OR
                         LESS THAN <dup time window> prior to current packet.
                         A <dup time window> is specified in relative seconds
                         (e.g. 0.000001).

           NOTE: The use of the 'Duplicate packet removal' options with
           other editcap options except -v may not always work as expected.
           Specifically the -r, -t or -S options will very likely NOT have the
           desired effect if combined with the -d, -D or -w.

Packet manipulation:
  -s <snaplen>           truncate each packet to max. <snaplen> bytes of data.
  -C [offset:]<choplen>  chop each packet by <choplen> bytes. Positive values
                         chop at the packet beginning, negative values at the
                         packet end. If an optional offset precedes the length,
                         then the bytes chopped will be offset from that value.
                         Positive offsets are from the packet beginning,
                         negative offsets are from the packet end. You can use
                         this option more than once, allowing up to 2 chopping
                         regions within a packet provided that at least 1
                         choplen is positive and at least 1 is negative.
  -L                     adjust the frame length when chopping and/or snapping
  -t <time adjustment>   adjust the timestamp of each packet;
                         <time adjustment> is in relative seconds (e.g. -0.5).
  -S <strict adjustment> adjust timestamp of packets if necessary to insure
                         strict chronological increasing order. The <strict
                         adjustment> is specified in relative seconds with
                         values of 0 or 0.000001 being the most reasonable.
                         A negative adjustment value will modify timestamps so
                         that each packet's delta time is the absolute value
                         of the adjustment specified. A value of -0 will set
                         all packets to the timestamp of the first packet.
  -E <error probability> set the probability (between 0.0 and 1.0 incl.) that
                         a particular packet byte will be randomly changed.

Output File(s):
  -c <packets per file>  split the packet output to different files based on
                         uniform packet counts with a maximum of
                         <packets per file> each.
  -i <seconds per file>  split the packet output to different files based on
                         uniform time intervals with a maximum of
                         <seconds per file> each.
  -F <capture type>      set the output file type; default is pcapng. An empty
                         "-F" option will list the file types.
  -T <encap type>        set the output file encapsulation type; default is the
                         same as the input file. An empty "-T" option will
                         list the encapsulation types.

Miscellaneous:
  -h                     display this help and exit.
  -v                     verbose output.
                         If -v is used with any of the 'Duplicate Packet
                         Removal' options (-d, -D or -w) then Packet lengths
                         and MD5 hashes are printed to standard-error.


[script] oracleの接続確認を実施する

$
0
0

nagios用にbashでoracle接続確認を行うスクリプトを作成してみた。
ヒアドキュメント内で「$」を使うときにはまったが、hnakamurさんのおかげで解決できた。

<< EOF

<< 'EOF'

に変えることで問題なく使用できた。

#!/bin/bash
##################################################
# oracleの接続確認を実施する。
#  パラメータ  1:ユーザ名、2:password、3: NET_SERVICE_NAME
#
##################################################

# 終了コード
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=3
STATUS=${CRITICAL}

if [ $# -ne 3 ]; then
  echo "指定された引数は$#個です。" 1>&2
  echo "実行するには3個の引数が必要です。" 1>&2
  exit ${UNKNOWN}
fi

RESULT=

# end process
trap '/bin/echo "RESULT : "${RESULT}; exit ${CRITICAL}' 1 2 3 15

# 環境変数セット
export ORACLE_HOME=*****
export LD_LIBRARY_PATH=*********
export TNS_ADMIN=**********
export PATH=$ORACLE_HOME/bin

USER=$1
PASS=$2
NET_SERVICE_NAME=$3

# execute
RESULT=`sqlplus -s ${USER}/${PASS}@${NET_SERVICE_NAME} << 'EOF'
set feedback off;
set echo off;
set flush off;
set head off;
SELECT COUNT(1) FROM v$session WHERE type = 'USER';
quit
EOF`

if [ $? -eq 0 ]; then
    STATUS=${OK}
fi

/bin/echo "RESULT : "${RESULT}
exit ${STATUS}

複数のファイル名を一括変換する

mta切り替え

$
0
0

centos5,rhel5系だとデフォルトmtaがsendmail。
mtaをsendmailからpostfix に切り替える手順を記録。

# alternatives –config mta
2 プログラムがあり ‘mta’ を提供します。
選択 コマンド
———————————————–
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:2

シンボリックリンクが切り替わったことを確認。
# ls -l /etc/alternatives/mta
lrwxrwxrwx 1 root root 26 8月 21 15:21 /etc/alternatives/mta -> /usr/sbin/sendmail.postfix

RAC環境でimpdpをパラレルで実行するとき

$
0
0

環境

oracle enterprise 11.2g
rac構成

発生事象

impdpをパラレル実行していたところ、「オープンできません」などのエラーが発生した。

ORA-31693: 表データ・オブジェクト****"."****"は、ロード/アンロードに失敗し、エラーのためスキップされます:
ORA-31640: ダンプ・ファイル"****"を読取りのためにオープンできません
ORA-19505: ファイル"****"の識別に失敗しました。
ORA-27037: ファイル・ステータスを取得できません。

対処方法

権限の問題かと思ったが、どうやら違うらしい。

下記を参考に「CLUSTER=N」をつけたところ、正常にimpdpが完了した。
http://it-memo.info/?p=1368

rac環境でのimpdpパラレルは、全ノードで実行しているとのこと。
そのため、このパラメータを付与する必要がある。

以上

php.iniの設置

$
0
0

前提

phpをコンパイルした時
また、だれかに消されたとき(笑

手順

# which php
/usr/local/bin/php

# php --ini
Configuration File (php.ini) Path: /usr/local/etc/
Loaded Configuration File:         (none)            ★php.iniがない。
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      (none)

# cd /usr/local/etc/

# cp -p (php.ini-production等のテンプレート) php.ini

※配置すると自動的に読み込みを始める。

# php --ini
Configuration File (php.ini) Path: /usr/local/etc/
Loaded Configuration File:         /usr/local/etc/php.ini  ★php.iniを認識した。
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      (none)

※apache設定
# 読み込みがないことをphpinfo()で確認 
・・・
<tr><td class="e">Loaded Configuration File </td><td class="v"> </td></tr>
・・・

# vi httpd.conf
+ PHPIniDir /usr/local/etc

# 再起動
# /etc/init.d/httpd restart

# 読み込みがあることをphpinfo()で確認 
・・・
<tr><td class="e">Loaded Configuration File </td><td class="v">/usr/local/etc/php.ini </td></tr>
・・・

以上

ロードバランサーにて、負荷分散がされない

$
0
0

備忘録

問題

負荷分散をしているが、分散できていない。
片寄があるように見える。

構成

LB -> webサーバ
-> webサーバ

分散ポリシー:learst connection

◆調査
・cookie parsistenceが設定に入っており、この設定のおかげで、クライアントからは同一サーバしか通信しないようになっていた。

この設定はアプリがどのように動くかが重要となるが、アプリ側でセッション維持の仕組みを持っていたりする場合、外してもよい。

以上

Excel2010で挿入タブの一部(テキストボックス等)がグレーアウトになっていて使用できない場合の対処法

$
0
0

問題

Excel2010で挿入タブの一部(テキストボックス等)がグレーアウトになっていて使用できないことに気付いた。
図、グラフなどが対象だった。

解決方法

下記設定になっていることを確認する。
————-
excel ファイル
 -> オプション
  -> 詳細設定
   -> 次のブックで作業するときの表示設定(B)
    -> オブジェクト表示
    -> ○ すべて(A)
      ● なし(オブジェクトを表示しない)(D)
————-

オブジェクト表示を「すべて」に変更する。

参考

http://irumi.sblo.jp/article/43761090.html

以上


条件に一致するセルの隣接セル合計を求める。

$
0
0

条件に一致するセルの隣接セル合計を求めます。

SUMIF(条件検索する範囲, 検索条件, 合計を求める範囲)

条件検索する範囲の中で、条件に合うセルを先頭から順番に調べます。その後、合計を求める範囲の中で合致したセルの隣の合計を出力します。

例) 配信しているドメインごとの一覧から、「*.eonet.ne.jp」「*.plala.or.jp」の総数を抽出したい。

このように設定します。

=SUMIF($A$2:$A$15,D2,$B$2:$B$15)

直接入力するより、セルを参照させるほうが楽ですよね。

2015-10-29_184334

以上

balancer-managerをコマンドで操作するスクリプト

$
0
0

apacheのbalancer-managerを使用しているときに、切り離しや切り戻し作業が面倒であった。
そんな時に発見したもの。

SeonghoonKimさん!参考にさせていただきます。
https://gist.github.com/SeonghoonKim/5385982

以上

dfコマンドの改行

$
0
0

dfコマンドで使用量をとるスクリプトを作っていた際にはまった。

現象

dfが1行で表示されない

# df -i
Filesystem            Inodes  IUsed   IFree IUse% Mounted on
/dev/mapper/centos_tk2--216--17963-root
                     20480000 70482 20409518   14% /
tmpfs                 490539      1   490538    1% /dev/shm
/dev/sda1              64000     43    63957    1% /boot
/dev/mapper/centos_tk2--216--17963-var
                      655360  11065   644295    2% /var

デバイス名が長いと改行してしまうようだ。

回避策

# df -i  --portability
Filesystem                                Inodes  IUsed    IFree IUse% Mounted on
/dev/mapper/centos_tk2--216--17963-root 20480000  70482 20409518   14% /
tmpfs                                     490539      1   490538    1% /dev/shm
/dev/sda1                                  64000     43    63957    1% /boot
/dev/mapper/centos_tk2--216--17963-var    655360  11065   644295    2% /var

以上

apacheのエラーログにclient denied by server configurationと出力される。

$
0
0

事象

apacheのエラーログにclient denied by server configurationと出力される。

原因

このログ出力は、「ステータスコード エラーログ」を意味します。
そのため、アクセス許可を与えていないディレクトリに接続しているログとなります。

アクセスさせたい場合は、Directoryディレクティブ等を確認してください。

参考

https://httpd.apache.org/docs/2.2/ja/logs.html
http://dabase.com/blog/AH01630:_client_denied_by_server_configuration/
http://izanari-techmemo.blogspot.jp/2013/03/apache-client-denied-by-server.html
http://stackoverflow.com/questions/18392741/apache2-ah01630-client-denied-by-server-configuration

mvコマンドでエラー「inter-device move failed, unable to remove target」が出る。

nfsクライアントにて、ファイルが読めない。実効性のないNFSファイルハンドルです と出力される。

$
0
0

事象

nfsサーバが停止してしまい、クライアント側はハードマウントで常にnfsサーバに対してリトライ通信をしていた。

nfsサーバが復旧し、クライアントはマウントに成功。
しかし、マウントディレクトリにて、ls -lを実行したときに下記のようにパーミッションやタイムスタンプ部分が?になった。
???? ??? ???? ???? zzzz.txt

ファイル自体をls zzzz.txtしてみると「実効性のないNFSファイルハンドルです 」のような文言が出る。

解決

クライアント側で下記コマンドを実行する。
service netfs restart

原因

おそらく、急な接続断により、クライアントOS側にキャッシュが残ってしまったと思われる。
そのため、netfsをリスタートし、クリーンにした。

※netfsは、ネットワーク共有用のクライアントデーモン。

参考

http://darekanoblog.blogspot.jp/2012/09/nfs-nfs.html

以上

DL380 iLO4で System Infomation -> NIC informationでstatusがUnknown表示される

$
0
0

現象

DL380でシステムボード交換後、拡張NICがiLOで認識できなくなった。
OSからは正常に見れる。
iLOのみ

下記のように表示される。
http://fotos.subefotos.com/0379508228a7cf5b3352466819ee696do.jpg
※参考URLより

解決方法

ちょうど同じような悩みを抱えていた人がいた。

http://homeservershow.com/forums/index.php?/topic/9418-hp-gen8-ilo-nic-information-unknown/

システムボードを変えたことで、拡張NICとのファームウェアが合わなくなったようだ。
そのため、拡張NICのファームウェアを最新にしたら、正常に認識できるようになった。

参考

http://homeservershow.com/forums/index.php?/topic/9418-hp-gen8-ilo-nic-information-unknown/

ありがとうございました!

以上


iLO4のTCPポート変更方法

Oracle XML DBをインストールしたい

$
0
0

やりたいこと

oracleにXMLDBをインストールしたい

解決

# su - oracle
$ export NLS_LANG="(文字コード)" 
$ cd /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin
$ sqlplus / as SYSDBA
> @catqm.sql (password) SYSAUX TEMP YES

構文(引用)
catqm.sql (xdb_password) (xdb_ts_name) (temp_ts_name) (secure_file_for_repos)

xdb_password:パスワード
xdb_ts_name:Oracle XML DBに使用する表領域です。
temp_ts_name:一時表領域です。
secure_file_for_repo:YESまたはNO(大文字)
           YESはOracle XML DBリポジトリにSecureFile LOBを使用することを意味します。

参考

https://docs.oracle.com/cd/E16338_01/appdev.112/b70200/xdb02rep.htm#i1034529
https://docs.oracle.com/cd/E16338_01/appdev.112/b70200/appaman.htm

ctrl+s 操作が不能に

$
0
0

悩み

コマンドラインで、ctrl+s を押すとロックがかかってしまう。
疲れているときにたまにやってしまいます(笑

これをなんとかできないかと調べてみた。

解決方法

ctrl+sをやったときは、ctrl+qで解除できる、。

ctrl + sを無効にする。

bashrcに下記のように追記する。
# vi ~/.bashrc
+ if [ “$SSH_TTY” != “” ]; then
+ stty stop undef
+ fi

stty stop undefだけだとscpコマンドで下記のようなエラーがでます。

# scp test localhost:
stty: 標準入力: デバイスに対する不適切なioctlです
test: not a regular file

なので、if [ “$SSH_TTY” != “” ]; then ~~~ fi を入れます。

◎参考
http://linux.just4fun.biz/%E9%80%86%E5%BC%95%E3%81%8DUNIX%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/Ctrl%2BS%E3%81%AB%E3%82%88%E3%82%8B%E7%AB%AF%E6%9C%AB%E3%83%AD%E3%83%83%E3%82%AF%E3%82%92%E7%84%A1%E5%8A%B9%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95.html

こちらに詳しく書いてありました。

友人の部屋紹介☆ I will introduce a friend of the room ☆

$
0
0

こんばんは。
当サイトに毎度見に来てくれてありがとうございます。

友人が民泊で部屋をオープンさせました☆

めちゃくちゃきれいなお部屋なので、紹介させていただきます☆

大阪に1人、2人で遊びや仕事に行く人は使ってください^^
まずはどのような部屋かみてください☆

good evening.
Thank you for coming to see every time on this site.

Friend was allowed to open a room in Guest houses ☆

So insanely clean rooms, we will introduce ☆

Please use the people who go in play and work in Osaka ^^
Please look at what kind of room First ☆

友人の部屋 Friends of the room
https://www.airbnb.jp/rooms/11535088

※airbnb未登録の方はこちらから airbnb unregistered person from here
www.airbnb.jp/c/8ad13d?s=8

下記部屋写真です


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeゲストハウス


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeゲストハウス


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期レンタルアパートメント


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期レンタルアパートメント


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期レンタルアパートメント


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeゲストハウス


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期賃貸アパート


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeゲストハウス


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期レンタルアパートメント


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeゲストハウス


Cozy room!Close to Namba/Dotonbori

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chome, Ōsaka-fu, 日本

Opening sale by May 2016! Located VERY convenient area!! -2min by subway or 15min walk to Namba/Dotonbori -Many restaurants nearby. -Portable and fixed wifi can be used. -Completely private room….

Ōsaka-shi Naniwa-ku Ebisuhonmachi 1 Chomeの短期賃貸アパート

※airbnb未登録の方はこちらから
www.airbnb.jp/c/8ad13d?s=8

iphoneの電池減り軽減措置について

$
0
0

iphoneの悩み

電池の減りが激しい

対応方法

1) バックライトを暗くする。
IMG_1449

2) 設定->通知から通知設定を最低限のものにします。
アプリインストール時にすべて通知するように設定されます。
なので、通知が不要なものはすべて設定を解除します。
IMG_1448

IMG_1452

IMG_1453

また、IOSアップデートをすると、すべてのアプリが通知するように戻ることがあります。。

これで、なにもしなくても2日以上もつようになります。

以上

Viewing all 32 articles
Browse latest View live