Windows - cllu/.rc GitHub Wiki

Some useful Windows software.

Shortcuts for Windows 8

  • Windows 键 + X :Windows快捷菜单
  • Windows 键 + C :显示个性分类和时钟
  • Windows 键 + I :打开“设置”个性分类
  • Windows 键 + K :打开“设备”个性分类
  • Windows 键 + H :打开“共享”个性分类
  • Windows 键 + W :打开所选设置的“搜索”个性分类
  • Windows 键 + F :打开所选文件的“搜索”个性分类
  • Windows 键 + Q :打开所选应用程序的“搜索”个性分类
  • Windows 键 + 空格键 :切换语言或输入法(如果启用了多种语言或输入)
  • Windows 键 + Z :打开当前应用程序的命令或选项(如果该应用程序有定义)
  • Windows 键 + Enter :打开“讲述人”
  • Windows 键 + V :在屏幕上的通知中循环切换
  • Windows 键 + Page Up :在多监视器设置中将开始屏幕移动至左监视器
  • Windows 键 + Page Down :在多监视器设置中将开始屏幕移动至右监视器
  • Windows 键 + O :开启或关闭屏幕方向锁定(如果您的电脑支持屏幕方向自动感应)
  • Windows 键 + . :当您将应用程序向一侧对齐时,此热键会将拆分栏移动至右侧
  • Windows 键 + Shift + . :当您将应用程序向一侧对齐时,此热键会将拆分栏移动至左侧

Texlive

To install spelling checker for Texworks on Windows

  1. Download English dictionary from OpenOffice Extension site.
  2. Rename .oxt to .gz, and extract the file
  3. Then copy the .aff and .dic file to corresponding dictionary folder. On Windows XP, it will be C:\Documents and Settings\cllu\.texlive2011\texmf-config\texworks\dictionaries. You can find this directory by using "Scripts -> Scripting TeXworks -> Show Scripts Folder" and navigate to the parent directory in the window that opens.
  4. Restart Texworks and choose the installed spell checker.

Configure Proxy

On Windows you can use pac file to automatically manage proxy settings. Just enable the "Use automatic configuration script" on "Internet Options -> Connections -> Local Area Network(LAN) settings" page. You can specify the file like this:

function regExpMatch(url, pattern) {
	try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}

function FindProxyForURL(url, host) {
	if (shExpMatch(url, '*://mp3.baidu.com/*')) return 'SOCKS5 localhost:7070';
	return 'DIRECT';
}

Actually it is just a javascript function to determine the proxy settings.

We can also use script to switch proxy, actually it is just change the value of register keys.

import _winreg

def switch_proxy():
    proxy_list = ['socks=localhost:7070']
    
    proxy_server = proxy_list[0]
    
    # register path and keys 
    root = _winreg.HKEY_CURRENT_USER
    reg_path = r"Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    reg_settings = [
        (reg_path, "ProxyEnable", 1, _winreg.REG_DWORD),
        (reg_path, "ProxyServer", proxy_server, _winreg.REG_SZ),
    ]
    
    # check current path
    hKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, reg_path)
    cur_proxy_enabled, _ = _winreg.QueryValueEx(hKey, "ProxyEnable")
    cur_proxy_server, _ = _winreg.QueryValueEx(hKey, "ProxyServer")
    print "Current proxy settigns: ", cur_proxy_enabled, cur_proxy_server
    
    # set the key
    for key_path, value_name, value, value_type in reg_settings:
        hKey = _winreg.CreateKey(root, key_path)
        _winreg.SetValueEx(hKey, value_name, 0, value_type, value)
        
    print "Setting to", proxy_server

if __name__ == "__main__":
    switch_proxy()