Computers, Programming, Technology, Music, Literature

Disable Auto Lock Computer in Windows

leave a comment »

 

I find myself doing this quite often (like a couple of times in a couple of months ;) ) in Windows servers and workstations.

There are a few ways that I know.

Novice User:
If you are on a Windows workstation, you could uncheck the On resume, display logon screen under the Screen Saver Settings as in the screenshot below.

image 

Expert User:
Though that is not the way I like especially on our development servers. Here’s how to do it via the Group Policy Editor (take a few seconds to take effect)

Start –> Run –> gpedit.msc –> Local Computer Policy –> User Configuration –> Administrative Templates –> System –> Ctrl+Alt+Del Options –> Remove Lock Computer –> Enabled

image

Written by gmaran23

April 29, 2013 at 5:43 pm

VB 6.0 Watch window – how to view lengthy string values?

leave a comment »

 

Use the Immediate Window instead.

We are in the beginning or re-writing some VB 6.0 code to the .Net framework. Absolute zero business logic known to anybody but the application itself. All we have to do is to trace the VB code line by line, skim the business logic and validation, the program flow out of it, and then come up with a design for the new .Net equivalent.

We will be sitting with the Microsoft Visual Basic 6.0 IDE’s for some part of the day every day, trying to create a test environment with mock data so we could run the  VB 6 executable’s code to completion. While we are at it, we will be watching for local variables’ values. Watch window proved to be really helpful, coming from a .Net background, however, when there is a string that is larger than the size of the Watch window itself, and when you try to copy the value out of that variable from the watch window, you’d be seriously disappointed. No matter what you try, all your efforts to copy the entire string value from the watch window will be futile! [Fig 1]

Immediate Window struck me suddenly, that’s it! [Fig 2] type in print variableName and your lives would be spared ;)

 

image

[Fig 1]  – VB 6 Watch Window

image

[Fig 2] – VB 6 Immediate Window

 

 

In the new era, Visual Studio, we have so many options. The Locals Window, the Autos Window, the Watch Window (up to 4 numbers), the Immediate Window, the debugger tool tip [Fig 3].

image

[Fig 3] – Visual Studio 2010 Debugger tool tip

Written by gmaran23

April 26, 2013 at 2:41 pm

Add a custom Shutdown menu to Windows 8 Desktop context menu

leave a comment »

 

 [Image courtesy of techrepublic.com]

This Windows 8 only trick adds a custom Shut Down context menu to the windows Desktop context menu. Pretty handy options. The interesting thing about the trick is adding the registry values and tracking down the icons that are displayed in the context menu.

Check out the entire blog by Greg Shultz here – http://www.techrepublic.com/blog/window-on-windows/integrate-a-custom-shutdown-menu-into-the-windows-8-desktop-context-menu/7506?tag=nl.e064&s_cid=e064&ttag=e064

Don’t forget to read about the Icon Viewer at http://www.neuber.com/free/iconview/. Tiny little program that would remind you icons that you might have seen in Windows 95 or the previous or later versions of Windows.

Written by gmaran23

April 8, 2013 at 11:59 am

Posted in Windows

Tagged with ,

re-enable hibernation after disc clean up – Windows Vista

leave a comment »

 

It so happens to be that I get BSOD once in a while. It’s been over two years and I have never reimaged my Vista installation. If I had to it would take a week for me to get things back on track. After the BSOD, the crash dump occupies at least 2 giga bytes of hard drive space and I have to run Disk clean up to clear some room.

Everytime I do a Disk Clean up, that’s it Hibernation gets turned off since the disk clean up deletes the hyberfil.sys file (of course I choose to delete the hibernation data). This is such an annoyance and I end up searched for that one line command to enable hibernation back.

 

powercfg –h on

 

run it on the command prompt.

Source – http://blogs.msdn.com/b/davbosch/archive/2007/04/28/re-enabling-hibernation-in-windows-vista-after-disk-cleanup.aspx

Written by gmaran23

March 28, 2013 at 8:32 pm

Windows 8 God Mode – nice name btw

leave a comment »

 

All of a sudden my Techrepublic subscription had me stare at something for a while. The techrepublic author says ‘difficult’, Scott Hanselman says, they are ‘right there’. They == control panel settings and other administrative activities.

Unlock the God Mode in Windows 8

http://www.techrepublic.com/blog/window-on-windows/quick-tip-invoke-god-mode-to-take-control-of-settings-in-windows-8/7456

http://www.hanselman.com/blog/UnlockingWindows8GodModeAUsefulTrickButAlsoMysteriousNonsense.aspx

Written by gmaran23

March 28, 2013 at 1:36 am

Posted in Windows

Tagged with ,

everybody’s born, is there a difference?

leave a comment »

 

A rather too nihilistic discernment.

 

Everybody’s born, is there a difference?

In a broad generalization,
Some babies are genetically engineered,
Some babies are planned, conceived and born,
Some babies are residues of passionate love making,
Some babies are the cursed artifacts of filthy unprotected sex!

 

-rotandripe

 

you might also find crowd-cattle-and-breed-rate and infant-sorrow-by-william-blake interesting.

Written by gmaran23

March 28, 2013 at 12:59 am

Posted in literature, love, poems, quotes, rage

Tagged with , , ,

She’s your own

leave a comment »

 

Written back in mid June 2012 and performed live on July 2012 at a Social Impact Volunteers’ Day. This one goes to all those poor souls that are in sex trade. Inspired by The Flock, I know who killed me, Taken, Nirvana’s Polly, Seether’s Love her, Bob Seger’s Turn the page, Neil Young’s Keep on rocking in the free world, and here comes rotandripe’s she’s your own. I wish I could direct a music video.

 

 

On dark streets played her nights
Roaming in despair cursing her life

Dancing for loony tunes
Sometimes she earned only fumes

Bearing scars under her clothes
Couldn’t confide insults she loathed


There she goes, lost her soul
When I asked, she said ‘I am sold’

Neither she liked, she got used
Learned to scrape by, her angst reduced

Always broke, she got torn again,
Society never gave her a second chance

Victim of brutality she wept alone,
When you paid she’s your own


There she goes, deprived of her soul
When I asked, she said ‘I am sold’

She did it for money,
    her choice,
Lone and Self company,
    she rejoiced

Had nothing to feed her
    kid dinner,
No one to care her,
    Was she the sinner?


There she goes, cries and howls
Hung herself, Death took its toll

 

rotandripe

Written by gmaran23

March 27, 2013 at 11:43 pm

Posted in literature, poems, rage

Tagged with , , ,

How Forms Authentication implements a secure timeout on the cookie?

leave a comment »

It does not take a genius to alter the timeout on a cookie that is stored on the browser’s memory. Third party browser add-ins and developer tool bars or HTTP interceptors are easiest ways to begin with. ASP.Net’s Forms Authentication and it’s SetAuthCookie method handles the time out in a secure way. By secure way I mean the time out value of the cookie is actually embedded in the value of the cookie itself.

Now we all know that the authenticated user’s name is part of the AuthCookie value, but it is interesting to know that the time out for the session cookie is handled the same way too. And the normal rules of cookie value encryption and MAC verification apply.

Read through the entire blog – http://brockallen.com/2012/06/04/membership-is-not-the-same-as-forms-authentication/

A few important notes below:

Forms Authentication issues a cookie and embeds the username inside the cookie. Upon subsequent requests to the server Forms reads the cookie, validates it, extracts the username and assigns the username to User.Identity.Name (as well as Thread.CurrentPrincipal.Identity.Name).

To implement the cookie-based scheme securely Forms Authentication does several things:

1) Protects the cookie by encrypting and MACing it. This provides protection against people reading the cookie (including the user) and tampering with the value (including the user).

2) Provides a secure timeout on the cookie. Forms does not rely upon the normal cookie timeout — the user could easily change this. Instead Forms embeds the cookie timeout in the encrypted/MAC’d cookie value.

3) Sets the cookie as HTTP-only. This prevents client-side JavaScript from accessing the cookie (Session, to its credit, does this as well).

4) Allows the cookie to be marked as SSL-only. This, unfortunately, is not the default nor required (but I think it should for both… well, at least the default).

Written by gmaran23

March 27, 2013 at 10:22 pm

Enable WCF help page and exception details in FaultException

leave a comment »

 

 

via config file

<configuration>
	<system.serviceModel>
		<services>
			<service name="HWService" behaviorConfiguration="metadataAndDebug">
				<host>
					<baseAddresses>
						<add baseAddress="http://localhost:8080/HWService" />
					</baseAddresses>  
				</host>
				<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
			</service>
		</services>	
		<behaviors>
			<serviceBehaviors>
				<behavior name="metadataAndDebug">
					<serviceMetadata  httpGetEnabled="true" httpGetUrl=""/>
					<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
				</behavior>
			</serviceBehaviors>
		</behaviors>
	</system.serviceModel>
</configuration>

via code

ServiceHost host = new ServiceHost(typeof(HWService));

ServiceDebugBehavior debug = host.Description.Behaviors.Find<ServiceDebugBehavior>();

// if not found,  turn the setting on with a behavior
if (debug == null)
{
    host.Description.Behaviors.Add(
         new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true });
}
else
{  
    // make sure setting is on
    if (!debug.IncludeExceptionDetailInFaults)
    {
        debug.IncludeExceptionDetailInFaults = true;
    }
}

host.Open();

 

via code (with attribute)

 

[ServiceBehaviour(IncludeExceptionDetailInFaults=true)]
public class HWService : IHWService
{
	//code ;) 
}

Written by gmaran23

March 20, 2013 at 9:39 am

Posted in .Net, C#, WCF

Tagged with , ,

Follow

Get every new post delivered to your Inbox.