Author Archives: cowman.chiang

Tomcat設定https

使用keytool產生RSA cd /usr/java/jdk1.7.0_21/bin/ ./keytool -genkey -alias tomcat -keyalg RSA Enter keystore password: Re-enter new password: What is your first and last name? What is the name of your organizational unit? What is the name of your organization? What is the … Continue reading

Posted in JSP | Leave a comment

Tomcat修改預設port為80

編輯server.xml vim /usr/data/apache-tomcat-7.0.40/conf/server.xml 將8080修改為80後重新啟動tomcat

Posted in JSP | Leave a comment

安裝Tomcat7

安裝jdk 至http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html下載 (此處以jdk-7u10-linux-x64.rpm為例) rpm -ivh jdk-7u10-linux-x64.rpm 設定jdk環境 cat << EOF > /etc/profile.d/java.sh export JAVA_HOME=/usr/java/default export PATH=$JAVA_HOME/bin:$PATH EOF cat << EOF > /etc/profile.d/java.csh set JAVA_HOME=/usr/java/default set PATH=$JAVA_HOME/bin:$PATH EOF . /etc/profile.d/java.sh 安裝tomcat7 至http://tomcat.apache.org/download-70.cgi下載 (此處以apache-tomcat-7.0.40.tar.gz為例) wget http://ftp.twaren.net/Unix/Web/apache/tomcat/tomcat-7/v7.0.40/bin/apache-tomcat-7.0.40.tar.gz tar zxvf apache-tomcat-7.0.40.tar.gz mkdir /usr/data mv … Continue reading

Posted in JSP | Leave a comment

計算檔案數量

Source: http://phorum.study-area.org/index.php/topic,10994.0.html 第一種: 如果只要一般的檔案, 可以用: find . -type f -print | wc -l 如果是要不含目錄的檔案 (含 b, c 之類), 可以用: find . ! -type d -print | wc -l 第二種: 如果單純 “只” 針對普通檔: ls -lR /path/to/dir | grep ‘^-‘ | wc … Continue reading

Posted in Linux | Leave a comment

FTP Download Script

< pre lang=”bash”> !/bin/sh 程式說明:每日將 Mail Log 匯入 Splunk 之 Script 版本時間:2013/05/30 10:40 開發維護:cowman.chiang@udngroup.com 檢查檔案是否存在,存在則移除檔案 避免ftp下載時無法覆蓋檔案以致無法取得新版檔案 function checkfile(){ if test -f “${local_dir}/${1}” then echo “File ${1} exist, remove!” rm “${local_dir}/${1}” else echo “File ${1} not exist” a=1 fi } 設定 … Continue reading

Posted in Linux, Splunk | Leave a comment

Splunk 指定Web服務Port

方法1 登入 Web 後進管理員更改 方法2 修改 web.conf (但是我還是不知道在哪….) 方法3 指令直接更改 (狂推) /opt/splunk/bin/splunk set web-port 443

Posted in Splunk | Leave a comment

Splunk搬移到新主機

{Old-Splunk-server}:service splunk stop {Old-Splunk-server}:tar cvf {檔案名稱} /opt/splunk/ {Old-Splunk-server}:scp {檔案名稱} {帳號}@{New-Splunk-server}:/tmp {New-Splunk-server}:tar xvf /tmp/{檔案名稱} -C / {New-Splunk-server}:下載Splunk Tar安裝檔案 {New-Splunk-server}:tar xvzf {Splunk-Tar-安裝檔案} -C /opt {New-Splunk-server}:/opt/splunk/bin/splunk enable boot-start 就可以依造 {Old-Splunk-server} 的連接設定進行使用 但需要注意因為IP名稱應該會更動,有關IP的部分都要重新設定 包含Clinet端Foward的目標、Syslog server的設定等

Posted in Splunk | Leave a comment

使用IP反查電腦名稱

nslookup {IP} ping -a {IP} nbtstat -A {IP}

Posted in Windows | Leave a comment

定時間看結果 — Watch

WATCH(1) Linux User’s Manual WATCH(1) NAME watch – execute a program periodically, showing output fullscreen SYNOPSIS watch [-dhvt] [-n ] [–differences[=cumulative]] [–help] [–interval=] [–no-title] [–version] DESCRIPTION watch runs command repeatedly, displaying its output (the first screenfull). This allows you to … Continue reading

Posted in Linux | 1 Comment

物件名稱包含變數 + 應用紀錄

Dim s1, s2 As Integer Sub OnSlideShowPageChange() s1 = 1 s2 = 1 With ActivePresentation.Slides(SlideShowWindows(1).View.Slide.SlideIndex) If .Shapes.Title.TextFrame.TextRange.Text = “Windows 安裝Splunk” Then allhide selectphoto (s1) ElseIf .Shapes.Title.TextFrame.TextRange.Text = “Windows 設定 Forward” Then allhide_1 selectphoto_1 (s2) End If End With End Sub … Continue reading

Posted in PowerPoint | Leave a comment