Feb 27, 2015

How to prioritize LAN connection over Wifi (Windows)

 

On Windows, want to use LAN speedy connection while still connected to wireless ? It’s easy. Here’s how:

1. Open Control Panel –> Network and Internet –> Network Connections

2. In the menu, choose Advanced –> Advanced Settings

image

3. Use the arrow to move your Local Area Connection to the top. As it’s said: the connections are listed in order which they are accessed by network services.

image

4. Time to test: I tried copy some files over the network while connected to wi-fi. It works, LAN is used and the speed is much better. Tada !!!

image

Feb 22, 2015

Hardware hack - how to make your mouse more quiet

 

Ever feel annoyed by the clicking sound of your mouse, especially at night ? I do. So I just purchase this great Logitech M325 wireless mouse – it has ergonomic build, with contour curve and striped grip that fit nicely on my palm. But the clicking sound is just too much.

OK, my hardware senses are tingling. Let’s find out how to make this mouse more quiet.

Step 1: Open the case

The Logitech wireless mouse M325 is a little bit different from the rest. To open it, you got to remove the battery and the battery label beneath. Then you’ll see a little hidden screw. Remove it

IMG_5708_resize

Step 2: Open the click latch

Once you open up your mouse, look for the click latch. Use a penknife, gentle open the latch.
My tips: put the mouse on a black surface. The little white latch on top is very small and it may fly off.

image

Step 3: Adjust the latch:

Once the latch is opened, you’ll see the latch and the copper switch. Use your knife, put a little pressure to tilt the latch and see if the noise is as quiet as you want. You can use a pen to press on the switch to test.

Before:

image

After:

image

That’s it. Now just reassemble everything and enjoy your quiet mouse. Man I could barely hear myself clicking Smile !

Feb 13, 2015

How to reset applicationhost.config in IIS

 

Sometime your IIS setting may be corrupted. So you want to reset everything to factory settings.

Here are the steps:

1. In PowerShell, run these commands:

· Get-WindowsFeature

· Uninstall-WindowsFeature Web-Server

· Uninstall-WindowsFeature WAS

2. Using Server Manager: reinstall Web Server (IIS)

3. Open IIS Manager, the applicationhost.config file should be autogenerated.

Reference: http://blogs.msdn.com/b/chaun/archive/2010/05/26/iis7-x-a-common-mistake-when-reinstalling-iis-7-x-errors-0x80070490-and-0x80070002.aspx

Feb 5, 2015

IIS unable to start Web Site: HRESULT: 0x80070020 & how to know what is using port 80.

If you hit this error when trying to start your IIS Web:

image

Take a look at your Windows Event Viewer: it can tell more:

image

So in my case, it is :unable to bind to port 80. My suspect is some program is using it. Luckily, TCPView from Sysinternals do a great job in reporting port usage.

image

It turns out Skype is listening on port 80, which prevent IIS from starting up. OK change Skype port and everything is working fine again.

Jan 30, 2015

How to add/remove stored procedure from auto execution in SQL

Using sp_procoption, you can set a stored procedure for auto execution whenever SQL instance start. This is useful if you want to perform a task regularly and need to have it running as a background process.

exec sp_procoption @ProcName = ['stored procedure name'],
@OptionName = 'STARTUP',
@OptionValue = [on|off]

 




A simple and useful usage is to auto-map the network drive, so that SQL database can be restored from backup files in network drive.

CREATE PROCEDURE sp_AutoMapNetwork AS

BEGIN

EXEC cmd_shell 'NET USE {device} [password]'

END