Parallels Desktop 8 + 9 Apps
https://deals.macupdate.com/bundle/affil/11708
2013-03-16
How to reclaim thin VMDK space for Windows guest
1. Download "sdelete" and put it on VM guest.
2. Execute "sdelete -z c:" (if VM guest had other driver letter, should do them all)
3. After finished, power-off VM guest.
4. SSH to the host which VM guest is on it.
5. Change the volume where VM guest is on it.
6. "ls -lh *.vmdk" to check the vmdk size.
7. "du -h *.vmdk" to see the vmdk real size.
8. "vmkfstools -punchzero VM.vmdk"
9. After above job done, execute "du -h *.vmdk" again to check the size.
10. Power-on the VM guest and check the storage usage on vSphere Client.
2. Execute "sdelete -z c:" (if VM guest had other driver letter, should do them all)
3. After finished, power-off VM guest.
4. SSH to the host which VM guest is on it.
5. Change the volume where VM guest is on it.
6. "ls -lh *.vmdk" to check the vmdk size.
7. "du -h *.vmdk" to see the vmdk real size.
8. "vmkfstools -punchzero VM.vmdk"
9. After above job done, execute "du -h *.vmdk" again to check the size.
10. Power-on the VM guest and check the storage usage on vSphere Client.
2013-01-19
Delete files older than X days
Belvedere
http://lifehacker.com/341950/
xdel
http://sourceforge.net/projects/xdel/
DelAge32
http://www.horstmuc.de/wbat32.htm
http://lifehacker.com/341950/
xdel
http://sourceforge.net/projects/xdel/
DelAge32
http://www.horstmuc.de/wbat32.htm
2012-12-09
Adfind
http://www.joeware.net/freetools/tools/adfind/index.htm
adfind –b <Search Base> -s <Search Scope> -f <Search Filter> attributesDesired
1.所以對域中所有計算機對象的DN 和說明的查詢應為:
adfind –b dc=contoso,dc=com –s subtree –f (objectclass=computer) dn description
2.對所有用戶對象的查詢如下所示:
adfind –b dc=contoso,dc=com –s subtree –f "(&(objectcategory=person) (objectclass=user))" dn description
adfind –b <Search Base> -s <Search Scope> -f <Search Filter> attributesDesired
1.所以對域中所有計算機對象的DN 和說明的查詢應為:
adfind –b dc=contoso,dc=com –s subtree –f (objectclass=computer) dn description
2.對所有用戶對象的查詢如下所示:
adfind –b dc=contoso,dc=com –s subtree –f "(&(objectcategory=person) (objectclass=user))" dn description
Forfiles
http://technet.microsoft.com/en-us/library/cc753551(WS.10).aspx
Syntax
forfiles [/p Path] [/m SearchMask] [/s] [/c Command] [/d[{+ | -}] [{MM/DD/YYYY | DD}]]
Parameters
/p Path
指定您要在其上開始搜尋的 Path。預設資料夾為目前的工作目錄,您可以透過輸入句點 (.) 來指定。
/m SearchMask
依據 SearchMask 來搜尋檔案。預設的 SearchMask 為 *.*。
/s
指示 forfiles 在子目錄中搜尋。
/c Command
在每個檔案上執行指定的 Command。您必須將帶有空格的命令字串包含在引號中。預設的 Command 為 "cmd /c echo @file"。
/d[{+ | -}] [{MM/DD/YYYY | DD}]
選取日期大於等於 (+) 或小於等於 (-) 指定日期的檔案,其中 MM/DD/YYYY 是指定的日期,而 DD 是目前日期減去 DD 天。如果您未指定 + 或 -,則會使用 +。DD 的有效範圍為 0 - 32768。
/?
在命令提示字元上顯示說明。
Remarks
• Forfiles 最常使用於批次檔案中。
• Forfiles /s 與 dir /s 類似。
• 下列表格列出了您可以在 /cCommand 命令字串中使用的變數。
變數 描述
@file 檔案名稱
@fname 不含副檔名的檔案名稱
@ext 副檔名
@path 檔案的完整路徑
@relpath 檔案的相對路徑
@isdir 如果檔案類型是目錄,則判斷值是 TRUE,否則判斷值是 FALSE。
@fsize 檔案大小 (以位元組為單位)
@fdate 檔案上的上次修改日期戳記
@ftime 檔案上的上次修改時間戳記
• 使用 forfiles,您可以在多個檔案上執行命令,或將引數傳送到多個檔案。例如,您可以在樹狀目錄中帶有 *.txt 副檔名的所有檔案上執行 TYPE 命令。或者,您可以執行 C: 磁碟機上的每個批次檔案 (*.bat),以檔案名稱 Myinput.txt 作為第一個引數。
• 使用 forfiles,您可以執行下列任何一項動作:
• 使用 /d 按絕對或相對日期選取檔案。
• 使用變數,例如 @fsize (檔案大小) 及 @fdate (檔案日期),來建立檔案的保存樹狀目錄。
• 使用 @isdir 變數以從目錄中區分檔案。
• 藉由在命令列中包含特殊字元,及使用十六進位字碼 0xHH 包圍字元,來格式化輸出。
• Forfiles 藉由執行工具 (設計用於僅處理單一檔案)上的 recurse subdirectories 旗標來運作。
Examples
若要列出 C: 磁碟機上的所有批次檔案,請輸入:
forfiles /p c:\ /s /m *.bat /c "cmd /c echo @file is a batch file"
若要列出 C: 磁碟機上的所有目錄,請輸入:
forfiles /p c:\ /s /m *.* /c "cmd /c if @isdir==true echo @file is a directory"
若要列出 C: 磁碟機上 100 天之前的所有檔案,請輸入:
forfiles /p c:\ /s /m *.* /dt-100 /c "cmd /c echo @file :date >= 100 days"
若要列出 C: 磁碟機上 1993 年 1 月 1 日之前的所有檔案,再為這些檔案顯示 "file is quite old!",請輸入:
forfiles /p c:\ /s /m *.* /dt-01011993 /c "cmd /c echo @file is quite old!"
若要列出 C: 磁碟機上所有檔案的所有副檔名(按欄位格式),請輸入:
forfiles /p c:\ /s /m *.* /c "cmd /c echo extension of @file is 0x09@ext0x09" With:
若要列出 C: 磁碟機上的所有批次檔案,請輸入:
forfiles /p c:\ /s /m *.bat /c "cmd /c echo @file is a batch file"
若要列出 C: 磁碟機上的所有目錄,請輸入:
forfiles /p c:\ /s /m *.* /c "cmd /c if @isdir==true echo @file is a directory"
若要列出 C: 磁碟機上 100 天之前的所有檔案,請輸入:
forfiles /p c:\ /s /m *.* /d t-100 /c "cmd /c echo @file :date >= 100 days"
若要列出 C: 磁碟機上 1993 年 1 月 1 日之前的所有檔案,再為這些檔案顯示 "file is quite old!",請輸入:
forfiles /p c:\ /s /m *.* /d t-01011993 /c "cmd /c echo @file is quite old!"
若要列出 C: 磁碟機上所有檔案的所有副檔名(按欄位格式),請輸入:
forfiles /p c:\ /s /m *.* /c "cmd /c echo extension of @file is 0x09@ext0x09"
#刪除超過7天,位於 c:\windows\Temp 路徑中檔名 sess開頭的檔案
forfiles /P c:\Windows\Temp /M sess_* /S /D -7 /C "cmd /c del /F @path"
2012-11-17
The procedures for obtaining diagnostic information for VMware vCenter Server
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1011641#method1
2012-10-13
MRBS -- LDAP
mrbs 1.4.8 on OB2D with "apt-get install php5-ldap"
check ldap log
/var/log/apache2/error.log
systemdefaults.inc.php
auth_ldap.inc
check ldap log
/var/log/apache2/error.log
systemdefaults.inc.php
$auth["type"] = "ldap"; $ldap_host = "server.abc.com"; $ldap_port = 389; $ldap_v3 = false; $ldap_tls = false; $ldap_base_dn = "c=uers,DC=abc,DC=com"; $ldap_user_attrib = "uid"; $ldap_dn_search_attrib = "sAMAccountName"; $ldap_dn_search_dn = "CN=user,cn=users,DC=abc,DC=com"; $ldap_dn_search_password = "xxxxxx"; $ldap_disable_referrals = TRUE; $ldap_get_user_email = FALSE; $ldap_email_attrib = "mail"; //$ldap_unbind_between_attempts = TRUE; $ldap_debug = TRUE; //$ldap_filter = "memberof=cn=MRBSUsers,ou=MRBS,ou=Groups,dc=ufv,dc=ca"; //$ldap_admin_group_dn = "cn=MRBSAdmins,ou=MRBS,ou=Groups,dc=ufv,dc=ca"; //$ldap_group_member_attrib = "memberof";
auth_ldap.inc
// Turn any non-array config items into arrays in $all_ldap_opts
+ if (!isset($count))
+ {
+ $count = 1;
+ }
foreach ($config_items as $item)
{
if (!isset($$item))
訂閱:
文章 (Atom)