Fix to "The handle is invalid" error when ASP.NET writes to the Eventlogs

12 07 2010

Have you ever come across the error below with one of your ASP.NET web apps that is trying to write to the Eventlogs? If so, read on…

image

By default the ASPNET user cannot access the existing eventlogs categories. To resolve this, you must set the permissions in the Eventlog key in the registry:

  1. Launch RegEdit.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\.
  3. From the menu, select Edit->Permissions.
  4. Click the Add button and write ASPNET (if ASP.NET is running under a different User ID, use that ID instead).
  5. Click OK.
  6. Select the newly added user from the list (ASP.NET Machine User by default).
  7. Click on Full Control in the Allow column. 8. Click OK.

More info here.



How to fix a corrupted Windows 7 profile

14 06 2010
  1. Log on with newly created administrative account.
  2. Delete C:\Users\%username%
  3. Delete C:\Users\TEMP
  4. Delete the registry key matching your SID from: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList
  5. Check the value of ProfileImagePath so the system will your correct profile.
  6. Restart once again and login with your own account.


Change the default programming language in VS.NET

19 05 2010

1. Choose Tools -> Import and Export Settings
2. Select Reset All Settings and click Next
3. Select whether you would like to save the current settings and click Next
4. Select the settings you want to use and click Finish



How to install Subversion on hostmonster.com

19 05 2010

After hours and hours of trying different methods, the steps below are what worked for me.  Many thanks to the geeks out there who wrote up steps like these, these, and these to get it up and running — it was invaluable for me to get it working on my mine.

Okay, the first thing is you’ll first need SSH access enabled on your account (more info here).  Once that’s done, use PuTTY, login into your account, then run the following commands (worked as of May 14, 2010) on a 32-bit server:

### installation ###
mkdir src
cd src

wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.11.tar.bz2

tar -xjvf subversion-1.6.11.tar.bz2
tar -xjvf subversion-deps-1.6.11.tar.bz2
cd subversion-1.6.11

cd apr
./configure –enable-shared –prefix=$HOME
make
make install

cd ../apr-util
./configure –enable-shared –prefix=$HOME –with-expat=builtin –with-apr=$HOME –without-berkeley-db
make
make install

cd ../neon
./configure –enable-shared –prefix=$HOME –with-libs=$HOME –with-ssl
make
make install

cd ../
./configure –prefix=$HOME –without-berkeley-db –with-apr=$HOME –with-apr-util=$HOME –with-neon=$HOME –without-apxs –without-apache
make
make install

### add PATH of SVN to your user/account ###
cd ~
echo “PATH=\$PATH:\$HOME/bin/” >> .bashrc
echo “export PATH” >> .bashrc
source .bashrc

### create folder structure ###
mkdir svn
cd ~/svn
mkdir tmpdir
cd tmpdir
mkdir trunk
mkdir branches
mkdir tags

### create repository ###
svnadmin create /home/username/svn –fs-type fsfs
svn import . file:///home/username/svn –message ‘Initial repository structure’
rm -rf tmpdir

### grab user creation script ###
cd ~
wget www.sharpstep.com/Articles/HostMonster-svn/create_svn_user.sh
chmod a+x create_svn_user.sh

#### create SVN user ###
./create_svn_user username user_public_key

# clean up source
rm -rf src

That’s it!  All you have to do now is setup TortoiseSVN and PuTTY.



Installing Google Chrome for multiple user accounts

16 05 2010

On Windows 7 (and most likely Vista), installing Google Chrome only installs it for the current user. If you’d like all your users to have access to Chrome on a single install, install Google Pack from an administrator’s account.