ad_728x90

參觀我的【 伊生活小舖】

2014年12月6日 星期六

CSS margin 定義與用法

margin 簡寫屬性在一個聲明中設置所有外邊距屬性。該屬性可以有 1 到 4 個值。

說明

這個簡寫屬性設置一個元素所有外邊距的寬度,或者設置各邊上外邊距的寬度。
塊級元素的垂直相鄰外邊距會合併,而行內元素實際上不佔上下外邊距。行內元素的的左右外邊距不會合併。同樣地,浮動元素的外邊距也不會合併。允許指定負的外邊距值,不過使用時要小心。
註釋:允許使用負值。

例子 1

margin:10px 5px 15px 20px;
  • 上外邊距是 10px
  • 右外距是 5px
  • 下外距是 15px
  • 左外距是 20px

例子 2

margin:10px 5px 15px;
  • 上外距是 10px
  • 右外距和左外距是 5px
  • 下外距是 15px

例子 3

margin:10px 5px;
  • 上外距和下外距是 10px
  • 右外距和左外距是 5px

例子 4

margin:10px;
  • 所有 4 個外距都是 10px

How to Add an Ad Above the Who's Online Box on vBulletin?

Instructions

    • 1
      Log in to your vBulletin Internet forum with your administrative user name and password. Click the arrow next to "Styles & Templates" and select "Style Manager" from the drop-down menu.
    • 2
      Choose "Edit Templates" from the drop-down box next to the forum style you want to edit. Locate and double-click "Ad Location Templates" in the list to the left. Locate and double-click "ad_board_after_forums."
    • 3
      Add the following code into the large text field under "Template":
      <!-- add this part here -->
      <tr>
      <td class="tcat" height=100><center><!-- insert ad code here --></center></td>
      </tr>
      <!-- end additional code -->
      Substitute "<!-- insert ad code here -->" for the coding used for your banner ad. When finished, click "Save and Reload."


2014年11月30日 星期日

一生要避開的26個心靈陷阱

一个人有怎样的心灵,就拥有怎样的世界。人是自己观念的奴隶。一个人一辈子的成败、荣辱、得失、无不因自己的观念而起到巨大的作用。要想让自己心情愉快、精神放松,我们必须改变自己头脑中那些错误的观念、偏执的思维惯性,学会放弃,学会放手,还要学会遗忘。

1、幻想——思想的巨人,行动的矮子。


当人遇到挫折或难以解决的问题时,便脱离实际,想入非非,把自己放到想像的世界中,企图以虚构的方式应付挫折,获得满足。白日梦便是一种幻想,如果白日梦代替了有意义的行动,就会成为逃避现实的手段,也可能成为心里变态的征兆,发展成为幻想症。

幻想是美丽的,现实是残酷的。幻想只是一种感觉,如想要人生有成,就应该立足于现实,尤其是为人处世时,更不可不切实际,否则就无法切实地解决问题,求得改变与发展。

2、消极——对现实的退缩于逃避。

消极的人往往给人一种不慕名利的虚假印像,其实他们的内心是极度空虚的,对待事情也是消极的。这种人什么也不想,什么也不去做,即使有再强的能力,终生也将一事无成。消极与积极在于看法与认识的不同。走在一条具有太多信息、太多欲望和太多竟争的人生路上,我们总有几丝忧虑、几多彷徨,还会常常有些无奈。但为了事业的成功和生活的幸福,必须建立一种积极的心态。每天给自己一个希望,你将拥有好的心情,你的心态往往就是你真正的主人。

3、自负——无知者的自我膨胀。

自信十分重要,这是毋庸置疑的,但如果“过分”自信就会变成“自负”。“自信”和“自负”之间存在一个度,但很多人却因为成功而自我膨胀,以至于陷入自负的心里陷阱。自负有时表现为狂妄,自认为无所不能,过高地估记自己,看不起身边的人。因此,自负的人常会陷入狂躁之境,最终走向失败。


2014年11月19日 星期三

注意自己的人中

【健康醫療網/記者梁以辰報導】
很少人會注意自己的人中,但是您知道可以從人中來看身體可能發生的變化嗎?臺北市立聯合醫院中醫科江裕陽主任表示,根據人中不同的顏色與形狀,可以看出身體有可能發生的疾病。

2014年11月17日 星期一

How to install vBulletin v4.0 and v5 Connect

from : http://docs.nexcess.net/article/how-to-install-vbulletin-version-5-0.html

How to install vBulletin v4.0 and v5 Connect

OverviewThis article describes how install vBulletin Version 4.0 or 5.0 on your Nexcess hosting service.

Downloading the vBulletin Package

  1. Navigate to the vBulletin website: http://www.vbulletin.com/en/purchases/.
  2. On the top menu bar, click the green PURCHASE button.   

2014年10月31日 星期五

眼睛像被一片霧蓋住,什麼也看不到!

秋蟹肥美,但50歲李姓男子日前吃螃蟹配啤酒,竟導致結膜下出血,不但眼睛血紅如卡通火影忍者主角「寫輪眼」,甚至一度喪失視力;李男就診後才發現自己患有糖尿病,不適合喝酒精飲料。
台北慈濟醫院眼科醫師蔡明霖表示,高血壓及糖尿病等慢性病患者血管彈性變差,構造較脆弱,很容易受刺激導致血管破裂,李男7月就有結膜下出血狀況,當時院方建議他進一步檢查,但李不以為意,錯過治療時機。
「眼睛像被一片霧蓋住,什麼也看不到!」李男10月到醫院就診時,激動向醫師表示,自己吃完螃蟹配啤酒後,竟然什麼也看不到;醫師抽血檢查,發現李男患有糖尿病,全身血管脆弱,加上喝酒讓李男血液循環加速,衝破眼底血管,導致結膜下出血。李經開刀治療後,已恢復視力。
「螃蟹、烏魚子等高膽固醇食物,容易讓眼底血管堵塞,造成眼中風。」蔡明霖說,秋冬季節交替,氣溫變化大,血管熱脹冷縮,患有心血管疾病者要特別注意飲食健康,近來台北慈濟醫院眼睛結膜下出血就診病患增多約兩到三成。
他說,因過敏眼睛癢揉眼睛,或咳嗽及用力解便引起靜脈壓升高,也可能造成結膜下出血,讓眼睛看起來一片血紅。
蔡明霖提醒民眾,若眼睛在一年內發生三次以上出血狀況,代表血管結構已出現異常,千萬不要因症狀好轉就輕忽不管,一定要進一步檢查,找出病因,避免產生併發症,危害身體健康甚至性命安全。

2014年10月11日 星期六

Google Chrome 35 Released – Install on RHEL/CentOS 6 and Fedora 20-15


Step 1: Enable Google YUM repository

Create a file called /etc/yum.repos.d/google-chrome.repo and add the following lines of code to it.
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Step 2: Installing Chrome Web Browser

Download and Install Chrome Web Browser with yum command. It will automatically install all dependencies.
# yum install google-chrome-stable
Update : Sadly, the Google Chrome browser no longer supports the most famous commercial distribution Red Hat and its free clones such as CentOS and Scientific Linux.
Yes, they’ve discontinued support for RHEL 6.X version as of Google Chrome and on other side, latest Firefox and Opera browsers run successfully on the same platforms.
Luckily, there is a script developed by Richard Lloyd, that automatically download and install latest Google Chrome browser by picking libraries from a more recent released distro and put those libraries in (/opt/google/chrome/lib) directory and then you can able to run Google Chromeon CentOS 6.X version.
# wget http://chrome.richardlloyd.org.uk/install_chrome.sh
# chmod u+x install_chrome.sh
# ./install_chrome.sh
Sample Output
Google Chrome Installer 2.00 on the i686 platform
(C) Richard K. Lloyd 2013 <rklloyd@gmail.com>

*** Checking for an update to install_chrome.sh ...

--2013-07-18 17:27:02--  http://chrome.richardlloyd.org.uk/version.dat
Resolving chrome.richardlloyd.org.uk... 193.110.246.53
Connecting to chrome.richardlloyd.org.uk|193.110.246.53|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5 [text/plain]
Saving to: âversion.datâ

100%[===================================================================================================================>] 5           --.-K/s   in 0s

2013-07-18 17:27:02 (264 KB/s) - âversion.datâ

*** install_chrome.sh is already the latest version (2.00) - continuing ...

*** Determining latest Google Chrome version number ...

Step 3: Starting Chrome Web Browser

Start browser with non-root user.
# google-chrome &

2014年10月6日 星期一

Web 2.0 時代必須重視 JavaScript/JSON Hijacking 攻擊

從 ASP.NET MVC 2.0 Preview 2 開始 JsonResult 已經被修改成只能在 HTTP POST 的時候回應,像我們經常使用 jQuery 的 $.getJSON 就不能再用了,我從ASP.NET MVC 2.0 Preview 2 Release Note 得知 JSON Hijacking 之後就持續追蹤下去,覺得這是個非常值得注意的安全問題。
前陣子 Twitter 就被發現了一個 JSON Hijacking 漏洞,可以讓使用者在進入惡意網站後被取得你所有在 Twitter 的好友清單。建議有在使用 JSON 或動態下載 JavaScript 的網站都應該特別注意!
我看了好幾篇文章,不過都是英文的,解釋的非常清楚,相關資訊請參考「相關連結」。以下我列出幾個中文的文章供各位參考:
要避免這個問題,最簡單的作法就是『不要透過 HTTP GET 送出 JSON 資料』,雖然 jQuery 沒有內建 $.postJSON 方法,但卻非常容易實做,且在官網的jQuery.post 文件有提供一個簡單的範例如下:
$.postJSON = function(url, data, callback) {
    $.post(url, data, callback, "json");
};
引言處 from:http://blog.miniasp.com/post/2009/11/14/JavaScript-JSON-Hijacking.aspx

Mac成目標 小心「iWorm」入侵

引言處http://www.appledaily.com.tw/realtimenews/article/new/20141006/482309/Mac%E6%88%90%E7%9B%AE%E6%A8%99%E3%80%80%E5%B0%8F%E5%BF%83%E3%80%8CiWorm%E3%80%8D%E5%85%A5%E4%BE%B5
蘋果公司OS X系統常給使用者一種認知,就是不會中毒。但日前出現一種「iWorm」惡意軟體,透過知名社群網站在不知不覺中,將你的資料竊取一空。

2014年9月5日 星期五

Linux上使用netstat命令查證DDOS攻擊

你可以知道在受到攻擊之後如何在終端中使用netstat命令檢查你的服務器。

  一些例子和解釋

netstat -na顯示所有連接到服務器的活躍的網絡連接netstat -an | grep :80 | sort只顯示連

接到80段口的活躍的網絡連接,80是http端口,這對於web服務器非常有用,並且對結果排序.對

於你從許多的連接中找出​​單個發動洪水攻擊IP非常有用netstat -n -p|grep SYN_REC | wc -l

這個命令對於在服務器上找出活躍的SYNC_REC非常有用,數量應該很低,最好少於5.在dos攻

擊和郵件炸彈,這個數字可能非常高.然而值通常依賴於系統,所以高的值可能平分給另外的服

務器.netstat -n -p | grep SYN_REC | sort -u列出所有包含的IP地址而不僅僅是計數.netstat -

n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'列出所有不同的IP地址節點發送

SYN_REC的連接狀態netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n使

用netstat命令來計算每個IP地址對服務器的連接數量netstat -anp |grep 'tcp |udp' | awk

'{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n列出使用tcp和udp連接到服務器的數目

netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr檢查

ESTABLISHED連接而不是所有連接,這可以每個ip的連接數netstat -plan|grep :80|awk

{'print $5' }|cut -d: -f 1|sort|uniq -c|sort -nk 1顯示並且列出連接到80端口IP地址和連接

數.80被用來作為HTTP

  如何緩解DDoS攻擊

當你發現攻擊你服務器的IP你可以使用下面的命令來關閉他們的連接:

iptables -A INPUT 1 -s $IPADRESS -j DROP/REJECT

請注意你必須用你使用netstat命令找到的IP數替換$IPADRESS

在完成以上的命令,使用下面的命令殺掉所有httpd連接,清除你的系統,然後重啟httpd服務。

killall -KILL httpd service httpd start #For Red Hat systems /etc/init/d/apache2 restart

如何檢查他們的網站是否已經淪陷,變成StealRat殭屍網路/傀儡網路 Botnet的一部分


在本篇文章裡,我們會討論網站管理員可以如何檢查他們的網站是否已經淪陷,變成StealRat殭屍網路/傀儡網路 Botnet的一部分。
第一步是檢查是否有垃圾郵件發送腳本的存在,通常會用sm13e.phpsm14e.php的名稱。不過要注意的是,這些腳本可能會改變檔案名稱,所以最好還是要檢查是否有任何陌生的PHP檔案存在。

DDOS 攻擊實例.<圖示>...



說明:本人已移除此資料夾,所以是 File does not exist.

2014年9月4日 星期四

netstat指令參數


-a / --all : 顯示所有連接中的 Socket。 
-c / --continuous : 持續列出網路狀態。 
-C / --cache : 顯示路由配置的快取資訊。 
-F / --fib : 顯示 Forward Information Base。 
-g / --groups : 顯示 Multicast 的群組名單。 
-i / --interfaces : 顯示網路介面資訊表單。 
-l / --listening : 顯示監控中的伺服器的 Socket。 
-n / -numeric : 直接使用 IP Address,而不使用名稱伺服器。 
-o / --timers : 顯示計時器。 

-p / --programs : 顯示正在使用 Socket 的程式識別碼和程式名稱。 
-r / --route : 顯示 Routing Table。 
-s / -- statistics : 顯示網路工作資訊統計表。 
-t / --tcp : 顯示 TCP 的連線狀況。 
-u / --ucp : 顯示 UCP 的連線狀況。 
-w / -raw : 顯示 RAW 的連線狀況。 
-x / --unix / -A unix : 列出 Unix 傳輸協定連線中的相關位址。 
ip / inet / -A inet : 列出 DARPA 傳輸協定 ( Internet ) 連線中的相關位址。 
DARPA:Defense Advanced Research Projects Agency。 


哪些主機會承受(Slowloris)攻擊....Which web-server's are affected by slowloris attack?

  1. Apache (1.x & 2.x)
  2. dhttpd
  3. Goahead web server
Web server's that work on an event based architecture like nginx are not affected by a slowloris attack.
It seems that IIS is also is not affected by a slowloris attack(although not tested by us).

防護Apache受攻擊(Slowloris)..._Protect Apache Against Slowloris Attack ! 

Slowloris allows a single machine to take down another machine’s web server with minimal bandwidth and side effects on unrelated services and ports. The tools used to launch Slowloris attack can be downloaded at http://ha.ckers.org/slowloris/
Slowloris tries to keep many connections to the target web server open and hold them open as long as possible. It accomplishes this by opening connections to the target web server and sending a partial request. Periodically, it will send subsequent HTTP headers, adding to—but never completing—the request. Affected servers will keep these connections open, filling their maximum concurrent connection pool, eventually denying additional connection attempts from clients.
Following web server has been tested and NOT affected by this kind of attack:
  • IIS6.0
  • IIS7.0
  • lighttpd
  • Squid
  • nginx
  • Cherokee
  • Netscaler
  • Cisco CSS

Install and Configure wget on OS X Mavericks 10.9 and fix SSL GNUTLS error

Get Xcode

To add and install wget to your system you need to download the source files, compile the code and make an install. 
Next you need to install the Xcode command line tools, easiest way to do so by running in the Terminal:
xcode-select --install

2014年7月27日 星期日

利用.htaccess拒絕spam機器人評論

利用.htaccess拒絕spam機器人評論

被垃圾評論圍攻,相信作為站長都深有體會,於是乎什麼圖片驗證、小學加減法、滑動解鎖等防垃圾評論方法廣為流傳,其實這些小兒科的應對方法,對Spam 機器人毫無用處,因為大多數Spam根本不會去添寫評論表單,而是直接讀取Wordpress程序核心文件wp-comments-post.php(評論)實現自動留言。
之前寫過《Hotnews Pro主題防spam小技巧》,對於使用已集成ajax評論功能的主題,可以直接刪除wp-comments-post.php來屏蔽防spam機器人,同時不會影響到正常的讀者留言。
不過問題又來了,對於像我一樣啟用了移動版主題,而移動版主題並未集成ajax評論功能,造成在移動設備上無法留言。
本文的方法雖然是N年前的,卻能很好地解決這一問題(經測試並不能完全屏蔽spam機器人)。
將下面代碼添加到網站根目錄的.htaccess文件中即可,不要忘記修改第4行域名為你的網址。

VPN Router 路由器簡介(硬體設備)...

VPN 功能 [UR-760 UTM 記錄設備 ]
企業員工在外如果想取得公司最新資料,常利用電腦連上開放的網際網路上去截
取,但是利用開放性的網際網路來傳輸資料容易被竊取,資料有傳輸安全上的憂
慮。因此,多數的企業會在 Server 上設定 VPN,讓使用者從外進行連線時,都
必須通過重重的驗證才能進入。VPN 就是在使用者與公司主機間產生一條加密的
通道,傳輸重要資料。
◎ IPSec VPN
適用在總公司與分公司之間的傳輸,可同時支援多台電腦與遠端伺服器之間的
連線。IPsec VPN 適用於需要同時支援多台電腦及伺服器彼此連線,且地點固
定的企業環境中,可以得到相當良好的管理及安全保障機制。
◎ PPTP VPN
適合固定地點與公司之間的傳輸。例如:員工從家中與公司之間的傳輸。較適
合使用在地點固定的公司間連線傳輸。

[Tutorial] Setup Windows xp To VPN

VPN 的概觀

VPN 是利用公用網路 (例如,網際網路) 連線到私人網路 (例如,您辦公室的網路) 的一種方法。

VPN 透過撥號伺服器,提供了撥號連線的優點,以及網際網路連線的簡易和彈性。使用網際網路連線,您可以連線到世界各處的資源,而在大多數地方,只要打個市內電話給最近的網際網路存取電話號碼,就可以連線到您的辦公室。如果您的電腦和您的辦公室有高速的網際網路連線,例如纜線或數位用戶迴路 (DSL,Digital Subscriber Line),您就能以最高的網際網路連線速度,來與您的辦公室進行通訊。這可比使用類比數據機的撥號連線快上許多。

VPN 會使用驗證連結,以確保只有授權的使用者才能連線到您的網路,而且還會使用加密,以確保其他人無法攔截,也無法使用在網際網路上移動的資料。Windows XP 藉由使用點對點通道通訊協定 (PPTP,Point-to-Point Tunneling Protocol) 或第二層通道通訊協定 (L2TP,Layer Two Tunneling Protocol),就可以完成此安全性。「通道通訊協定」是一種可以讓資訊更安全地在網際網路上,從一台電腦傳送到另一台電腦的技術。

VPN 技術還可以讓公司透過公用網路 (例如網際網路),來連線到分公司或其他公司,同時還能維護通訊的安全。透過網際網路的 VPN 連線,邏輯上是以專用的廣域網路 (WAN,Wide Area Network) 的形式運作。

從用戶端電腦設定 VPN 連線

如果要設定 VPN 的連線,請依照下列步驟執行:

[Tutorial] Setup_Provide VPN Using Mavericks Server

文本來源處:http://krypted.com/mac-security/provide-vpn-services-using-mavericks-server/


OS X Server has long had a VPN service that can be run. The server is capable of running the two most commonly used VPN protocols: PPTP and L2TP. The L2TP protocol is always in use, but the server can run both concurrently. You should use L2TP when at all possible.
Sure, “All the great themes have been used up and turned into theme parks.” But security is a theme that it never hurts to keep in the forefront of your mind. If you were thinking of exposing the other services in Mavericks Server to the Internet without having users connect to a VPN service then you should think again, because the VPN service is simple to setup and even simpler to manage.
Setting Up The VPN Service In Mavericks Server (Server 3)
To setup the VPN service, open the Server app and click on VPN in the Server app sidebar. The VPN Settings  screen has two options available in the “Configure VPN for” field, which has two options:
  • L2TP: Enables only the L2TP protocol
  • L2TP and PPTP: Enables both the L2TP protocol and the PPTP protocol

誰連線到你ㄉ電腦

Ms-DOS模式


以下是一些實用的 netstat 語法,可以檢查主機的連線數量:
  • netstat -na
    顯示主機上所有已建立的連線。
  • netstat -an | grep :80 | sort
    顯示所有 port 80 的連線,並把結果排序。
  • netstat -n -p|grep SYN_REC | wc -l
    列出主機上有多少個 SYNC_REC,一般上這個數字應該相當低。
  • netstat -n -p | grep SYN_REC | sort -u
    同樣是列出 SYNC_REC,但不只列出數字,而是將每個 SYNC_REC 的連線列出。
  • netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'
    列出發送 SYNC_REC 的所有 ip 地址。
  • netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
    計算每一個 ip 在主機上建立的連線數量。
  • netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
    列出從 TCP 或 UDP 連線到主機的 ip 的數量。
  • netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr
    列出每個 ip 建立的 ESTABLISHED 連線數量。
  • netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
    列出每個 ip 建立的 port 80 連線數量。

2014年7月16日 星期三

常用的社群網站連結分享

SNS (Social Network Services) 無非是目前流通資訊最快速的途徑,現在這個時代已經很少人用 Email 分享資訊了,而我們常常需要在 Web 中提供「分享」按鈕來整合不同社群網站。想要張貼資訊到 SNS (Social Network Services),除了透過各家提供的 API/SDK 之外,大部分的社群網站都能夠藉由網址連結直接進行分享。一般來說,各大社群網站都會提供簡易的 HTTP API 讓使用者進行資訊分享,我們來看看要如何在 Web 中實作,好讓資訊可以快速流通到幾個常用的社群網路。

介紹幾種常用的社群網站連結分享

分享到 Plurk 噗浪

分享到 Twitter 推特

分享到 Line

分享到 Facebook

分享到 Google+

這裡要注意的是由於分享的文字資訊是透過 URL 進行傳遞,請記得要對文字進行 URL Encode。此外 Line 的分享機制僅對行動裝置有效用,最好的方法就是判斷裝置動態產生或隱藏 Line 分享功能。

COMMENTS HAVE BEEN DISABLED FOR THIS POST [文章的評論已被禁用]

Ratings and Recommendations by outbrain