Assembly CPU frequency measuring algorithm

Intel CPUs after Core Duo support two Model-Specific registers called IA32_MPERF and IA32_APERF. MPERF counts at the maximum frequency the CPU supports, while APERF counts at the actual current frequency. The actual frequency is given by: You can read them with this flow ; read MPERF mov ecx, 0xe7 rdmsr mov mperf_var_lo, eax mov mperf_var_hi, … Read more

How to set system wide umask?

Both Debian and Ubuntu ship with pam_umask. This allows you to configure umask in /etc/login.defs and have them apply system-wide, regardless of how a user logs in. To enable it, you may need to add a line to /etc/pam.d/common-session reading session optional pam_umask.so or it may already be enabled. Then edit /etc/login.defs and change the … Read more

Windows CMD.exe “The system cannot find the path specified.”

The problem is that some program has been set to autorun when you run cmd.exe. In my case it was ANSICON that was installed… and then I moved the file without properly uninstalling. I found a solution in this blog post: http://carol-nichols.com/2011/03/17/the-system-cannot-find-the-path-specified/ The short version is to find HKCU\Software\Microsoft\Command Processor\AutoRun and clear the value.