Friday, February 10, 2012
MacPro CD/DVD tray problem in ubuntu
I was able to eject a cd/dvd in unbuntu 9 from the command line using "eject." Somehow it doesn't work anymore in 11.10, neither does "eject /dev/cdrom" or "eject cdrom" work. By going into the /dev directory, I found that cdrom is just a link for sr0 in my MacPro, and "eject /dev/sr0" did the job! There is also a sr1 which I thought was the 2nd tray in MacPro, but "eject /dev/sr1" didn't do anything.
Wednesday, January 18, 2012
Fix bcd the elegant way
Oh well, I messed up the bcd and the Win 7 installation CD didn't find the OS installed. Then I tried bootrec /rebuildbcd, which found one out of two installed OS, but it couldn't continue and complained that bcd is being used by another process.
I was about to give up but then found this post (http://neosmart.net/wiki/display/EBCD/Recovering+the+Windows+Bootloader+from+the+DVD)
bootrec.exe /fixmbr bootsect.exe /nt60 all /force
cd C:\bootattrib -h -s BCD del BCDbcdedit /createstore bcd.temp bcdedit.exe /store bcd.temp /create {bootmgr} /d "Windows Boot Manager" bcdedit.exe /import bcd.temp bcdedit.exe /set {bootmgr} device partition=C: bcdedit.exe /timeout 10 attrib -h -s bcd.temp del bcd.temp
bcdedit.exe /create /d "Microsoft Windows" /application osloader
bcdedit.exe should return a message with a GUID for the newly-created entry, something like this:
The entry {c0dfc4fa-cb21-11dc-81bf-005056c00008} was successfully created.
Then use this number/entry and type
bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} device partition=C: bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} osdevice partition=C: bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} path \Windows\system32\winload.exe bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} systemroot \Windowsbcdedit.exe /displayorder {c0dfc4fa-cb21-11dc-81bf-005056c00008}
In my case the XP is on C: and Win 7 on E:. However, the winload.exe is missing in the XP partition(?), so I had to try a second time and set all the "C:" above to "E:" which solved the problem.
Another thought: Maybe I should have changed the attribute of the bcd file and tried /rebuildbcd? Anyway, the problem is now fixed.
Updated: A similar but more complete guide was found on http://idoneitmyself.wordpress.com/2009/11/15/windows-7-suddenly-wont-boot-reboot-and-select-proper-boot-device-or-insert-boot-media-in-selected-boot-device-and-press-any-key-repairing-the-windows-7-bootloader/
Updated: A similar but more complete guide was found on http://idoneitmyself.wordpress.com/2009/11/15/windows-7-suddenly-wont-boot-reboot-and-select-proper-boot-device-or-insert-boot-media-in-selected-boot-device-and-press-any-key-repairing-the-windows-7-bootloader/
Monday, December 5, 2011
Monday, November 21, 2011
Squares shown in places of Chinese characters
In Windows Enterprise Chinese characters in folders and other places (like the title bar in chrome) are not shown correctly. This problem does not exist in the home premier edition. A simple solution is to change the system locale to Chinese and then change back to English. Still, I wonder how MS let this slip though their quality control. I now see more evidences of the failing of MS and the rising of Apple.
Friday, October 21, 2011
Uninstallation a program in windows after registry clearner failed
Recently I swapped the hard drives between two laptops. HP's programs on one of them refused to be uninstalled in the new laptop. Manual registry removal the entries in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
helped, but it also brought some other HP programs back which I thought had been uninstalled. Next phase of using all sorts of registry cleaners did not work. So there we go - manually search for all entries with "hewlett" in the registry. Bingo! They were located in
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products.
After deleting them the entries in the program list were finally gone.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
helped, but it also brought some other HP programs back which I thought had been uninstalled. Next phase of using all sorts of registry cleaners did not work. So there we go - manually search for all entries with "hewlett" in the registry. Bingo! They were located in
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products.
After deleting them the entries in the program list were finally gone.
Thursday, December 9, 2010
Lorentzian and related concepts
Lorentzian, or Lorentz distribution, is also known as Cauchy distribution. It also has a relativistic version, the Breit-Wigner distribution f(E) ~ [(E^2-M^2)^2 + M^2\Gamma^2]^-1.
The Fano resonance, characterized by f(E) ~ [(E-M + q*\Gamma)][(E-M)^2 + \Gamma^2]^{-1}, is [E-M+q*\Gamma] times the Lorentzian. Thus the Fano resonance is asymmetric even when \Gamma is E-independent. The parameter q is called the Fano parameter, which represents the ratio between the resonant and direct scattering. In the absence of direct scattering, q-> infinity and the Fano resonance reduces to the Lorentzian.
The Feshbach-Fano partitioning separates the scattering into two parts, the resonance part P, and the direct (background) part Q, with P+Q=1. The operators related to P and Q are defined somewhat arbitrarily, but once they are defined, the total scattering process (defined by a Hamiltonian H), can be unique separated into two parts, PHP, and [QHQ + \Delta(E) - i\Gamma].
The Fano resonance, characterized by f(E) ~ [(E-M + q*\Gamma)][(E-M)^2 + \Gamma^2]^{-1}, is [E-M+q*\Gamma] times the Lorentzian. Thus the Fano resonance is asymmetric even when \Gamma is E-independent. The parameter q is called the Fano parameter, which represents the ratio between the resonant and direct scattering. In the absence of direct scattering, q-> infinity and the Fano resonance reduces to the Lorentzian.
The Feshbach-Fano partitioning separates the scattering into two parts, the resonance part P, and the direct (background) part Q, with P+Q=1. The operators related to P and Q are defined somewhat arbitrarily, but once they are defined, the total scattering process (defined by a Hamiltonian H), can be unique separated into two parts, PHP, and [QHQ + \Delta(E) - i\Gamma].
Monday, October 11, 2010
x11vnc
I finally gave up trying to start vino on my remote linux box after numerous failures. The new VNC server I use now is x11vnc. The command is simply:
x11vnc -rfbauth ~/.vnc/passwd -bg -forever -display :0
"-rfbauth ~/.vnc/passwd" specifies the passwd file, "-bg" lets the server run in the background, and "-forever" keeps the server running forever (versus "-once" which stops the server after the viewer exits).
To store the password file, use
x11vnc -storepasswd PATH
and the prompt will ask you to input the password and confirm it. The default path for the file is ~/.vnc/passwd.
Two independent problems:
x11vnc -rfbauth ~/.vnc/passwd -bg -forever -display :0
"-rfbauth ~/.vnc/passwd" specifies the passwd file, "-bg" lets the server run in the background, and "-forever" keeps the server running forever (versus "-once" which stops the server after the viewer exits).
To store the password file, use
x11vnc -storepasswd PATH
and the prompt will ask you to input the password and confirm it. The default path for the file is ~/.vnc/passwd.
Two independent problems:
- On one of my linux box the shift key is disabled somehow. I found the following post which is very helpful (http://www.openg.info/tag/x11vnc-enable-shift-key). It suggested adding "-nomodtweak" which worked!
- On the other one I had the problem via ssh that x11vnc failed to start ":0" and it suggested me using "XAUTHLOCALHOSTNAME=localhost" which didn't help. But it worked fine if I started x11vnc directly on the box. It turned out that x11vnc couldn't find the .Xauthority file which was put in a weird place. All I needed to do was to type "x11vnc -findauth" on the box and use the output location when connecting via ssh. "x11vnc -auth XAUTHORITYPATH ...". Bravo!
- x11vnc has a GUI that makes changing the setting easier. To open the GUI, type
x11vnc -gui connect
It takes effect immediately for the running sessions. Common options include "-share" (whether multiple viewers are allowed for the same session), "-norepeat" (no repeating of a key when pressed for an extended time) and etc.
Subscribe to:
Posts (Atom)