Category Archives: OS

使用GMail SMTP寄信 (Ubuntu)

安裝mailx、exim4 apt-get install exim4-daemon-light mailutils dpkg-reconfigure exim4-config General type of mail configuration: │ internet site; mail is sent and received directly using SMTP │ │ mail sent by smarthost; received via SMTP or fetchmail │ │ mail sent by smarthost; … Continue reading

Posted in Ubuntu | Leave a comment

SSH 登入時寄發通知信件

vim ~/.bashrc echo ‘ALERT – Shell Access (WP) on:’ date who | mailx -A gmail -s “Alert: Shell Access from who | cut -d'(‘ -f2 | cut -d’)’ -f1” cowman.chiang@gmail.com > /dev/null 2>&1 搭配 使用GMail SMTP寄信 這一篇進行 其中 > /dev/null … Continue reading

Posted in Linux | Leave a comment

CentOS 快速安裝 Nginx with RTMP module

跟 之前裝在Ubuntu的那一篇 一樣 都是沒有設定stat的部分, 需要在另外修改 大致上跟Ubuntu的方式都相同 只是要注意的為 init script 可不可正常進行 測試的範例中是修改 nginx.conf 將 pid 那一行給取消註腳 pid logs/nginx.pid; #!/bin/sh yum groupinstall ‘Development Tools’ -y yum install pcre pcre-devel openssl-devel libxslt-devel -y cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip tar -zxvf nginx-1.7.3.tar.gz yum … Continue reading

Posted in CentOS, Nginx, RTMP | Leave a comment

OpenVPN 備援路由

先確認網路卡組態設定 第一張網卡 eth0 有設定 gateway 第二張網卡 eth1 沒有設定 gateway 這樣啟動時網路路由只有第一組的預設路由 接著編輯/etc/rc.locl 加入下面兩個設定 開機時自動加入第二組路由 route add default gw ..*.254 dev eth1 metric 10 調整備援路由切換時間,預設300 echo “10” > /proc/sys/net/ipv4/route/gc_timeout 最後可以檢查路由表 [root@twaren3-132 ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags … Continue reading

Posted in Linux, OpenVPN | Leave a comment

使用 Windows 內建 netsh 進行 Port Forwarding

將 local listen 的 610 port 轉發至 10.201.80.94 的 4444 port netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=610 connectaddress=10.201.80.94 connectport=4444 將 1 建立的 rule 刪除 netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=610 秀出目前建立的 rule netsh interface portproxy show all

Posted in Windows | Leave a comment

Ubuntu x64 快速安裝 Nginx with RTMP module

#!/bin/sh apt-get install build-essential libpcre3 libpcre3-dev libssl-dev libxslt-dev -y cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip tar -zxvf nginx-1.7.3.tar.gz apt-get install unzip -y unzip master.zip cd nginx-1.7.3/ ./configure –with-http_ssl_module –with-http_xslt_module –add-module=../nginx-rtmp-module-master make make install cp /tmp/nginx-rtmp-module-master/stat.xsl /usr/local/nginx/html/ cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak echo … Continue reading

Posted in Nginx, Ubuntu | Leave a comment

Nginx init script (Ubuntu)

將下列內容貼到 /etc/init.d/nginx 中,並且使用 chmod +x nginx 調整屬性 #! /bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server … Continue reading

Posted in Nginx, Ubuntu | 1 Comment

Install Nginx with RTMP module in Ubuntu 12.04 x64 LTS

# 安裝必要套件 apt-get install build-essential libpcre3 libpcre3-dev libssl-dev # 下載 tar 安裝檔案 cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip # 安裝 nginx tar -zxvf nginx-1.7.3.tar.gz unzip master.zip cd nginx-1.7.3/ ./configure –with-http_ssl_module –with-http_xslt_module –add-module=../nginx-rtmp-module-master make make install # 編輯 nginx 設定檔案 vim … Continue reading

Posted in Nginx, RTMP, Ubuntu | Leave a comment

Windows 7 convert MAK to KMS

先根據Windows 7版本輸入下述金鑰 Windows 7 Professional : FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4 Windows 7 Professional N : MRPKT-YTG23-K7D7T-X2JMM-QY7MG Windows 7 Enterprise : 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH Windows 7 Enterprise N : YDRBP-3D83W-TY26F-D46B2-XCKRJ Windows 7 Enterprise E : C29WB-22CC8-VJ326-GHFJW-H9DH4 啟用後再使用命令提示字元 (以管理員身分執行) 進行 slmgr 等指令

Posted in Windows | Leave a comment

關閉螢幕自動關閉

避免畫面會變黑 # vim /etc/profile // 最後面加入下面這行 setterm -powersave off -blank 0 # sh /etc/profile

Posted in Linux | 1 Comment