Skip to main content

Posts

How to increase Session Timeout?

We can set our custom session timeout in our applications by following Methods 1.     In  Web.config  file we can set session timeout like as shown below  < configuration > < system.web >  < sessionState   mode = " InProc "   timeout = " 120 " >  </ sessionState >  </ system.web > </ configuration > Note that if you are using Forms authentication, the Forms timeout setting will log the user out after the set timeout period so you will also have to adjust this attribute: < authentication mode = " Forms "  >  < forms   timeout = " 120 " >  </ authentication > 2.     In  Global.asax  file we can set session timeout in Session_Start  event like this void Session_Start( object sender, EventArgs e) { // Code that runs when a new session is started Session....

Get size of all tables in database

Determining space used for each table in a SQL Server SELECT t.NAME AS TableName,     s.Name AS SchemaName,     p.rows AS RowCounts,     SUM (a.total_pages) * 8 AS TotalSpaceKB,     SUM (a.used_pages) * 8 AS UsedSpaceKB,     ( SUM (a.total_pages) - SUM (a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables t INNER JOIN sys.indexes i ON t. OBJECT_ID = i. object_id INNER JOIN sys.partitions p ON i. object_id = p. OBJECT_ID AND i.index_id = p.index_id INNER JOIN   sys.allocation_units a ON p.partition_id = a.container_id LEFT OUTER JOIN   sys.schemas s ON t. schema_id = s. schema_id WHERE t.NAME NOT LIKE 'dt%' AND t.is_ms_shipped = 0 AND i. OBJECT_ID > 255 GROUP BY t.Name, s.Name, p.Rows ORDER BY t.Name

AWS Multi-Factor Authentication (MFA):

MFA adds extra security by requiring users to enter a unique authentication code from their authentication device when accessing AWS websites or services. For MFA to work, you must assign an MFA device (hardware or virtual) to the IAM user or root account. The MFA device must be unique for each user; a user cannot enter a code from another user's device to authenticate. Virtual MFA device: A virtual MFA device uses a software application that generates six-digit authentication codes that are compatible with the Time-Based One-Time Password (TOTP) standard, as described in RFC 6238. The software application can run on mobile hardware devices, including Smartphone. Most virtual MFA applications allow you to host more than one virtual MFA device, which makes them more convenient than hardware MFA devices. However, you should be aware that because a virtual MFA might be run on a less secure device such as a Smartphone, a virtual MFA might not provide the same level of security as...

Amazon - AWS CloudTrail

1. AWS CloudTrail captures AWS API calls made by or on behalf of an AWS account and delivers log files to an Amazon S3 bucket that you specify. Using CloudTrail's console in the AWS Management Console, the AWS CLI, or the CloudTrail API, you create a trail, which specifies the bucket for log file delivery and storage. By default, your log files are encrypted using Amazon S3 server-side encryption (SSE). 2. You can identify which users and accounts called AWS APIs for services that support CloudTrail, the source IP address the calls were made from, and when the calls occurred. You can integrate CloudTrail into applications using the API, automate trail creation for your organization, check the status of your trails, and control how administrators turn CloudTrail logging on and off. 3. CloudTrail typically delivers log files within 15 minutes of an API call. These log files contain API calls from all of the account's services that support CloudTrail. 4. ...

Move classic EC2 instance into VPC

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . Click Instances in the navigation pane. On the Instances page, right-click your running instance and select Create Image. Fill in a unique image name and an optional description of the image (up to 255 characters), and click Create Image. Go to the AMIs page and view the AMI's status. While the new AMI is being created, its status is pending . It takes a few minutes for the whole process to finish. Once your new AMI's status is available , go to the Snapshots page and view the new snapshot that was created for the new AMI. Any instance you launch from the new AMI uses this snapshot for its root device volume. You could update your Auto Scaling group with the new AMI, however we will do this as part of the AWS CloudFormation step. Important information: We have to wait 30 mins after Lauch, for Password configuration. The password is the same as for the instance from which you created the AM...

What is difference between constants and read-only?

Constant and ReadOnly keyword are used to make a field constant which value cannot be modified. Constant Constant fields or local variables must be assigned a value at the time of declaration and after that they cannot be modified. By default constant are static, hence you cannot define a constant type as static. public const int X = 10; A const field is a compile-time constant. A constant field or local variable can be initialized with a constant expression which must be fully evaluated at compile time. void Calculate(int Z) {   const int X = 10, X1 = 50;   const int Y = X + X1; //no error, since its evaluated a compile time   const int Y1 = X + Z; //gives error, since its evaluated at run time } You can apply const keyword to built-in value types (byte, short, int, long, char, float, double, decimal, bool), enum, a string literal, or a reference type which can be assigned with a value null. const MyClass obj1 = null;//no error, since its ev...