Author Archives: cowman.chiang

Git Server 安裝 (New)

OS: Ubuntu 14.04 Server x64 安裝Gitlab + MySQL + Nginx 系統更新 apt-get update apt-get upgrade -y apt-get dist-upgrade 安裝基本需求 # 記得要先裝vim update-alternatives –set editor /usr/bin/vim.basic sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server … Continue reading

Posted in Git, Nginx, Ubuntu | Leave a comment

更換 apt-get 來源

root@ubuntu:~# vim /etc/apt/sources.list :%s/us.archive.ubuntu.com/tw.archive.ubuntu.com/g 或是 root@ubuntu:~# sed -i ‘s/us.archive.ubuntu.com/tw.archive.ubuntu.com/g’ /etc/sources.list 記得要在apt-get update一下.. 基本上國網 free.nchc.org 應該也可以 但是不知道為什麼一直出錯 如果想要用國網的點,就把tw.archive.ubuntu.com改成free.nchc.org

Posted in Ubuntu | Leave a comment

Shell Script Dialog

Dialog 預設設定通常在個人Home目錄下的檔案”.dialogrc” 可使用指令 “dialog –create-rc ~/.dialogrc” 產生 因為預設底色是青色,結束後會有色塊殘留,所以建議將screen_color調整為黑色 也可在 dialog 指令執行前先指定使用哪一個設定檔案進行dialog “export DIALOGRC=${path}/dialog.installer” 記得離開前把DIALOGRC清空就好 下面是將常用的dialogrc寫成function dialog_msgbox() { #$1 => msgbox的類別{no clear, clear, clear & exit}, $2 => 前視窗的文字說明, $3 => 顯示的資訊文字 case $1 in 0) dialog –backtitle “${backtitle}” –title “$2” … Continue reading

Posted in Shell Script | Leave a comment

Eclipse 安裝 Python 模組

下載 Python 進行安裝 Python 下載連結 安裝過程中記得勾選加入環境變數 開啟 Eclipse => Help => Eclipse Marketplace 搜尋 Python => Go 安裝 PyDev – Python IDE for Eclipse 勾選 PyDev for Eclipse、Pydev Mylyn Integration => Next I accept the terms of the license agreements … Continue reading

Posted in Eclipse, Python | Leave a comment

Eclipse 安裝 PHP 模組

環境:Eclipse Version: Luna Service Release 1 (4.4.1) 開啟Eclipse => Help => Install New Software Work with 選擇 Luna – http://download.eclipse.org/releases/luna 展開 Web, XML, Java EE and OSGi Enterprise Development 勾選PHP Development Tools (PDT) => Next => 安裝 安裝完畢後重新啟動即可

Posted in Eclipse, PHP | Leave a comment

Eclipse 安裝

安裝 jre or jdk Oracle 下載連結 下載Eclipse Eclipse 下載連結 解壓縮後執行

Posted in Eclipse | Leave a comment

Python 註解

# 這是註解~~~ “”” 這也是註解 “””

Posted in Python | Leave a comment

Nginx SSL Enable

環境: Ubuntu 14.04 x64 產生key root@Wordpress:/tmp# openssl genrsa -des3 -out site.key 2048 Generating RSA private key, 2048 bit long modulus ……………………..+++ ………………………………+++ e is 65537 (0x10001) Enter pass phrase for site.key: Verifying – Enter pass phrase for site.key: 2.產生 csr … Continue reading

Posted in Nginx, SSL, Ubuntu | Leave a comment

Apache SSL Enable

環境 CentOS 5.x i386 產生 key [root@Web test]# openssl genrsa -des3 -out site.key 2048 Generating RSA private key, 2048 bit long modulus …………+++ ………………+++ e is 65537 (0x10001) Enter pass phrase for site.key: Verifying – Enter pass phrase for site.key: … Continue reading

Posted in Apache, CentOS, SSL | Leave a comment

Splunk : 計算log檔案在Splunk所佔的大小

計算檔案空間 Splunk 語法: source=”/home/splunk_input_data/imss/2014/log.imss.20141019.0002″ | eval esize=len(_raw) | stats sum(esize) AS sum_esize, count | eval fsize=sum_esize + count | fields fsize Linux指令: grep -v -e “^s*$” /home/splunk_input_data/imss/2014/log.imss.20141019.0002 | wc -c 計算筆數 Splunk 語法: source=”/home/splunk_input_data/imss/2014/log.imss.20141019.0002″ | stats sum(linecount) Linux指令: grep -v … Continue reading

Posted in Linux, Splunk | Leave a comment