土小資訊組的工作誌

2016年7月11日 星期一

VMWare 不支援 USB 開機

VMWare 不支援 USB 開機??

一開始我也不太相信......但我使用最新版的 VMWare Workstation 就是沒辦法用 USB 開機,怎麼辦?問 Google 大神囉......

http://lmgtfy.com/?q=vmware+usb+%E9%96%8B%E6%A9%9F

2008年5月14日 星期三

校本網路研習試辦記錄--資源中心業務

為申請研習學校建立課程及指定講師及助教。
將學員名單由校務行政系統之研習系統轉成K12之帳號。新學員帳號另行處理,AZ+身份證字號後4碼。

2008年4月1日 星期二

MySQL 查詢技巧 ─ 查詢 N 天內記錄、隨機查詢記錄 查詢 N 天內記錄 Select book_id,book_name,book_desc From book_main Where book_status = 1 And book_add_date > Date_Sub(Now(),Interval 7 Day) Order By Rand() 隨機查詢一筆記錄 Select book_id,book_name,book_desc From book_main Where book_status = 1 Order By Rand() Limit 0,1

2008年3月31日 星期一

使用 Apache + AD 來做網頁資料夾的認證

<Directory />
Options All ExecCGI -Indexes
Order allow,deny
Allow from all
# LDAP Authentication & Authorization is final; do not check other databases
AuthLDAPAuthoritative on
# Do basic password authentication in the clear
AuthType Basic
# The name of the protected area or "realm"
AuthName "Something you want"
# Active Directory requires an authenticating DN to access records
AuthLDAPBindDN cn=LDAP_Username,cn=Users,dc=yourdomain,dc=com
# This is the password for the AuthLDAPBindDN user in Active Directory
AuthLDAPBindPassword LDAP_Password
# The LDAP query URL
AuthLDAPURL "ldap://ldap.yourdomain.com:389/ou=demo,dc=yourdomain,dc=com?sAMAccountName?sub?(objectClass=*)"

Require valid-user
</Directory>


2008年3月27日 星期四

用 LDIFDE 來更新 AD 使用者資訊

資料來源:
http://edu.uuu.com.tw/ucomtips/010802.htm
http://edu.uuu.com.tw/ucomtips/011016.htm

LDIFDE這一個指令是利用LDIF的檔案格式將資料以LDAP的協定匯入AD。

匯出 AD 的資料:
ldifde -f export2.ldf -u -d ou=教師,dc=admaster,dc=ttcps,dc=tpc,dc=edu,dc=tw -r objectClass=user -l dn,displayname

  • -f指定了匯出檔案的名稱。
  • -u指定了匯出檔案的編碼格式為Unicode,假如匯出的資料中包含了中文,那麼這一個參數一定要指定,否則匯出的資料會變成亂碼。
  • -d的功能在設定匯出的範圍,假如不指定的話LDIFDE指令會把AD中所有的資料匯出。
  • -d 的後面空一格直接接要匯出範圍的distinguished name。例如:-d ou=demo,dc=uuu,dc=com,代表要匯出的部分為uuu.com AD domain下的demo OU。
  • -r指定的是匯出AD的物件類型,不指定的話代表要LDIFDE指令把AD中所有的物件通通匯出。
  • -r ObjectClass=user表示要匯出的物件類型為使用者物件。
  • 最後-l代表要匯出該物件的那一個屬性。不指定的話則所有的屬性都會被匯出。屬性與屬性之間用逗號(",")來區隔。例如:-l dn,displayname 代表要匯出的屬性只有distinguished name及顯示名稱。

AD的常用欄位名稱:
標籤名稱 AD屬性的中文顯示名稱 AD屬性的英文顯示名稱 AD屬性的欄位名稱
一般/General 姓氏 First name sn
名字 Last name givenName
英文縮寫 Initials initials
顯示名稱 Display name displayName
描述 description description
辦公室 Office physicalDeliveryOfficeName
電話號碼 Telephone Number telephoneNumber
電子郵件 E-mail mail
網頁 Web page wWWHomePage
地址/Address 國家(地區) Country/region c
省份 State/province st
縣/市 City l
街道 Street streetAddress
郵遞區號 Zip/Postal Code postalCode
郵政信箱 P.O. Box postOfficeBox
帳戶/Account 使用者登入名稱 User logon name userPrincipalName
使用者登入名稱(Windows 2000前版) User logonname(pre-Windows 2000) sAMAccountName
設定檔/Profile 設定檔路徑 Profile path profilePath
登入指令檔 Logon script scriptPath
主資料夾 Home folder homeDirectory
電話/Telephones 住宅 Home homePhone
呼叫器 Pager pager
行動電話 Mobile mobile
傳真 Fax facsimileTelephoneNumber
IP電話 IP phone ipPhone
注意事項 Notes info
組織/Organization 職稱 Title title
部門 Department department
公司 Company company
主管 Manager manager
屬下 Direct report directReports

準備更新AD的檔案:
-------------------------

dn: CN=lkk,OU=教師,DC=admaster,DC=ttcps,DC=tpc,DC=edu,DC=tw
changetype: modify
replace: mail
l: lkk@mail.ttcps.tpc.edu.tw
-

dn: CN=sdd,OU=教師,DC=admaster,DC=ttcps,DC=tpc,DC=edu,DC=tw
changetype: modify
replace: mail
l: sdd@mail.ttcps.tpc.edu.tw
-

-------------------------
其中第一行"dn: CN=lkk,OU=教師,DC=admaster,DC=ttcps,DC=tpc,DC=edu,DC=tw"指定了要修改的使用者物件為lkk,接下來第二行"changetype: modify"宣告了這一整筆紀錄是要用來修改AD的資料,第三行則指定了到底要修改的屬性欄位是那一個,在這一個例子中,我們所指定的是位於使用者帳號物件"一般"標籤中的"電子郵件"欄位,它在AD中的欄位名稱為l(是L(location),不是1234的1),因此第三行用"replace: l"來指定。最後,第四行則指定了l這一個欄位中新的值為lkk@mail.ttcps.tpc.edu.tw,而且必須在次一行加上一個"-"才可以,這是檔案格式的規定。

將檔案存文字檔(若有中文請存成 unicode 編碼)
指令:
ldifde -i -f modify.ldf



phpBB3 使用 LDAP 認證時的 email 屬性

一開始在 email 屬性填入 email 時會出現錯誤。
原來是 Administrator 的 email 屬性是空的,到 AD 伺服器把 email 屬性填入之後就 OK 了。

2008年3月22日 星期六

自製遠端開機命令

收集學生機 MAC Address(使用 AMD 的 Magic Packet Utility)
Magic Packets → Create a List of Hosts

下載 Depicus 的 Wake On Lan Commend Line
http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx
語法
wolcmd [macaddress] 255.255.255.255 255.255.255.255

把學生機 MAC 填入做成 bat 檔

著作人