查序號
wmic bios get serialnumber
查型號
wmic csproduct get name
2011年11月18日 星期五
2011年11月13日 星期日
清除 遠端桌面連線 紀錄
開始 --> 執行 --> regedit HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default 然後右邊視窗可以看到 MRU0, MRU1 之類的 IP 紀錄,刪掉即可。到這裡是刪掉了 下拉選單裡面曾經登錄過的主機 IP,但是一執行 遠端桌面連線程式的時侯,框框裡面就會自動填好上一次 最後登錄過的主機 IP,所以還要去 C:\Documents and Settings\Administrator\My Documents\ 資料夾下刪除 Default.rdp (預設是隱藏的,要去 工具 --> 資料夾選項 --> 檢視 --> 顯示所有的檔案和資料夾 才會看到它)
2011年10月26日 星期三
Ubuntu Linux 架設 DNS Server
Ubuntu Server上所提供的DNS Server套件是bind
sudo apt-get install bind9
Bind主要控制DNS有三個檔
"/etc/bind/named.conf.options"
"/etc/bind/named.conf.local"
"/etc/bind/named.conf.default-zones"
第一個named.conf.options使用預設值即可
第二個named.conf.local 此檔要設定DNS相關資料的檔案位置,範例如下:
正解
zone "sample.com.tw" {
type master;
file "/etc/bind/db.sample.com.tw"; 要管理的DOMAIN DNS檔案位置及名稱
};
反查
zone "255.255.60.in-addr.arpa" { ; 該網站的主機IP,只要輸入ABC Class
type master;
file "/etc/bind/255.255.60.rev"; 檔案位置及名稱
};
即可完成設定!
sudo apt-get install bind9
Bind主要控制DNS有三個檔
"/etc/bind/named.conf.options"
"/etc/bind/named.conf.local"
"/etc/bind/named.conf.default-zones"
第一個named.conf.options使用預設值即可
第二個named.conf.local 此檔要設定DNS相關資料的檔案位置,範例如下:
正解
zone "sample.com.tw" {
type master;
file "/etc/bind/db.sample.com.tw"; 要管理的DOMAIN DNS檔案位置及名稱
};
反查
zone "255.255.60.in-addr.arpa" { ; 該網站的主機IP,只要輸入ABC Class
type master;
file "/etc/bind/255.255.60.rev"; 檔案位置及名稱
};
第三個named.conf.default-zones 也是使用預設值。
第四個 建立db.sample.com.tw 檔案,範例如下:
$TTL 604800
@ IN SOA sample.com.tw. ns1.sample.com.tw. (
20111015 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.sample.com.tw.
@ IN NS www.sample.com.tw.
@ IN NS ns2.sample.com.tw.
@ IN MX 10 ASPMX.L.GOOGLE.COM.
@ IN MX 20 ALT1.ASPMX.L.GOOGLE.COM.
webmail IN CNAME ghs.google.com.
@ IN A 60.255.255.232
ns1 IN A 60.255.255.233
ns2 IN A 60.255.255.35
www IN A 60.255.255.232
superman IN A 60.255.255.232
video IN A 60.255.255.232
@ IN AAAA ::1
最後執行下列指令重新啟動bind DNS服務
sudo /etc/init.d/bind9 restat
即可完成設定!
2011年10月16日 星期日
HTML PHP Java Script 網頁轉址語法 自動轉址
PHP
<?php header("location: http://test.tw/")?>
方法一:於<head>之</head>加入以下語法
<meta http-equiv="refresh" content="停留秒數;url=新的網址">
範例:
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.suefar.com.tw">
</head>
</html>
方法二:於<body>之</body>加入以下語法
<body onload="window.open('新網址','_top')">
</body>
範例:
<html>
<body onload="window.open('http://www.suefar.com.tw','_top')">
</body>
</html>
方法三:於<body>之</body>加入以下語法。停留時間為千分之一秒,例如1秒後轉址,則停留時間輸入1000
<Script Language="JavaScript">
setTimeout("location.href='新網址'",停留時間);
</Script>
範例:
<html>
<body>
<Script Language="JavaScript">
setTimeout("location.href='http://www.suefar.com.tw'",1000);
</Script>
</body>
</html>
方法四:於<body>之</body>加入以下語法。
<Script Language="JavaScript">
<!--
location.href= ('新網址');
-->
</Script>
範例:
<html>
<body>
<Script Language="JavaScript">
<!--
location.href= ('http://www.suefar.com.tw');
-->
</Script>
</body>
</html>
2011年10月7日 星期五
Ubuntu 查詢連線數指令&查詢記憶體使用量
感謝Mike提供!
netstat -an | grep "80" | wc -l
或
netstat -aunt | wc -l
ss
記憶體使用量
cat /proc/meminfo
APACHE2連線數指令
ps aux |grep apache2 | nl
netstat -an | grep "80" | wc -l
或
netstat -aunt | wc -l
ss
記憶體使用量
cat /proc/meminfo
APACHE2連線數指令
ps aux |grep apache2 | nl
2011年10月3日 星期一
Ubuntu Crontab 設定方式
直接下指令
crontab -e
或是
sudo crontab -e
在裡面編輯
Cron also offers some special strings:
- stringmeaning
@rebootRun once, at startup.
@yearlyRun once a year, "0 0 1 1 *".
@annually(same as @yearly)
@monthlyRun once a month, "0 0 1 * *".
@weeklyRun once a week, "0 0 * * 0".
@dailyRun once a day, "0 0 * * *".
@midnight(same as @daily)
@hourlyRun once an hour, "0 * * * *".
minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
01 04 1 1 1 /usr/bin/somedirectory/somecommand
2011年10月2日 星期日
安裝 Zimbra Collaboration Server - Open Source Edition 紀錄
在記錄安裝 Zimbra WebMail 前,建議大家可以觀看原廠安裝手冊,本BLOG只記錄相關要點筆記!
(測試紀錄-20121209---目前測試 ubuntu10.04&Zimbra 7.21效能較優,Ubuntu12.04&Zimbra 8效能較差! 目前Zimbra 7.2不支援Ubuntu 12.04)
Linux前置作業
1. 請將HOSTS前兩筆紀錄更改成
127.0.0.1 localhost.localdomain localhost
127.0.0.1 your.domain.address.tw mail
2. 下載Zimbra壓縮檔並解壓至/tmp,另外至Zimbra下載 ZCSLicense.xml至該目錄。
Zimbra安裝作業
tar xzvf [zcs.tgz]
./install.sh
期間可能出現缺少元件,請以手動安裝
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Checking for prerequisites...
FOUND: NPTL
FOUND: sudo-1.7.2p1-1ubuntu5.3
FOUND: libidn11-1.15-2
FOUND: libpcre3-7.8-3build1
FOUND: libgmp3c2-2:4.3.2+dfsg-1ubuntu1
FOUND: libexpat1-2.0.1-7ubuntu1
FOUND: libstdc++6-4.4.3-4ubuntu5
MISSING: libperl5.10
Checking for suggested prerequisites...
FOUND: perl-5.10.1
MISSING: sysstat does not appear to be installed.
MISSING: sqlite3 does not appear to be installed.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
將 MISSING的元件用手動安裝即可!
後續可依原廠安裝手冊進行安裝!
http://www.zimbra.com/docs/ne/latest/single_server_install/wwhelp/wwhimpl/js/html/wwhelp.htm#href=NE_QuickStart_7_1.Installing_Zimbra_Software.html
Download
http://www.zimbra.com/downloads/os-downloads.html
(測試紀錄-20121209---目前測試 ubuntu10.04&Zimbra 7.21效能較優,Ubuntu12.04&Zimbra 8效能較差! 目前Zimbra 7.2不支援Ubuntu 12.04)
Linux前置作業
1. 請將HOSTS前兩筆紀錄更改成
127.0.0.1 localhost.localdomain localhost
127.0.0.1 your.domain.address.tw mail
Install BIND9
In many case, your server didn't got public IP directly. But you got public IP by NAT by network device. In this condition you have to use Split DNS as Zimbra suggest (More Info)
- Install bind9
sudo apt-get install bind9
- edit /etc/bind/named.conf.options by the line forwarders change to our DNS IP then append zone that the bottom of line
options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. forwarders { 0.0.0.0; }; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; }; zone "mail.awen.tw" { type master; file "db.mail.awen.tw"; };
- then create /var/cache/bind/db.mail.awen.tw don't forget to change filename to match with zone file
$ttl 38400 @ IN SOA mail.awen.tw. mail.awen.tw. ( 2012120907 10800 3600 604800 38400 ) IN NS ns1.mail.awen.tw. IN NS ns2.mail.awen.tw. IN A 192.168.12.214 IN MX 10 mail.awen.tw. @ A 192.168.12.214 ns1 A 192.168.12.214 ns2 A 192.168.12.214 mail A 192.168.12.214
- Then edit /etc/resolv.conf and change nameserver to 127.0.0.1 (***這非常重要)
search mail.awen.tw nameserver 127.0.0.1
- restart bind9
sudo /etc/init.d/bind9 restart
- Test by dig command and it should return like below
dig mail.awen.tw mx
; <<>> DiG 9.7.0-P1 <<>> zimbra.wingfoss.com mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57886 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; QUESTION SECTION: ;zimbra.wingfoss.com. IN MX ;; ANSWER SECTION: mail.awen.tw. 38400 IN MX 10 mail.awen.tw. ;; AUTHORITY SECTION: mail.awen.tw. 38400 IN NS ns1.mail.awen.tw. mail.awen.tw. 38400 IN NS ns2.mail.awen.tw. ;; ADDITIONAL SECTION: mail.awen.tw. 38400 IN A 192.168.12.214 mail.awen.tw. 38400 IN A 192.168.12.214 mail.awen.tw. 38400 IN A 192.168.12.214 ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Nov 4 21:00:19 2011 ;; MSG SIZE rcvd: 145
2. 下載Zimbra壓縮檔並解壓至/tmp,另外至Zimbra下載 ZCSLicense.xml至該目錄。
Zimbra安裝作業
tar xzvf [zcs.tgz]
./install.sh
期間可能出現缺少元件,請以手動安裝
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Checking for prerequisites...
FOUND: NPTL
FOUND: sudo-1.7.2p1-1ubuntu5.3
FOUND: libidn11-1.15-2
FOUND: libpcre3-7.8-3build1
FOUND: libgmp3c2-2:4.3.2+dfsg-1ubuntu1
FOUND: libexpat1-2.0.1-7ubuntu1
FOUND: libstdc++6-4.4.3-4ubuntu5
MISSING: libperl5.10
Checking for suggested prerequisites...
FOUND: perl-5.10.1
MISSING: sysstat does not appear to be installed.
MISSING: sqlite3 does not appear to be installed.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
將 MISSING的元件用手動安裝即可!
後續可依原廠安裝手冊進行安裝!
http://www.zimbra.com/docs/ne/latest/single_server_install/wwhelp/wwhimpl/js/html/wwhelp.htm#href=NE_QuickStart_7_1.Installing_Zimbra_Software.html
Download
http://www.zimbra.com/downloads/os-downloads.html
訂閱:
文章 (Atom)