發表文章

bg5ps - a python txt 2 GS program / ttf2psm.c using true type chinese fonts

filename: bg5ps-1.1b2.tar.gz works under centos 7.2 Support only big5 code compile it and put bg5ps.conf to /etc/bg5ps.conf or ~/.bg5ps.conf gcc -O2 -fomit-frame-pointer ttf2psm.c -o ttf2psm Usage: ./bg5ps -fn kai -if allTSE.txt -of allTSE.ps Configuration:

About QmailToaster ClamAV

About ClamAV From:  Clamav.net ClamAV is an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats. It is the de facto standard for mail gateway scanning. It provides a high performance mutli-threaded scanning daemon, command line utilities for on demand file scanning, and an intelligent tool for automatic signature updates. The core ClamAV library provides numerous file format detection mechanisms, file unpacking support, archive support, and multiple signature languages for detecting threats. The core ClamAV library is utilized in Immunet 3.0, powered by ClamAV, which is a fast, fully featured Desktop AV solution for Windows. In Qmailtoaster, ClamAV works side-by-side with SpamAssassin under Simscan to make sure all incoming email is free of virus and spam. Disable / Enable You can disable (and enable it again) ClamAV per domain or server-wide, make sure you know what you are doing and have a strong reason. Per Dom

firewalld

CentOS-7  CentOS 7 default to  firewalld. It's not recommended to install iptables, please use firewalld yum install iptables system-config-firewall-tui setuptool firewalld default XML directory /usr/lib/firewalld and /etc/firewalld   ===================================================== firewalld  ========== >>> firewall-config ====> firewall-cmd <==== 在firewalld裡面, 是把網路分成幾個區域 (zone). 然後針對zone去設定過濾規則. 我們先看預設設定: [root@c7 ~]# firewall-cmd --get-active-zones public   interfaces: eth0 eth1 所以目前兩個網卡都是被指定在public(對外區域). 然後看看預設public區域的規則: [root@c7 ~]# firewall-cmd --zone=public --list-all public (default, active)   interfaces: eth0 eth1   sources:   services: dhcpv6-client ssh   ports:   masquerade: no   forward-ports:   icmp-blocks:   rich rules: 所以public zone開了DHCP跟SSH服務, 沒有指定port, 沒有限制連線來源, 也沒有開啟NAT功能. DHCP我沒有在用, 所以移掉: [root@c7 ~]# firewall-cmd --zone=public --remove-service dhcpv6-client success 因為eth0是內網, 所以我想把eth0改到trusted(信任區域): [root@

ssh auto login with keygen public key

SSH login without password Your aim You want to use Linux and OpenSSH to automate your tasks. Therefore you need an  automatic  login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call  ssh  from a within a shell script. How to do it First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase: a@A:~> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/a/.ssh/id_rsa): Created directory '/home/a/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/a/.ssh/id_rsa. Your public key has been saved in /home/a/.ssh/id_rsa.pub. The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A Now use  ssh  to create a directory  ~/.ssh  as user b on B. (The directory may already exist, which is fine): a@A:~> ssh b@B mkdir -p .ssh b@B's pass

Advance Tip for VIM 7.X multi-window

圖片
Advance Tip for VIM 7.X  multi-window ======================================= 1. open gvim with multiple windows.     vim -p file1 file2  Open all files in Tab under current directory at once    vi -p ./*.php 2. switch between tabs with :tabn and :tabp    switch between tabs with <gt>go next tab  and <gT> go prev Tab 3. goto Tab2 <2gt> 4. or assign tab function to function key F7 and F8 5. To add new tab :tabe <filename> 6. ZZ to save and quit current window   or juse use :wq or :q! without save ======================================= 7.  Split Window Using windows Ctrl-W s and Ctrl-W v to split the current window horizontally and vertically. You can also use :split and :vertical split (  :sp   and   :vs  ) Ctrl-W w to switch between open windows, and Ctrl-W h (or j or k or l) to navigate through open windows. Ctrl-W c to close the current window, and Ctrl-W o to close all windows except the current one. Starting vim with a -o

tw quote

證交所即時資訊解析 今天是2014/8/1忽然發現舊版的即時資訊拉不下來,上去看才知到舊版已經被停用了, 要取得新版資料(以Json呈現),必須連現以下網址 http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=( tse | otc )_ SYMBOL .tw_ YYYYMMDD &json=1&delay=0 例如 http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_3474.tw _20140801 &json=1&delay=0 可以取得 2014/8/1 當日的華亞科的股價(經測試不打 _20140801 &仍可取得最新資料) 這次的API也可以進行串接,例如同時取得華亞科與精華的股價可以使用 | (pipe符號) 進行串接,例如 http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_3474.tw_20140804 | otc_1565.tw_20140804&json=1&delay=0 取得指數的方式如下: http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch= 指數代號 &json=1&delay=0 給個例子,同時取得上市與上櫃指數 http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch=tse_t00.tw | otc_o00.tw&json=1&delay=0 參數說明: ( tse | otc ): 若是上市使用tse,若是上櫃則使用otc, 注意左右括號要拿掉 SYMBOL :則是4碼或6碼的股票代號 YYYYMMDD :則是當日日期 回傳的JSON欄位說明 z 當盤成交價 tv 當盤成交量 v 累積成交量 b 揭示買價(從高到低,以_分隔資料) g 揭示買量(配合b,以_分隔資料) a 揭示賣價(從低到高,以_分隔資料) f 揭示賣量(配合a,以_分隔資料) o 開盤 h 最高 l 最低 y 昨收 u 漲停價