0
Posted on 12:48 AM by Softminer and filed under

To disbale or enable automatic locking screen:

1. Press Win+R and type "Regedit.exe"

2. Go to the path below

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop

3. EDIT "ScreenSaverIsSecure"

0
Posted on 5:35 AM by Softminer and filed under ,


1.First you have to create a profile

C:\Program Files (x86)\Mozilla Firefox\firefox.exe -p

profiles are saved in

C:\Users\administrator\AppData\Roaming\Mozilla\Firefox\Profiles\lrnq8wmb.selenium


2.Add profile to selenium driver

OpenQA.Selenium.Firefox.FirefoxProfile profile = new FirefoxProfile(@"~path");
IWebDriver driver = new OpenQA.Selenium.Firefox.FirefoxDriver(profile);
0
Posted on 6:32 AM by Softminer and filed under ,

IIS logs can be setup from IIS\Website\Logging
and the default path is %SystemDrive%\inetpub\logs\LogFiles

for debugging an ASP.net application performance also from VS 2012 / Analyze / Start Performance Analysis

Process Monitor is also advance monitoring tools form microsoft
http://technet.microsoft.com/en-us/sysinternals/bb896645

Debug Diagnostic Tool can be used for monitoring application pool usage.
http://www.microsoft.com/en-us/download/details.aspx?id=26798

How to user diagnostic tool
+

Every Application pool has its own w3wp.exe which is running on application pool identity.

From Features View of IIS Click on "Worker Processes", the request can be seen for each process of application pool.

0
Posted on 1:56 AM by Softminer and filed under ,

This is PHP file to print date time

<?php
 print date('D, d M Y H:i:s T');
?>
Browser to: http://localhost/date.php ---------------------------------------------------------------------------------- you see that page is cached after 3 calls, if you setup cache rules in web.config CACHING INTRICACIES Even if you enable Output Caching, IIS does not immediately cache a request. It must be requested a few times before IIS considers a request to be "cache worthy". Cache worthiness can be configured via the ServerRuntime section described in this MSDN article. http://msdn.microsoft.com/en-us/library/ms690574 By default, when you create a cache rule a page is cached when it is requested 2 times within a 10 second time period. You can change these default values by first making a change to your applicationHost.config file and then updating your web.config file. Your applicationHost.config file is typically in the c:\Windows\System32\inetsrv\config directory and is most easily opened with Notepad from a command prompt with administrator privileges. In that file, find the following entry (a child of the element):
. Change Deny to Allow and save the file.
<sectionGroup name="system.webServer">
    <section name="serverRuntime" overrideModeDefault="Allow" />
 </sectionGroup>
---------------------------------------------------------------------------------- Then in web.config Refrence <configuration> <system.webServer> <serverRuntime frequentHitThreshold="3" frequentHitTimePeriod="00:00:20" /> <caching> <profiles> <add extension=".php" policy="DontCache" kernelCachePolicy="CacheForTimePeriod" duration="00:05:30" /> </profiles> </caching> </system.webServer> </configuration>
and finally to view the files in cache following command should be run netsh http show cachestate Refrence
0
Posted on 1:26 AM by Softminer and filed under ,

Repetitive post are the post which have same post title

DELETE bad_rows.*
from wp_posts as bad_rows
inner join (
select post_title, MIN(id) as min_id
from wp_posts
group by post_title
having count(*) > 1
) as good_rows on good_rows.post_title = bad_rows.post_title
and good_rows.min_id <> bad_rows.id;
2
Posted on 5:46 AM by Softminer and filed under ,


Task[] tasks = new Task[1000];
 
for (int i = 0i < 1000i++)
{
tasks[i= Task.Factory.StartNew(() =>
{
Console.WriteLine(System.DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff tt"));
});
}
Task.WaitAll(tasks);
0
Posted on 5:42 AM by Softminer and filed under , ,

From Control panel -> Turn windows features on or off its possible to install windows Message Queuing
http://technet.microsoft.com/en-us/library/cc730960.aspx

To Send and recieve message using c# first you have to create a message queue:
http://www.codeproject.com/Articles/5830/Using-MSMQ-from-C

if(MessageQueue.Exists(@".\Private$\MyQueue"))
//creates an instance MessageQueue, which points
//to the already existing MyQueue
mq = new System.Messaging.MessageQueue(@".\Private$\MyQueue");
else
//creates a new private queue called MyQueue
mq = MessageQueue.Create(@".\Private$\MyQueue");


To Send message

System.Messaging.Message mm = new System.Messaging.Message();
mm.Body = txtMsg.Text;
mm.Label = "Msg" + j.ToString();
mq.Send(mm);


and to recieve message

try
{
mes = mq.Receive(new TimeSpan(0, 0, 3));
mes.Formatter = new XmlMessageFormatter(
new String[] {"System.String,mscorlib"});
m = mes.Body.ToString();
}
catch
{
m = "No Message";
}
MsgBox.Items.Add(m.ToString())


to See messages in windows open Computer Management and from Service applications -> Message Queuing