Setup and Using RAM Disk in daily development

I have quite strong QuadCore computer with 8GB RAM. Normally, my daily working basis uses nearly 6GB RAM. So 2GB more are waste. I often have to write installer script, try/test the setup, installer … which read/write a lot of files (7000 files, WTH)

So idea about RAM disk (from DOS era) come up!

Software to create RAM disk

1. ImDisk. TESTed on Win7
http://www.ltr-data.se/opencode.html/#ImDisk

2. http://www.ocztechnologyforum.com/forum/showthread.php?63273-*-Windows-7-Ultimate-Tweaks-amp-Utilities-*&s=fed9149ad42cb34e6e914b94fa7a3232&p=442160#post442160

3. I use this DataRAM RamDisk

Install it is very simple.


Create/Start new disk in DataRAM
go to Computer Manager, Disk Management, format it and assign drive letter, Fix the drive character to R: for easily reference later.

Settings/DiskSize set to your need
Load and Save/Load Disk Image at Startup, Filename = C:\RAMDISK.img
Load and Save/Save Disk Image on shutdown, Filename = C:\RAMDISK.img
Option/Do not compress image file on NTFS filesystems

Using your ram disk

Redirect Chrome cache dir

Change your Chrome shortcut, change the Target to

C:\Users\ngng\AppData\Local\Google\Chrome\Application\chrome.exe –user-data-dir=”D:\LockeVN\ChromeLockeVNWorkProfile” –disk-cache-dir=”R:\Google\ChromeDev”

Change Win7 temp path

Go to environment of OS, redirect TEMP and TMP folder to ramdisk

.
.
.
.
Advertisements

Disable Attach Security Warning in Visual Studio 2010

 

When debugging/attach to a process in Windows 7 from Visual Studio 2010, VS displays a warning message confirming if you want to attach to the process you just asked VS to attach to.

Of course I don’t click No Attach! because I do want to attach.

 

So, to save one mouse click and disable the warning,

1. go to windows Start/run, regedit

2. Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger

3. and set DisableAttachSecurityWarning to 1

DisableAttachSecurityWarningVisualStudio2010

 

For VS 2008 the path should be

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger

 

4. Restart Visual Studio

 

Thanks to: abjbhat

 

Troubleshoot:

if you cannot alter the key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger, DisableAttachSecurityWarning to 1, then

Delete it

Go to HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Debugger

Create new DWORD, name it DisableAttachSecurityWarning , set value to 1

 

Fatal error and cannot boot after install Windows 7 SP1 RTM

After installing Windows 7 SP1 RTM, your computer probably cannot boot, and it shows

fatal error c0000034 (*) applying update operation 282 (**) of 115544 (***)

(*) (**) (***) can be different in your case.

 

I found a solution from here http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/1c9a7151-b48c-4a98-aae7-a4b82682ea8e/#bcabda57-7338-499f-aee2-d708e76df315

Thanks to thiswoot. His method works without Safe Mode, without backups, without System Restore, without DISM, and without a Windows 7 DVD repair disc.

Step

  • Reboot (or turn off/turn on) your computer
  • Try to go to Command Prompt (the step may be different, but it always exists a button to go to Command Prompt):
  • When your computer’s starting up, choose the option "Launch Startup Repair"
  • When the Startup repair starts, click cancel.
  • Click the link "View advanced options for recovery and support"
  • In the new window click Command Prompt at the bottom.

 

  • (Optional): if your computer using VHD image to load Windows, please mount the VHD file first, then change to that drive
  • type bcdedit, enter, to get the VHD file path, copy it (E.g.: c:\win7.vhd)
  • type diskpart, enter
  • type select vdisk file="c:\win7.vhd" , enter (use the VHD path in previous step)
  • type attach vdisk, enter
  • type list volume, enter. You will see you "real" Windows volume drive ————> (E.g.: I:)
  • exit diskpart

 

  • In Command Prompt type this and press enter: notepad C:\Windows\winsxs\Pending.xml (or whichever drive Windows is installed on. E.g.: if you mount VHD image and list volume, your Windows drive can be I:, replace C: with I: ———-> the command will be notepad I:\Windows\winsxs\Pending.xml). It can be very slow (because that file is very big)
  • Save as Pending.xml to another location (E.g.: save as Pending.OLD.xml), close Notepad.
  • Re-open pending.xml again with command notepad C:\Windows\winsxs\Pending.xml (It can be very slow (because that file is very big))
  • Press CTRL+F and search for the following exactly: 0000000000000000.cdf-ms
  • Delete the following text (yours will be a little different):

<Checkpoint/>
<DeleteFile path="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/>
<MoveFile source="\SystemRoot\WinSxS\Temp\PendingRenames\e56db1db48d4cb0199440000b01de419._0000000000000000.cdf-ms" destination="\SystemRoot\WinSxS\FileMaps\_0000000000000000.cdf-ms"/>

 

  • Save the file (very slow), close notepad
  • Exit command prompt, restart your computer.

 

  • Do a normal startup, Service Pack installation process can be continued or reverted, it depends, but let it be. Your computer can boot to Windows again

Configure XDebug with WAMP and NetBeans IDE 6.8 on Windows 7

This is step – by – step procedure (with sample):

  1. Install WAMP, default location is at c:\wamp
  2. Download latest release of xdebug for PHP version you are using.
    1. I use WampServer 2.0i [07/11/09] and it includes :
      – Apache 2.2.11
      – MySQL 5.1.36
      – PHP 5.3.0 ———> 5.3 is what we need
    2. write a phpinfo() to know what PHP compiled, Find “PHP Extension Build”  ———–>   API20090626,TS, VC6 is what we need
    3. I use Windows 7 64bit, there is nothing 64bit at XDebug (at the moment Apr 2010)  —–> so this is not important
    4. After all, this is what we should download from Xdebug: 5.3 VC6 (32 bit)   ———-> we have php_xdebug-2.0.5-5.3-vc6.dll
  3. Copy php_xdebug-2.0.5-5.3-vc6.dll file into php’s extension directory, it is c:\wamp\php\ext
  4. Now open php.ini (click WAMP tray icon, PHP/php.ini), we need to configure xdebug so that it get recognized by PHP
  5. Add following at the end of your php.ini
  6. [xdebug]
    zend_extension_ts="c:/wamp/php/ext/
    php_xdebug-2.0.5-5.3-vc6.dll"
    xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
    xdebug.profiler_output_name = "cachegrind.out.%p"
    xdebug.profiler_enable = 0
    xdebug.profiler_append=0
    xdebug.extended_info=1
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000
    xdebug.idekey=xdebug
    xdebug.remote_log="c:/wamp/tmp/xdebug/xdebug_remot.log"
    xdebug.show_exception_trace=0
    xdebug.show_local_vars=9
    xdebug.show_mem_delta=0
    xdebug.trace_format=0

  7. Just create   c:\wamp\tmp\xdebug folder.
  8. Finally restart Apache service .
  9. Now you can write PHP code and debug with NetBeans