瀏覽模式: 普通 | 列表
more /var/log/messages
Jun 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 - 連線被拒絕
解決方式為,編輯 /etc/samba/smb.conf

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
標籤: samba cups 631

如何在非LVM環境掛載LVM磁區的硬碟

我今天拿了一顆有作LVM分割的硬碟,想要抓取裡面的資料

一般我們掛載都是直接 mount /dev/sdb1 /XXX 就可以了,但

它是經過LVM切割,mount時會跟我要type,無法成功掛載

所以要這麼作 (如下)

1。先 pvscan 掃一下是否有LVM磁區
  PV /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   ]
2。就可以看到一個VG名稱叫VolGroup,再用 vgchange -ay VolGroup

[閱讀全文]

標籤: lvm mount 掛載

Linux 的 /tmp 會被定期的刪除檔案或目錄

/tmp是Linux 用來放暫存資料的地方,網頁php程式也常用到

系統有支排程在 /etc/cron.daily/tmpwatch

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
它每天執行,來掃 /tmp 目錄下的檔案或目錄,已超過10天的就把它刪除

第三行的 240 數值代表是小時,等於10天

第四行則是30天來清 /var/tmp

-x 參數代表要排除不刪的

perl 如何輸入密碼時以星號*顯示

在 Linux 底下可以真的顯示 * 號,但windows要readmode 為2才可讓我能成功enter,不過是enter完後才看到*號
use 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://zh-tw.w3support.net/index.php?db=so&id=701078
# ref: http://forums.devshed.com/perl-programming-6/problem-with-readmode-under-use-term-readkey-462494.html
標籤: perl password

使用 mondo 線上備份linux centos 系統

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#BB2. How to configure to use RPMforge ?  拿的

[閱讀全文]

背景執行子機有兩種方式

第一種
VBoxManage startvm 子機名稱 --type headless
第二種
VBoxHeadless -s 子機名稱 -v on -p 3389 &
   1。-v on  : 開啟 rdp 功能
   2。-p 3389 : rdp 的 port 預設是3389,要指定一個,不然多個子機是沒辦法用同一個 port 的
   3。加個 & 才能背景


我試過用第一種開機,然後再試著用如下修改 rdp 的 port ,但無效

[閱讀全文]

VirtualBox 中的 RDP 功能,類似遠端桌面

在每個虛機的設定,在display的地方,有個 remote display
attachments/201105/2683998211.png
打勾 Enable Server 就可以讓這個虛機使用windows 上的遠端桌面程式來連線操作

那如果已經開機的時後呢,虛機在跑時,是無法從介面變更設定的

可以執行
VBoxManage controlvm 虛機名稱 vrdp on
讓虛機線上就可以使用 rdp 了

停掉的話
VBoxManage controlvm 虛機名稱 vrdp off




標籤: virtualbox rdp