2011-08-21

避免使用者利用 SSH 登入 (Prevent User SSH Login)

當你分享的你的 Linux 使用者帳戶,讓其他使用者存取你的電腦
例如登入你的 FTP (不提供匿名登入)
你便需要提供你的使用者名稱及密碼給其他使用者
同時會讓你的系統帶來危險,如果對方使用其他正在執行的 Daemon 例如 SSH
When you want to share your Linux user account to allow other user to access your computer
For example, login your FTP (Ignore the anonymous login)
You will provide the user account name and password for other user.
However, on that time your system will be in danger if the user wants to access to your computer with other daemon, such as SSH.

2011-08-09

在 Linux 中將光碟資料轉換成 ISO 檔案 (Convert CD/DVD ROM to ISO file in Linux)

光碟很容易受到物理損壞導致資料遺失
若果光碟所保存的資料只是一堆獨立檔案,只需要將它們複製至硬碟中便可以保存
但若果那是一隻安裝光碟,隨便將檔案複製,檔案資料有機會不能正常運作
若果能夠建立 ISO 檔案,便可以隨時透過映像檔錄製光碟
Disc is easy to lose data if taking physical damages
If the disc is store with data files independently, just copy the files to the harddisk to backup the data
However, if the disc is an install disc, although the files are copied, some of them cannot be functioned
If back up a disc with an ISO file, we can write a disc on any time with any disc writer

2011-07-30

利用 GRUB2 讀取 Ubuntu ISO (Using GRUB2 to load Ubuntu ISOs)

每次安裝新系統都要燒錄光碟吧……很浪費呢……
用外置裝置吧……要將裝置中的資料備份,再格式化裝置,再將映像檔寫入……
但若果沒有以上的裝置,哪如何安裝新系統?
If you want to install a new system to your harddisk,
You need write a install disc, it is a little bit waste.
Use external device ... you need to backup the data in this external device,
format the external device, build the image to the external device ...
However, if you don't have these devices, how could you install a new system ?

2011-07-11

實用的 7-Zip 指令

7-Zip 是一種跨平台、開放源碼、免費、強大的壓縮工具

但是,7-Zip 只在 Windows 提供界面,若使用其他作業系統,例如 Linux 及 Macintosh 便沒有界面
當然你仍然可以使用其他具有界面,能整合 7-Zip 的壓縮工具
但若果你在完全沒有用戶界面的情況下,如何使用 7-Zip 壓縮資料?

2011-06-29

利用 Java 發送 HTTP POST 請求 (Using Java to send HTTP Request with POST method)

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;

2011-06-06

讓 Spreadsheet Excel Writer 的字串斷行 (Line Break in Spreadsheet Excel Writer)

先編寫一個使用 Spreadsheet Excel Writer 輸出 Excel 檔案的 php 文件
並在儲存格中加入 \n 來將字串
Write a simple PHP file using Spreadsheet Excel Writer to export Excel file
見下文