2016年12月14日 星期三

SUSE Install hangs on "starting udev…."

輸入:vga=791 nomodeset 

















VGA Resolution and Color Depth reference Chart:



Depth800×6001024×7681152×8641280×10241600×1200
8 bitvga=771vga=773vga=353vga=775vga=796
16 bitvga=788vga=791vga=355vga=794vga=798
24 bitvga=789vga=792vga=795vga=799

2015年10月19日 星期一

自動登入[Window]

Windows Server 2003
cmd輸入 rundll32 netplwiz,UsersRunDll 


Windows 7 - 8  - 8.1 - 10 -  2008-  2008R2 - 2012 - 2012R2
cmd輸入  netplwiz

以圖形化介面設定

首先我們先打開【執行】
clip_image001
然後輸入指令 netplwiz 或是 control userpasswords2
兩個指令執行結果都是一樣的,擇一即可
clip_image002
clip_image003
接下來在下面【這台電腦的使用者】中,選擇要自動登入的帳號,然後在將上面的【必須輸入使用者名稱和密碼,才能使用這台電腦】這個項目取消打勾,然後按下【確定】。
clip_image004
按下【確定】之後,會跳出一個【自動登入】的對話框,請輸入這個帳號的密碼。
按下確定就設定成功了。
clip_image005
接下來記得重新開機驗證看看,是否可以會自動登入。

以登錄檔方式設定

如果要採用登錄檔的方式來進行設定,同樣的請先打開【執行】
clip_image001[1]
然後輸入指令 regedit ,然後按下確定。
clip_image006
打開登錄編輯程式之後,找到以下機碼:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
clip_image007
然後在右邊的窗格中,找到下面兩個名稱,並予以修改
找到 [AutoAdminLogon] ,然後將值修改為 1
找到 [DefaultUserName] ,然後將值修改為要自動登入的使用者帳號,如果是網域帳號,別忘了要使用 網域\帳號 這樣的格式。
clip_image008
接下來在右邊窗格的空白處按右鍵,選擇新增一個字串值。
clip_image009
然後將名稱設定為 [DefaultPassword] ,然後將值設定為上述 [DefaultUserName] 使用者帳號所對應的密碼。
clip_image010
這樣就設定完畢了,接下來就是重新開機驗證看看是否會自動登入。

不過您有沒有發現,如果您是使用登錄檔的方式來設定自動登入的話,密碼將會以明文的方式存在登錄檔當中。要是有心人借用您的電腦,那他很可能就會在這邊得知您的常用密碼。
但是以圖形化介面來設定自動登入的話,您的密碼並不會以明文的方式被存在 DefaultPassword 中,所以相對比起來會較安全一點。

設定登入後如何在開機後登入另一個帳號

如果您已經設定了自動登入,如果在某天想要自己手動登入為另一個帳號,那又該怎麼辦呢?
要先讓他自動登入以後再登出嗎? 這樣實在很慢。還是先把設定全都取消,用完再重新設定回來? 這樣好像更複雜。
其實您可以在進入 Windows 之後,但是尚未自動登入之前,先按住鍵盤上的【Shift】,那麼他就會暫時先略過本次的自動登入作業,讓您可以手動輸入另外的帳號密碼登入。完全不需修改任何設定,等到下次開機,他還是會自動登入。

tera term的ttl常用指令

介紹幾個常用的指令

a.通過Tera Term連接PFC所在的機器以及斷開連接
通過TTLconnect/disconnect命令實現
Connect
connect '192.168.137.27 /ssh /auth=password /user=username /passwd= passwd'
注:其中username是用戶名,passwd是密碼
Disconnect
disconnect   
注:disconnect後面指定參數,這樣就不彈出確認框了。

connect '/c=3 /baud=115200'
; C=3 是com port3 ,baud rate =115200

b.通過log記錄全程操作過程,最終通過比對log確認測試結果。
通過logopen/logclose命令來寫log
logopen
logopen filename 0 1 1
注:filename最好設成命令名,不通ttl腳本不要重複。也可以帶執行的時間,
例如:Show_candidate_config_  20110426-130939.log
    方法如下:
gettime timestr "%Y%m%d-%H%M%S"
getdir mdir
sprintf2 filename '%s\ Show_candidate_config _%s.log' mdir  timestr
logclose 
           logclose

    

c.測試項作成時可能用到的命令
Pause:(暫停)
 pause <time> Remarks Pauses for <time> seconds. 


Sendln:(發送命令並換行)
sendln <data1> <data2>....
Remarks Causes Tera Term to send characters followed by a new-line character to the host.     
        

Send :(發送命令)
send <data1> <data2>....
Remarks Causes Tera Term to send characters to the host.
If <data> is a string, the string is sent to the host. 
If <data> is an integer, its lowest-order byte (0-255) is regarded as an ASCII code of the character, and the character is sent to the host.         例如:按Tab 鍵的命令是send  #9           


wait等待匹配的字符串出現)  
wait <string1> [<string2> ...]
Remarks Pauses until one of the character strings is received from the host, or until the timeout occurs. Maximum number of the strings is 10. 
     注:使用這個命令是需要設置timeout 時間,命令的返回結果保存在resault 變量中,resault 時,則為超時。Timeout 設置命令如下:
          timeout=1   /* 等號後面的值為整數,設為負則是無限等待*


waitln等待整行匹配的字符串出現)         
waitln <string1> [<string2> ...]
Remarks Pauses until a line which contains one of the character strings is received from the host, or until the timeout occurs. Maximum number of the strings is 10.     
注意點同上     其他命令例如if,then,elseif,else,endif,goto 等請參考help 文件。 

flushrecv 
有時 Tera term Macro 跑久會出現問題,通常是 Tera term 的輸出太多了,造成 Macro 的誤判,
其實也不是誤判而是從主機接收字符被傳輸到 Macro .Macro 會存儲資料在他的緩衝器中.
通常是遇到 如“wait”等待命令,Macro 會從緩衝器讀出剛剛儲存的字元.但在緩衝區中的字符

有可能發生緩衝區溢出,這時候我們可以透過 flushrecv 命令清除緩衝區的資料來避免這個問題的發生.



腳本製作注意
a.    不同的ttl 腳本內指定的Log 文件名​​不能重複。
b.    腳本的最後部分請清空測試環境,以便下一個ttl 腳本執行。
c.    在執行比較緩慢的地方,例如連接機器時,請追加pause 命令
d.    腳本盡量寫得簡潔短小,以便式樣發生變更時易於更改。
e.    必要的時候可以追加註釋


例子:
1,window 下創建bat文件
"C:\Program Files\teraterm\ttpmacro.exe" "D:\My Kownhow\TTL\test.ttl"
exit
2,生產ttl腳本文件test.ttl
;###connect host
connect '172.28.92.23 /ssh /auth=password /user=root /passwd=password'
pause 1
;###create log
gettime logstr "log-%Y%m%d-%H%M%S.txt"
getdir curdir
sprintf '%s\%s' curdir logstr
filename = inputstr
logopen filename 0 1 1
logwrite 'Log start'#13#10
looptimes = 1 ;
while looptimes < 11
 ;###run cmd 
 sendln "ls -l"
 wait "#"
looptimes = looptimes + 1
endwhile
;###closelog
Logclose
;###disconnect
disconnect
closett
執行bat文件就可以運行ttl腳本.

[Windows] 刪除右鍵選單中不必要的項目

按開始/執行,輸入 regedit

找到 KEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers 

將不想要的項目刪掉即可

[圖]
 



1.左下角[開始]-[執行]-輸入Regedit-確定
 *這一步是打開WIN的登入檔
 *WIN7 請找到附屬應用程式->命令提是自元(右鍵->以管理員身分執行)
2.找到HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\ ,把不要的快捷選單刪掉
3.關機重開之後就可以囉:Dv
不過,要提醒一點就是下手的時候要仔細,重點就是不-要-亂-刪-,刪錯了可會造成win全滅的慘事喔^^"
追加說明:
磁碟右鍵選單    HKEY_CLASSES_ROOT\Drives\shellex\ContextMenuHandlers 
檔案右鍵選單   KEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers 
資料夾右鍵選單   HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers 
IE右鍵選單   HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt