Archive for the 'Coding' Category

Disabling Chrome Autofill

I ran into a weird error where chrome was populating forms within an application with the stored username/password. For instance, in an Add New User form, the stored username showed in in the zipcode field.

Turns out that Chrome now ignores the autocomplete=”off” attribute. Chrome also looks for the first textbox of type “password” and fills the textbox directly above with the username, assuming it must be a login page.

The fix is ugly, but seems to work ok in .Net MVC. You have to fake out Chrome by adding two hidden fields, one of which is type=”password”, like so:


<input style="display:none" type="text" name="fakeusernameremembered" />

<input style="display:none" type="password" name="fakepasswordremembered" />

Here is a detailed thread at SO.

Hyper-V configuration

After installing an External Network switch on Hyper-V for Win 8 64bit, the virtual switch did not display any connectivity in the Network Connections tab in Control Panel.

For some reason, you need to disable, then enable the virtual switch, in order for the changes to take place.

I also ran into a weird issue getting a Cisco VPN client to work through the virtual switch – need to configure the vpn client to “Allow Local LAN access” under the Transport tab

How to disable the Windows 8 lock screen

Hit the Start key, type gpedit.msc, and press Enter. This will open the Local Group Policy Editor.

Navigate to Computer Configuration > Administrative Templates > Control Panel > Personalization

Double click “Do not display the lock screen,” and select Enabled from the dialog that pops up. Click OK.

more details

Shutdown remote Windows 8 box

Alt + F4 from Desktop

Shortcut to create properties in Visual Studio

Type “prop” and then press tab twice:

public int MyProperty { get; set; }

“propfull”, then tab twice, will generate the field and the full property.

private int myVar;

public int MyProperty
{
get { return myVar;}
set { myVar = value;}
}

SSMS crashing

SSMS was crashing for no apparent reason. Tried re-installing, but that did not resolve the issue.

Ended up re-naming the existing windows.prf file which seems to have fixed the issue.

C:\Documents and Settings\\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\windows.prf

More Detail

Suse linux – Resolving Error 2002: Can’t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock’

After the installation of MySQL, it is only installed but it is not running. To make it run, the so called daemon for MySQL (mysqld) must be running. mysqld can be started manually by calling

# rcmysql start

with root privileges. You can check whether it is running by using

# rcmysql status

Another option is to start the daemon is during the boot.

Go to YaST -> System -> System Services (Runlevel). Wait a few seconds before YaST has examined all the Runlevels. Then select mysqld and press the enable button.

SUSE wiki

404 for Put/Delete verbs in RESTful service in IIS 7

Need to add Put/Post to Verbs section in ExtensionlessUrlHandler-Integrated-4.0 under Handler Mapping

See this link for screenshots.

How To Get X11 Working On An EC2 AMI

I had installed Xming and PuTTy, but couldn’t get an x window to load in EC2. This fixed it:

$ sudo yum install xauth xeyes
$ xeyes

echo $DISPLAY should return localhost:10.0 on the AMI

Should be set to localhost:0 in PuTTy Connection/SSH/X11/X Display location

root SSH access on Amazon Linux AMI instance

sudo su

Enable ping through Win 2008 firewall

netsh firewall set icmpsetting 8 disable

Sql Server email notifications

I always seem to forget these steps when setting up the Database Mail config for job notifications.

Database mail is a 3 step process if you want it to be used to send notifications.

First set up database mail.

Second, modify the Sql Server Agent properties. Select “Alert System” and then check “enable email profile”. Select “database mail” and the profile.

Third, restart the Sql Server Agent.

Javascript – window.open for Chrome

To disable scroll bars in Chrome through javascript, you need to add the following style to the Body tag of the opened document:


overflow-x:hidden;overflow-y:hidden;

Disable jScript Intellisense

From the Visual Studio menu select:

Tools -> Options -> Text Editor -> JScript

Then uncheck Auto List Members and Parameter Information.

Also, uncheck options under Miscellaneous – Show Syntax errors

How to add locations to Open File dialog in SSMS

Add subkeys Place0,Place1,etc

Under each subkey add two REG_SZ values

Name = “Shortcut Name”
Path = “Folder location”

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\Open Find\Places\UserDefinedPlaces

Download vsto through clickonce install

I was getting this error while trying to deploy an excel-add-in through clickonce.

URLDownloadToCacheFile failed with HRESULT ‘-2146697210’

Error: An error occurred trying to download ‘http://###/ExcelAddIn.vsto’.

Simple fix – add .vsto –> application/x-ms-vsto to the MIME type in IIS.

Label not displaying ampersand

Kind of a weird one – Ampersands disappear in labels, unless you set the UseMnemonic property to false.

Terminal Server

If you have reached the two connection limit for Terminal Services, you can disconnect one of the sessions by using the console session.

To use the console session, click on Start, Run and enter “mstsc /admin”, then click on OK. This will open the RDP window and you can connect normally from there.

VB vs C#

As a 15+ year VB coder, I found this podcast to be pretty enlightening about the future of VB along with some myth busting.

Does VB have a future

Install IE6 on Vista/Windows 7

If you need to test sites for IE 6 compatibility, it is hard to beat Virtual PC. These images expire after a while, but MS has been posting updates.

IE 6 image

Next Page »