搜尋此網誌

2009年10月12日 星期一

Defining Your Own etc\HOSTS in Windows XP

C:\Windows\System32\Drivers\etc\HOSTS

# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
163.22.20.101 ns4
2001:e10:6840:19:204:acff:feee:7539 stu

2009年7月29日 星期三

Clear Putty's Cache

http://tripoverit.blogspot.com/2007/03/clear-puttys-cache.html

For all those of you who have been trying to clear Putty’s cache of host fingerprints (Windows) for development or testing, here is the answer:

1. Open the registry (regedit)
2. Go to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys

There you should see Putty’s cache of host keys.
The ‘name’ column tells you which key is for which server.
For example, it will have the format of @: [dss@22:EDA.ipv6.club.tw]

3. Delete the rows that you need.

For Unix users, edit the file "~/.ssh/known_hosts".

2009年3月6日 星期五

How to disable the Autorun features

How to use Group Policy settings to disable all Autorun features
Windows Server 2003, Windows XP, and Windows 2000

1. Click Start, click Run, type Gpedit.msc in the Open box, and then click OK.
2. Under Computer Configuration, expand Administrative Templates, and then click System.
3. In the Settings pane, right-click Turn off Autoplay, and then click Properties.
Note In Windows 2000, the policy setting is named Disable Autoplay.
4. Click Enabled, and then select All drives in the Turn off Autoplay box to disable Autorun on all drives.
5. Click OK to close the Turn off Autoplay Properties dialog box.
6. Restart the computer.

How to selectively disable specific Autorun features
To selectively disable specific Autorun features, you must modify the NoDriveTypeAutoRun value under the following registry key subkey:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\
How you modify this subkey depends on the Autorun feature that you want to disable. For more information about Autorun registry key values, visit the following Microsoft TechNet Web page:
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/91525.mspx?mfr=true ( http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/91525.mspx?mfr=true)
Autorun is also known as AutoPlay. The following table shows the settings for the NoDriveTypeAutoRun registry value.
Collapse this tableExpand this table
Value Meaning
0x1 Disables AutoPlay on drives of unknown type
0x4 Disables AutoPlay on removable drives
0x8 Disables AutoPlay on fixed drives
0x10 Disables AutoPlay on network drives
0x20 Disables AutoPlay on CD-ROM drives
0x40 Disables AutoPlay on RAM disks
0x80 Disables AutoPlay on drives of unknown type
0xFF Disables AutoPlay on all kinds of drives

2009年2月24日 星期二

Disable Autorun in Windows

http://support.microsoft.com/kb/967715

Windows Server 2003, Windows XP, and Windows 2000

1. Click Start, click Run, type Gpedit.msc in the Open box, and then click OK.
2. Under Computer Configuration, expand Administrative Templates, and then click System.
3. In the Settings pane, right-click Turn off Autoplay, and then click Properties.

Note In Windows 2000, the policy setting is named Disable Autoplay.
4. Click Enabled, and then select All drives in the Turn off Autoplay box to disable Autorun on all drives.
5. Click OK to close the Turn off Autoplay Properties dialog box.
6. Restart the computer.

2009年2月9日 星期一

WSAStartup 無法解析的外部符號

使用"WSAStartup(MAKEWORD(2, 2), &wsaData)"時遇到問題,
出現了"imp__WSAStartup@8 error LNK1120: 1 個無法解析的外部符號",
在http://www.diybl.com/course/3_program/c++/cppsl/2008315/104702.html裡找到了解決方法,
原來是沒有加入ws2_32.lib,
在最上面的選項中按專案 -> '專案名稱'屬性 -> 組態屬性 -> 連結器 ->命令列 裡面的"其他選項"
輸入ws2_32.lib就可以加入了!


hostent與gethostbyname function(或gethostbyaddr function)搭配使用,
不僅可以知道IP address和domain name,
還可知道address的type、長度、別名(同樣可連到此網站的另一個domain name)。
WSAGetLastError可判斷發生何種錯誤,若回傳值為0,則沒有錯誤。