2014年4月16日 星期三

EXIF縮圖與實際圖片不符的修正方法

下載:XnView

選擇:

編輯→元資料→重建EXIF內嵌縮圖

2014年4月9日 星期三

red5 live streaming

1. 安裝 jdk 6 update 45

2. 設定 環境變數
   (1)JAVA_HOME c:\Program Files\Java\jdk1.6.0_45
   (2)PATH %JAVA_HOME%\bin
   (3)CLASSPATH .;%JAVA_HOME%\lib;%JAVA_HOME%\tools.jar;

3.安裝 red5 1.02 安裝過程需設定 IP 位置 及 port 5080

4.防火牆開啟 port 80,5080,1935

5.啟動red5 service

6.安裝admin demo模組(監看上線人數) 從http://your_ip:5080/installer選擇安裝

7.安裝 adobe flash media live encoder 3.2
  FMS URL 設定為:rtmp://your_ip/live

8.web伺服器放置 live.htm 及 StrobeMediaPlayback.swf
  (1)live.htm 需修改 red5 server 的 ip 位置(兩處)

相關檔案下載:download

2013年11月22日 星期五

設定 DNS log

在 "/var/named/etc/namedb/named.conf"裡加入這段

logging {
  channel querylog {
    file "/var/log/query.log/var/named/var/log/query.log" versions 5 size 50m;
    print-category yes;
    print-severity yes;
    print-time yes;
  };
  category queries { querylog; };
};

然後
rndc reload
rndc querylog
即可


補充:bind的權限不足以寫入/var/log

2013年11月21日 星期四

偵測nat線上使用者

定期檢測 NAT網卡上的arp table 當連線數低於10個時 reset網卡

#!/bin/sh
#bce1
var_1=$(arp -a | cut -d'(' -f2 | cut -d')' -f1 | awk -F. '$3 < 128 {++s1} $3 > 128 {++s2} END {print s1}')
#bce3
var_128=$(arp -a | cut -d'(' -f2 | cut -d')' -f1 | awk -F. '$3 < 128 {++s1} $3 > 128 {++s2} END {print s2}')

if [ $var_1 -lt 10 ]; then
  ifconfig bce1 down
  ifconfig bce1 up
  echo `date '+%m%d %T'` $var_1 "bce1 reset !!" >> /var/log/nic.log
else
  echo `date '+%m%d %T'` $var_1 "bce1 ok !!" >> /var/log/nic.log
fi


if [ $var_128 -lt 10 ]; then
  ifconfig bce3 down
  ifconfig bce3 up
  echo `date '+%m%d %T'` $var_128 "bce3 reset !!" >> /var/log/nic.log
else
  echo `date '+%m%d %T'` $var_128 "bce3 ok !!" >> /var/log/nic.log
fi

2013年11月5日 星期二

在freebsd 9.0 上安裝 squid

cd /usr/ports/www/squid33
make install clean

ee /usr/local/etc/squid/squid.conf
#設定可以使用的 ip
acl localnet src "your ip/32"
#設定 cache 容量
cache_dir ufs /var/squid/cache/squid 1024 16 256 


ee /etc/rc.conf
squid_enable="YES"


#初始化 cache 資料夾,注意權限問題 /var/squid/
/usr/local/sbin/squid -z


#啟動squid
/usr/local/etc/rc.d/squid start


#測試
telnet localhost 3128
GET / [enter]
如果有看到html code就是成功運行了