Feeds:
文章
留言

CentOS 6 安裝 openssh-clients

CentOS 6 最小安裝之後,沒有 scp 可以使用,
所以當用 pietty (putty) 傳檔案時,
會出現 scp not connection 的錯誤。

#  yum install openssh-clients

“C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" –incognito

當使用者端連進來時,
由 index.php 負責判斷時間,
當上一個連線與這一個連線時間小於 600 秒,
就讀取 index2.htm ,
如果上一個連線與這一個連線時間已超過 600 秒,
就會乎叫 get.php ,
重新將 RSS 的網頁讀取進來,
並寫到 index2.htm 裡面去,
供下一次 600 秒內的使用者閱讀。

目的:避免在短時間有大量的 PHP 處理程序將資源吃光。

index.php

<?php
$t=time();
$fp = fopen(‘timestamp.txt’, ‘r’);
$datatime=fgets($fp,12);
$t2=$t-$datatime;

if ($t2<600){include(“index2.htm");
} else {
include(“get.php");
}
?>

get.php

<?php
$siteurl = “http://samba.tw/rss.php";
$content = file_get_contents($siteurl);
echo $content;

$fp2 = fopen(‘index2.htm’, ‘w’);
fwrite($fp2,$content);
fclose($fp2);

$t=time();
$fp = fopen(‘timestamp.txt’, ‘w’);
fwrite($fp,$t);
fclose($fp);
?>

index2.htm (空白檔案即可,注意要有寫入的權限)

timestamp.txt(空白檔案即可,注意要有寫入的權限)

網頁版批踢踢 (web ptt.cc)

如果無法用 telnet 連進 ptt.cc 進行 BBS 的操作~
可以選用網頁方式進行瀏覽
http://www.ptt.cc/bbs/index.html
雖然沒有 BBS 那麼多功能,
但是簡易的閱讀也可以止一下渴啦!

  1. http://unetbootin.sourceforge.net/
  2. https://fedorahosted.org/liveusb-creator/
  3. http://live.learnfree.eu/download
  4. http://www.pendrivelinux.com/

幾套不錯的 Nas 伺服器

http://www.linuxplanet.com/linuxplanet/reports/7153/1

  1. FreeNAS
  2. CryptoNAS
  3. Openfiler
  4. NASLite-M2 (商業包裝,需付費)
  5. NanoNAS (商業包裝,需付費)

Plop 實現舊電腦用 USB 開機

早期有些舊電腦的 BIOS 不支援從 USB 開機,
Plop 可以實現了!

下載 Plop 之後,
將 ISO 檔燒進光碟,
再將這片光碟放到主機光碟中,
主機會從光碟開機,
進入光碟開機之後,
就會有 USB 開機的選項了。

PS:另有 plpcfgbtGUI.exe 可以編輯 .bin 檔,修改開機選項設定。修改完記得用 UltraISO 之類的軟體,將 .bin 檔燒回 .ISO 檔內喔!

PHP 使用短標籤

在撰寫 PHP 程式時,
通常都是

<?php source_code; ?>

在 <? 後面要有 php 來宣告這是一段 PHP 語言,
但是人是懶惰的,
修改一下 /etc/php.ini 的

short_open_tag = On

就可以使用

<? source_code; ?>

不用再多打 php 了。

用 Registry 設定 IE 的 proxy

將以下文字,
存成 proxy.reg 的文字檔,
然後連續點兩下執行,
就可以直接啟用 proxy 了。
(PS:   IP:port   請置換成您的資料)

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="IP:port"
"ProxyOverride"="<local>"

[HKEY_USER\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="IP:port"
"ProxyOverride"="<local>"

 

如果要停用,
就換成以下內容:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
"ProxyOverride"="<local>"

[HKEY_USER\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
"ProxyOverride"="<local>"