2013年6月26日 星期三

[備忘]ProFTPD Server Log - xferlog 分析

以下文章轉貼資料來源:
1.http://www.the-art-of-web.com/system/xferlog/#.UcsA9Pl8k9s
2.http://www.linuxweblog.com/blogs/wizap/20080129/analyzing-proftpd-xferlog-file


 The xferlog Format
The default format of the xferlog for ProFTP contains the following information on each line:
current-time
Thu June 27 01:24:47 2013
transfer-time
whole seconds
remote-host
file-size
size of transferred file in bytes
file-name
transfer-type
a = ascii; b = binary
special-action-flag
C = compressed; U = uncompressed; T = tar'ed; _ = no action was taken
direction
o = outgoing; i = incoming; d = deleted
access-mode
a = anonymous; r = real
username
service-name
usually ftp
authentication-method
0 = none; 1 = RFC931 Authentication
authenticated-user-id
user id or '*'
completion-status
c = complete; i = incomplete
The three characters following the file name represent the transfer-type (ascii or binary), any special actions (usually _ meaning none) and the direction (outgoing, incoming or deleted).
  1. ascii format:
    • a _ i (uploaded)
    • a _ o (downloaded)
    • a _ d (deleted)
  2. binary format:
    • b _ i (uploaded)
    • b _ o (downloaded)
    • b _ d (deleted)

Now, to extract a list of all successfully uploaded files
(查已上傳成功的檔案):

awk '($12 ~ /^i$/ && $NF ~ /^c$/){print $9}' xferlog

(查已被下載的檔案):

awk '($12 ~ /^o$/ && $NF ~ /^c$/){print $9}' xferlog

(查已刪除的檔案):
awk '($12 ~ /^d$/ && $NF ~ /^c$/){print $9}' xferlog


and uploads that were unsuccessful(查上傳未完成的檔案):
awk '($12 ~ /^i$/ && $NF ~ /^i$/){print $9}' xferlog

2013年6月14日 星期五

A fatal error occurred while trying to sysprep the machine


機器型號: ASUS BM 6620

作業系統環境:Windows 7 SP1 64bit (使用英文語系)

動作: 執行Sysprep系統封裝

錯誤訊息:A fatal error occurred while trying to sysprep the machine

注意!!!如全新系統環境為Win 7 SP1 台灣-繁體中文是可正常執行Sysprep的,如上錯誤訊息 "A fatal..."是在Win 7 SP1 英文語系環境下執行Sysprep所遇到的問題.


兩種解決方法:
一. Ctrl + F9 使用快速鍵還原,系統還原出廠後將 Windows Media Player Network Sharing Service服務停用,即可順利執行Sysprep封裝動作

二.使用ASUS BM6620系統出廠還原光碟,還原後即可順利執行Sysprep封裝動作


    (預設Windows Media Player Network Sharing Service服務是停用的)



Sysprep已知問題:
啟用 Windows Media Player 共用時執行 Sysprep,可能會發生錯誤,所以在執行Sysprep工具前要先將Windows Media Player Network Sharing Service服務停用

參考連結:
http://technet.microsoft.com/zh-TW/library/dd349350(WS.10).aspx

2012年6月11日 星期一

[筆記]備忘:Centos6.2 安裝JAVA、Tomcat套件與設定

Centos6.2 安裝JAVA、Tomcat套件
#yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps

# rpm -qa java*jdk tomcat6  //查詢套件版本
java-1.6.0-openjdk-1.6.0.0-1.43.1.10.6.el6_2.i686
tomcat6-6.0.24-36.el6_2.noarch
# rpm -qc tomcat6 | grep -E 'server|users'
/etc/tomcat6/server.xml  //查詢相關設定檔路徑
/etc/tomcat6/tomcat-users.xml

設定環境檔變數
#!vi /etc/profile    //加在最底部即可
============================================
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib
export PATH JAVA_HOME CLASSPATH
============================================

建立一個名為server.jsp用來判斷目前Tomcat服務是由哪一台叢集主機來負責
===================================================================
<%@ page contentType="text/html; charset=utf8" %>

<%@ page import="java.net.InetAddress" %>

<html>

<head>

<title>Server hostname and ip in jsp</title>

</head>

<body><h1>

  <%String ip = "";

  InetAddress inetAddress = InetAddress.getLocalHost();

  ip = inetAddress.getHostAddress();

  out.println("Server Hostname is: " +inetAddress.getHostName());%><br>

  <% out.println("Server IP Address is: "+ip); %><br>

</h1></body>

</html>
======================================================


2012年5月29日 星期二

Centos 6.2 軟體 Raid 1 Bug 解決方法(錯誤訊息:Kernel Panic -- not syncing- attempted to kill init)

經Google查是 drauct造成的Bug 
官方:http://bugs.centos.org/view.php?id=5400
文中最後提到解決方法
latest dracut fixes the issue:
don't forget to rebuild your initramfs once you have installed the latest dracut version! 

造成的問題現象:
2顆硬碟做Raid 1,當硬碟壞掉一顆後, 重開機會出現如下訊息,
Kernel Panic -- not syncing- attempted to kill init


解決方法步驟
1.更新dracut
#yum -y install dracut

2.更新完 dracut 後一定要做,重建initramfs 。
#cd /boot
#mv initramfs-`uname -r`.img initramfs-`uname -r`.img.bak      
#dracut -v initramfs-`uname -r`.img `uname -r`                        
參考資料:http://hi.baidu.com/edelweisszf/blog/item/c63cb30852de628b0b7b8251.html


2011年12月15日 星期四

Linux下支援語系設定檔i18n(解決中文亂碼問題)

裝機後必設定此語系檔
/etc/sysconfig/i18n
================================================
LANG="zh_TW.Big5"
SUPPORTED="zh_TW.Big5:zh_TW:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
================================================

保存退出後,執行如下立即生效 (不需重開機)
#source /etc/sysconfig/i18n


可避免FileZilla上傳多層中文目錄會出現的錯誤訊息
Failed to convert command to 8 bit charset

2011年11月23日 星期三

使用IP查電腦名稱指令

指令: nbtstat -a IP