# Ping search engines desc 'Ping pingomatic' task :pingomaticdo begin require'xmlrpc/client' puts '* Pinging ping-o-matic' XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', 'Eavatar.com' , 'http://blog.eavatar.com', 'http://blog.eavatar.com/atom.xml') rescue LoadError puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.' end end
Baidu 通知腳本
1 2 3 4 5 6 7 8 9 10
desc 'Ping Baidu' task :pingbaidudo begin require'xmlrpc/client' puts '* Pinging Baidu search engine' XMLRPC::Client.new('ping.baidu.com', '/ping/RPC2').call('weblogUpdates.extendedPing', 'Eavatar.com' , 'http://eavatar.com', 'http://blog.eavatar.com', 'http://blog.eavatar.com/rss.xml') rescue LoadError puts '! Could not ping Baidu, because XMLRPC::Client could not be found.' end end
Google 的通知腳本
1 2 3 4 5 6 7 8 9 10 11
desc 'Notify Google of the new sitemap' task :sitemapgoogledo begin require'net/http' require'uri' puts '* Pinging Google about our sitemap' Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape('http://blog.eavatar.com/sitemap.xml')) rescue LoadError puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.' end end
Bing 的通知腳本
1 2 3 4 5 6 7 8 9 10 11
desc 'Notify Bing of the new sitemap' task :sitemapbingdo begin require'net/http' require'uri' puts '* Pinging Bing about our sitemap' Net::HTTP.get('www.bing.com', '/webmaster/ping.aspx?siteMap=' + URI.escape('http://blog.eavatar.com/sitemap.xml')) rescue LoadError puts '! Could not ping Bing about our sitemap, because Net::HTTP or URI could not be found.' end end
本文簡單說明如何設定兩台 MySQL server,讓它們彼此互相備份資料 (Master-master 模式)。雖然這樣的設定通常是支援高可用性 (high availability) 平台的一部分,但本文不包含如何完成其他 HA 的工作。設定兩台 MySQL 伺服器互相備份,主要目的就是要確認資料的安全性;同時也提高可用性。