samba 出現Unable to connect to CUPS server localhost:631 錯誤訊息
作者:cross 日期:2011-06-21 23:29
more /var/log/messages
參考: http://learn.bles.tp.edu.tw/moodle/mod/resource/view.php?id=718
解決方式為,編輯 /etc/samba/smb.confJun 21 23:06:41 st smbd[9571]: [2011/06/21 23:06:41.375684, 0] printing/print_cups.c:108(cups_connect)
Jun 21 23:06:41 st smbd[9571]: Unable to connect to CUPS server localhost:631 - 連線被拒絕
load printer = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
參考: http://learn.bles.tp.edu.tw/moodle/mod/resource/view.php?id=718
如何在非LVM環境掛載LVM磁區的硬碟
作者:cross 日期:2011-06-15 12:28
我今天拿了一顆有作LVM分割的硬碟,想要抓取裡面的資料
一般我們掛載都是直接 mount /dev/sdb1 /XXX 就可以了,但
它是經過LVM切割,mount時會跟我要type,無法成功掛載
所以要這麼作 (如下)
1。先 pvscan 掃一下是否有LVM磁區
一般我們掛載都是直接 mount /dev/sdb1 /XXX 就可以了,但
它是經過LVM切割,mount時會跟我要type,無法成功掛載
所以要這麼作 (如下)
1。先 pvscan 掃一下是否有LVM磁區
2。就可以看到一個VG名稱叫VolGroup,再用 vgchange -ay VolGroupPV /dev/hdb2 VG VolGroup lvm2 [98.80 GB / 0 free]
Total: 1 [98.80 GB] / in use: 1 [98.80 GB] / in no VG: 0 [0 ]
Linux 的 /tmp 會被定期的刪除檔案或目錄
作者:cross 日期:2011-05-31 10:43
/tmp是Linux 用來放暫存資料的地方,網頁php程式也常用到
系統有支排程在 /etc/cron.daily/tmpwatch
第三行的 240 數值代表是小時,等於10天
第四行則是30天來清 /var/tmp
-x 參數代表要排除不刪的
系統有支排程在 /etc/cron.daily/tmpwatch
它每天執行,來掃 /tmp 目錄下的檔案或目錄,已超過10天的就把它刪除flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix
-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix 240 /tmp
/usr/sbin/tmpwatch "$flags" 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 720 "$d"
fi
done
第三行的 240 數值代表是小時,等於10天
第四行則是30天來清 /var/tmp
-x 參數代表要排除不刪的
perl 如何輸入密碼時以星號*顯示
作者:cross 日期:2011-05-14 19:31
在 Linux 底下可以真的顯示 * 號,但windows要readmode 為2才可讓我能成功enter,不過是enter完後才看到*號
# ref: http://forums.devshed.com/perl-programming-6/problem-with-readmode-under-use-term-readkey-462494.html
# ref: http://zh-tw.w3support.net/index.php?db=so&id=701078use Term::ReadKey;
my $key = 0;
my $password = "";
print "\nPlease input your password: ";
# Start reading the keys
#ReadMode(4); # Disable the control keys for linux
ReadMode(2); # for Windows
while(ord($key = ReadKey(0)) != 10)
# This will continue until the Enter key is pressed (decimal value of 10)
{
$password = $password.$key;
print "*";
}
ReadMode(0); #Reset the terminal once we are done
print "\n\nYour super secret password is: $password\n";
# ref: http://forums.devshed.com/perl-programming-6/problem-with-readmode-under-use-term-readkey-462494.html
使用 mondo 線上備份linux centos 系統
作者:cross 日期:2011-05-09 23:31
續 http://ssorc.tw/rewrite.php/read-170.html ,在 CentOS 5.4作測試
跳過 OS 安裝
直接來到怎麼安裝、使用 mondo (2.2.9.4)
在mondo官網 http://www.mondorescue.org/downloads.shtml
是找不到 CentOS的套件,不過有 RedHat Enterprise Linux2.1,3,4,5.
但我不是拿它來裝
執行
這串是到 http://dag.wieers.com/rpm/FAQ.php#B 的 B2. How to configure to use RPMforge ? 拿的
VirtualBox 虛機是跑在一般 User (使用者),怎麼讓母機開機後就跑子機
作者:cross 日期:2011-05-09 22:21
背景執行子機有兩種方式
第一種
2。-p 3389 : rdp 的 port 預設是3389,要指定一個,不然多個子機是沒辦法用同一個 port 的
3。加個 & 才能背景
我試過用第一種開機,然後再試著用如下修改 rdp 的 port ,但無效
第一種
第二種VBoxManage startvm 子機名稱 --type headless
1。-v on : 開啟 rdp 功能VBoxHeadless -s 子機名稱 -v on -p 3389 &
2。-p 3389 : rdp 的 port 預設是3389,要指定一個,不然多個子機是沒辦法用同一個 port 的
3。加個 & 才能背景
我試過用第一種開機,然後再試著用如下修改 rdp 的 port ,但無效
VirtualBox 中的 RDP 功能,類似遠端桌面
作者:cross 日期:2011-05-09 20:47




