Leona+ Dream for future

14Feb/100

SciTE64 v1.0.1 Beta Release Notes

Click here to download the latest SciTE64.

  • Integrated with SciTE 2.02
  • Add an executable to replace notepad.exe
  • Add some keywords to powershell.properties
Filed under: Software No Comments
13Feb/100

Take ownership of a file

Vista引入了UAC等一系列访问控制权限的管理机制,使得用户管理文件越来越麻烦了,比如重命名C:\Windows\notepad.exe(记事本),会发现只有TrustedInstaller对它有控制权,自己反而没有,哭吧-_-

其原因是Windows不希望用户更改一些关键的文件,所以没有把这些文件的控制权限给用户,只把权限给了TrustedInstaller,它是Windows的安装程序所用的帐号,比用Windows Update可以通过它来更新系统文件。

但是这终究是我自己的电脑嘛,自己电脑上的文件,自己反而不能控制了,这的确是一件很尴尬的事。不过,办法总是有的:

1. 先用管理员权限运行CMD,如下图:

2. 输入以下命令后回车

1
TAKEOWN /F %SystemRoot%\notepad.exe

如果成功的话,会显示“成功,此文件现在由(用户名)所有。”

3. 再输入以下命令后回车

1
ICACLS %SystemRoot%\notepad.exe /grant Administrators:F

成功后会显示“已处理1个文件,处理0个文件时失败。”

然后就可以对notepad.exe进行重名命了,甚至删除也是可以的。

Filed under: Management No Comments
3Feb/100

Execution Policy in Powershell

Powershell is a powerful tool that may be used to replace traditional batch command line. But by default, Powershell doesn't allow executing script file, (maybe for security reasons). Executing Powershell script will cause the following error message:

File <file_url> cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:11

+ .\<file_name> <<<<
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

This is because the default Execution Policy is Restricted, which means Powershell permits individual commands, but will not run scripts, including formatting and configuration files (.ps1xml), module script files (.psm1), and Windows PowerShell profiles (.ps1).

The solution is to loosen the policy, for example, set it to RemoteSigned or Unrestricted. Just run the following command in Powershell:

1
Set-ExecutionPolicy RemoteSigned

Then it alerts:

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?

Press Y and it's done.

Filed under: Software No Comments
16Jan/101

修改了一下密码,嗯

本来ATM机上用的密码有两个,一个查询,一个消费。后来查询密码被一同事说不安全,于是就开始改……要打三家银行的电话,真麻烦-_-

顺便也改了一下常规的密码,原先的常规密码有三个,按复杂度(1)8位,大小写字母+数字,(2)10位,小写字母+数字,(3)8位纯小写字母。现在把(2)弃用了,加了一个新的10位大小写字母+数字+符号的。

又顺便了解了一下密码强度的资料。好像有些网站认为16位以上的密码才能算是强密码,不过16位实在太长了,打得慢容易被发现-_-我就用用10位的就可以了。有兴趣的可以猜一下,嘿嘿。

Filed under: Security 1 Comment
5Jan/101

God Mode in Windows 7

Although its name suggests perhaps even grander capabilities, Windows enthusiasts are excited over the discovery of a hidden "GodMode" feature that lets users access all of the operating system's control panels from within a single folder.

By creating a new folder in Windows 7 and renaming it with a certain text string at the end, users are able to have a single place to do everything from changing the look of the mouse pointer to making a new hard-drive partition.

To enter "GodMode," one need only create a new folder and then rename the folder to the following:

Leonax.Net.{ED7BA470-8E54-465E-825C-99712043E01C}

Once that is done, the folder's icon will change to resemble a control panel and will contain dozens of control options. I'm not sure it's my idea of playing God, but it is a handy way to get to all kinds of controls.

Filed under: Software 1 Comment
16Dec/091

Byte vs bit

字节(Byte)位(bit)的关系其实不复杂,1字节 = 8位,表示的是同一种东西,只是大小不同罢了,就像千克(kg)和克(g)。只不过他们的缩写都是B,大小写不同,于是被一些无良的商人拿来忽悠。

大多数场合下都是命名用字节也就是Byte的,比如1G的内存,就是1G Byte大小的内存。只有在少数情况下,比如描述网络带宽的时候,常说的2M的ADSL,表示的是带宽为2M bit的ADSL,也就是带宽为256K Byte。这就解释了为什么2M的ADSL,下载速度一般只能上到220K ~ 240K左右,因为它最高只能达到256K嘛。所以一部600M的电影,是无论如何也不可能在5分钟里下载完的,最快也要40分钟。

Filed under: Hardware 1 Comment
16Dec/092

32 bit vs 64 bit

随着XP逐渐淡出人们的视线,新一轮购机热潮的兴起,64位系统也得已进入大众的视线。那到底什么是64位咧?

这个问题要从什么是位(bit)说起,一位就是一个能表示0和1这两种状态的单元,32位计算机中一个整数由32个这样的单元表示,最小的数是0的话,最大可以表示到43亿不到一点(4294967295)。和数学中把8横过来写就可以容易地表示无穷大相比,计算机里的数字表示法就比较麻烦了,一旦计算的范围超过了一个整数的大小,就需要把两个(或多个)整数拼起来表示更大的数,这样就影响了性能。于是就出现了64位的计算机,64位的整数表示的范围就相当得大了(0 - 18446744073709551615),同时也提升了计算机的性能。

虽然64位的家用CPU早在03年就有了,但64位系统到现在都没有普及,原因是64位的应用程序太少。Windows从Windows Server 2003开始支持64位,后续的VistaWindows 7都有64位版本。在64位的Windows上可以正常地运行32位的程序,所以在最坏情况下,64位系统的性能和32位系统相当,一般都会有一些提升。

64位系统和32位系统最大的区别是,64位系统(比如Windows 7)支持的内存最大可以到192GB,而32位系统(比如XP)最大只有4G(一般实际使用到的只有3~3.5G,只有打开了物理内存扩展Physical Address Extension之后才能使用剩下的空间,但性能会有所下降)。喜欢大内存的同学,就义无反顾地装64位吧~~

Filed under: Hardware 2 Comments
14Dec/093

Memory vs Hard disk

看到了cnbeta上的一篇文章,深有同感啊。当年经常修电脑的时候,也向别人解释过无数次内存和硬盘的问题。文章中举的例子也不错,说明了为什么内存大速度就会快,当然也不是越大速度就越快的,因为日常烧饭只需要这么一块地方嘛,再大了就浪费了。除非家里有客人,比如逢年过节聚会的时候,要多烧很多菜,才需要更大的空间,这时候可能会把一些东西临时放到厨房外的餐桌上,或者塞回冰箱里,这就是虚拟内存-_-(准确地说是虚拟内存在硬盘上的那部分)

那多大的内存够用咧?一般笔记本2G,台式机4G就差不多了。(注意,这篇文章写于2009年12月,如果您不幸在10年后读到这篇文章,就把以上数据忽略吧……)那2G究竟有多大咧?Windows 7启动完毕之后大约占掉1/3,开个杀毒软件、各种驱动的小工具和一些不知名的小图标,大约总共可以耗掉一半的内存。然后开几个聊天工具,十七八个网页,再搞个电影看看,可用内存差不多就只有1/3到1/4了……现在有概念了吧……

顺便说一下内存的参数吧,除了容量之外,还有一个参数是频率。常见的数字有533、667、800、1066等,单位是MHz。内存频率决定了内存的吞吐量,即每秒进出内存的数据量。当然频率也不是越高越好,内存频率只要不低于CPU的前端总线频率即可,高了也没啥用。内存条上一般会有一个标签写着“1GB 2R*16 PC2-6400S-666-12”,表示内存大小1GB,双面,每面16块内存颗料,型号为PC2-6400S,后面的666-12我也不知道是啥。PC2-6400S表示该内存为DDR2内存,频率为800MHz,吞吐量6400MB/s。

至于硬盘嘛,就比较简单了,数字越大越好:P。固态硬盘暂且不提,价格太高还无法普及。常见的碟片式硬盘,容量从320GB到2TB不等,转速有5400转和7200转2种,尺寸常见的有2.5英寸(笔记本)和3.5英寸(台式机),接口都是SATA的了,IDE已经很少很少了。转速越高,传输速度越快,当然噪音也越大,这个就仁者见仁啦……

Filed under: Hardware 3 Comments
22Nov/099

Rough Analysis on netbooks (2009.11)

最近不少人想买(或买了)上网本(包括我),顺便就小研究了一下……

先说一下标配:

  • CPU: Intel Atom N270/280 。新机器280的多一点。
  • 内存:1G DDR2 533/667。没见过直接上800的,不过这个问题不大啦。
  • 硬盘:160G 5400转,没见过配7200转的。
  • 显示屏:10.1寸,1024*600。
  • 显卡:Intel GMA950。
  • 无线:802.11n
  • 蓝牙:有

大多数机器都是这个配置,主要区别是外观和电池,这个因人而异啦。以下按我喜欢的程度排序:

  1. Asus EeePC 1000HE。主要特点是续航时间长,在Windows 7下也可以达到6小时。出去玩,在路上用用足够了。而且价格也很公道,京东上面已经跌下2700了。
  2. Sony Vaio W12。优点是250G硬盘,2G内存和1366*768的显示屏,不过不知道为什么内存是533的,因为N280的前端总线是667的,感觉有点奇怪……我相当喜欢1366*768的屏呀,只可惜W12的电池只能用2小时,而且价格也稍贵,官网卖价是3999,当时抉择了一下还是买了1000HE。
  3. Asus EeePC 1005HA。特点是好看,体积小,而且续航时间超过1000HE的一半。
  4. Sony Vaio X。目前最牛的上网本了吧,当然也是最高的价格-_-。Z540+2G内存+128G固态硬盘+11.1寸1366*768显示屏,高度只有1000HE的一半。当然,价格是1000HE的4倍,用同事的话来说,买4个1000HE来组个集群就比它强了……
  5. Acer Aspire One 751h 和 Asus EeePC 1101HA。优点是1366*768-_-,缺点是CPU比较烂,Z520,这个CPU被评价为“优点:可以超频;缺点:必须超频以满足日常需要”……

现在上网本还是台湾的厂商做得比较好,性价比高,欧美的比如HP和Dell,价格都偏高,也没什么出众的地方,大陆的么,价格可能会有低的,不过质量信不过啊……

另外有一点不理解的是,为什么Intel要把虚拟化技术(Intel Virtualization Technology)做进Atom Z系列,这么差的CPU也能跑虚拟机?

Filed under: Hardware 9 Comments
15Oct/090

Install IIS7.5 on Windows 7

在Vista上装IIS可以用pkgmgr.exe (Package Manager)。命令行一般是:

pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;

在Windows 7上这个工具不起作用了,要用另一个:dism.exe (Deployment Image Servicing and Management). 装一个完整的IIS,命令行如下:

DISM /Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-BasicAuthentication /FeatureName:IIS-CGI /FeatureName:IIS-ClientCertificateMappingAuthentication /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-CustomLogging /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DigestAuthentication /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-FTPExtensibility /FeatureName:IIS-FTPServer /FeatureName:IIS-FTPSvc /FeatureName:IIS-HealthAndDiagnostics /FeatureName:IIS-HostableWebCore /FeatureName:IIS-HttpCompressionDynamic /FeatureName:IIS-HttpCompressionStatic /FeatureName:IIS-HttpErrors /FeatureName:IIS-HttpLogging /FeatureName:IIS-HttpRedirect /FeatureName:IIS-HttpTracing /FeatureName:IIS-IIS6ManagementCompatibility /FeatureName:IIS-IISCertificateMappingAuthentication /FeatureName:IIS-IPSecurity /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-LegacyScripts /FeatureName:IIS-LegacySnapIn /FeatureName:IIS-LoggingLibraries /FeatureName:IIS-ManagementConsole /FeatureName:IIS-ManagementScriptingTools /FeatureName:IIS-ManagementService /FeatureName:IIS-Metabase /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-ODBCLogging /FeatureName:IIS-Performance /FeatureName:IIS-RequestFiltering /FeatureName:IIS-RequestMonitor /FeatureName:IIS-Security /FeatureName:IIS-ServerSideIncludes /FeatureName:IIS-StaticContent /FeatureName:IIS-URLAuthorization /FeatureName:IIS-WebDAV /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerManagementTools /FeatureName:IIS-WebServerRole /FeatureName:IIS-WindowsAuthentication /FeatureName:IIS-WMICompatibility /FeatureName:WAS-ConfigurationAPI /FeatureName:WAS-NetFxEnvironment /FeatureName:WAS-ProcessModel /FeatureName:WAS-WindowsActivationService

蛮恐怖的命令行,嗯-_-

Filed under: Management No Comments