HOSTS File Editor

by Dmitry Kirsanov 4. September 2019 10:57

HOSTS file is a text file in your Windows system that contains name resolution pairs to quickly resolve domain and LAN computer names, or ensure that resolution fails and host in question would become unreachable. We use it to speed up access to intranet hosts, block advertisement and telemetry websites, and in software development – to substitute real world hosts with local copies.

I have to edit HOSTS file often and on different computers. Supply IP addresses for local servers, block connection to Facebook, disable adverts in some apps, that kind of stuff. Well edited HOSTS file makes Windows work faster and helps avoiding problems with connectivity.

One problem, though – it’s over 60Kb large in my case, and adding / removing / temporarily disabling records - takes time. Not much, but more than I’d like to spend on that task. Therefore I felt the need for a command line editor – a single-command application, that would allow to perform the full range of operations on that file and make whole editing process a fraction of a second. And here it is. More...

Sending e-mails from the cloud based web application

by DmitryKirsanov 10. June 2016 06:26

 

 

This sounds crazy. But when you move your website to the cloud, you get problems in things you were previously taking for granted. Like sending e-mails. Basically, the problem is that many e-mail servers, usually ones of big providers, have Azure, Amazon and other cloud provider IPs blacklisted. When you attempt to use SMTP service from your virtual machine in Azure – in many cases it fails to deliver. This means, that your Azure machine can not act as mail server and shouldn’t attempt to deliver messages to recipient SMTP server directly.

Why would you use SMTP service at all? Well, mainly for the sake of performance. Your web application, be it ASP.NET, PHP, Ruby or whatever, will benefit from saving the outgoing e-mail message as text file somewhere on local hard drive, instead of trying to deliver it using TCP/IP, even if that’s done in asynchronous method.

More...

A short note about using Windows Updates

by Dmitry Kirsanov 15. August 2013 16:00

The Perils of Playing Russian Roulette With Windows Updates

Let's talk about a high-stakes game that you may be unknowingly playing in your server room. It lurks under the innocuous name "automatic Windows updates", but if you've been in the trenches long enough, you know it better as Russian Roulette.

Windows Updates: A Necessary Evil

Ever second Tuesday of the month, our friends at Microsoft bequeath us a fresh batch of patches for Windows. These patches — necessary to keep our machines secure, efficient and bug-free — often require a restart to take effect. But not all of these 'restarts' are equal. You see, sometimes, during the reboot process, instead of simply restarting, the machine shuts down. And sometimes, it won't even shut down gracefully. It's a gamble, a flip of the coin, a spin of a bullet chamber — it's Russian roulette.

The Danger in The Server Room

Now, this game of chance may seem insignificant, just another quirk of the IT industry. But consider this: in many cases, production servers have the "Install updates automatically" setting turned on. A server going offline without warning? That's the stuff of nightmares for any business. It can lead to unanticipated downtime, loss of productivity and worst of all, loss of revenue. Not to mention the chaos it wreaks on your IT team's peace of mind!

Morale of the Story: Let's Be Safe Out There

So, what's the solution? It's simple: Do not enable automatic installation of updates on production servers or any machines that you can't easily power back up. The minor inconvenience of manually installing important updates far outweigh swiftly falling into the pitfall of unexpected system shut downs.

In the world of IT, unexpected surprises are rarely welcome. Let's keep Russian roulette out of our server rooms and ensure consistent, reliable operation for our businesses. And remember, a mindful approach to updates is the mark of a truly professional system administrator.

What happens when you leave your Windows session unattended for days

by Dmitry Kirsanov 11. August 2013 00:33

IE_VM13

This is a CPU usage graph of a Windows Server 2008 R2 machine, with all latest patches applied, and Internet Explorer 10 left opened for a few days. It had only two pages opened, both are Microsoft’s own support pages with no active content.

Remote session (RDP) was opened for about 5 days, and every hour Internet Explorer process took more and more memory and CPU, until it took most resources from server.

More...

SQL Bits: Working with AlwaysOn Availability Groups in SQL Server 2012

by Dmitry Kirsanov 24. February 2013 14:23

In SQL Server 2012, we have 4 main options for High Availability: Database Mirroring, Failover Clustering, Availability Groups and Log Shipping. All but Availability Groups (AG) are available in SQL Server 2008 as well. Today we’ll review Availability Groups and how to create and use them.

Before we begin, make sure you understand what is Windows Server Failover Cluster (WSFC). I covered it almost a year ago for Windows Server 2008 R2 and SQL Server 2008 R2, and you’ll need WSFC in order for AG to work.

A few points about Availability Groups to make sure they are what you are looking for:

  • Availability Groups are not share-nothing scalability option. They are using shared storage, such as storage area network (SAN), although it’s not a requirement. We’ll speak about share-nothing scalability later.
  • For AlwaysOn Availability Groups, you need SQL Server 2012 Enterprise edition or higher. Business Intelligence edition or Standard won’t do.
  • AG provide failover with up to 5 readable nodes.
  • AG provide you with something like load balancing option, but AG is not NLB. Also, all nodes can work independently, i.e. you can still connect to them to retrieve information. Only the primary node can change information in the database.
  • AG does not require working in the same IP subnet, but it requires Active Directory domain. This means, that you can have geographically remote nodes participating in one AG, but they must be members of the same AD domain.
    In case of multi-subnet cluster, you’ll have to implement the file replication solution on your file servers to synchronize the data.
  • AG is database-level, as opposed to node-level failover cluster. AG serves group of databases, unlike the simple database mirroring, with 4 replicas instead of one.

Overall, the AlwaysOn Availability Groups are conceptually similar to database mirroring, but provide more advanced functionality and security.

More...

Configuring Failover Cluster in Windows Server 2008

by Dmitry Kirsanov 18. April 2012 22:45

About 5 months ago, I made a video about configuring the network load balancing cluster in Windows Server 2008. I am continuing the series about clustering the Windows Server 2008 with the next type of clusters – the failover cluster. Also known as “high availability” cluster.

Although Windows Server 2008 supports 4 types of clusters – Network Load Balancing, Failover, Computational and Grid, the most commonly used are the first two. Also, we’ll talk about the private clouds later, as they are doing similar job, but in Windows Server 2008 the private cloud is the functionality of an application called System Center Virtual Machine Manager 2012, so it’s not the system core feature, such as clustering.

During the series of demos we’ll talk mainly about failover and network load balancing clusters, as the High Performance Computational cluster requires it’s own special edition of Windows Server 2008, called Windows Server 2008 R2 HPC Edition, and chances are – you won’t ever have the requirement to set up such environment.

Windows Server 2008 Cluster Categories

Windows Server 2008 Cluster Categories

As you can see in the following slide, there are two categories of clusters by the way they share resources.

Failover cluster belongs to the second group, which means that it is a group of computers, where only one node (i.e. the machine participating in the cluster) owns the resource. You may have two or more machines working as nodes in your failover cluster, but only one of them will serve clients at any moment of time. Once that machine fails, another node takes ownership of resources (shared drive, for example) and starts serving clients instead of the failed node.

More...

SCCM For Poor - Windows Intune at Glance

by Dmitry Kirsanov 8. February 2012 05:00

imageHow many products of major brands float under your radar, unnoticed and unevaluated? Perhaps Windows Intune is one of them, but if you are Windows system administrator – that’s the one product you should know about, whether you’re using it or not. So this post is about Windows Intune.

More...

Introduction to scripting for Systems Administrators - PowerShell

by Dmitry Kirsanov 19. November 2011 13:28

There was a time, when IT specialists were mainly either systems administrators or developers. There was a time, when being Database Administrator would also mean having perfect knowledge of SQL. New generation of IT specialists don’t remember that time, and that only because technology evolved so greatly, it is considerably harder to possess the whole range of features offered by a monster product such as SQL Server 2008.

But this post is not about databases at all. It’s about how we can manage the growing complexities of enormous range of technologies that we have to use in business. More...

Deploying Windows 7 by Using Windows Deployment Services

by Dmitry Kirsanov 14. November 2011 01:10

In one of the previous topics, I was showing how  to deploy Windows 7 using Automated Installation Kit, or AIK. This time it’s more hardcore, and is about Windows Deployment Services.

Using Windows Deployment Services you can deploy your fine tuned Windows 7 image to hundreds of computers in a matter minutes. It’s not the most hardcore way of doing it, as I will show in SCCM course later, but still mind blowing if you are either haven’t heard about it before.

It’s not a rocket science though, so the whole lab is just 16 minutes. Very short indeed, but it contains even the installation phase.

Enjoy!

Deploying Windows 7 by Using Windows Deployment Services

Network Load Balancing Clusters in Windows 2008 - when one server is not enough

by Dmitry Kirsanov 14. November 2011 00:52

Russians says – “One is not a warrior at the battlefield”, meaning that one is just too small number for a real war. When the time of real battle is coming to your web site, it’s time to become a … farmer. The geeky one.

Web farm, or Network Load Balancing (NLB) cluster is when there are more than one web server behind a single web address. Of course, it’s not only about web – some other stateless resources can be scaled that way as well – DNS server, for example, or SMTP. However, the most popular use of NLB clusters is web, as most requests in the Internet are going through it.

Network load balancing clusters are rather frustrating topic for many systems administrators, as it’s very common for them to know clustering till the time of their exam. MCSEs and MCITPs of all kinds have to know that stuff, but rarely use it. Who might be more interested in clustering – that’s web developers, who’s web applications serve more and more visitors each day and should be infinitely scalable by design.

Developers

But what it takes to build an application, which could be scaled out by simply adding more hardware? If your application is working fine and attracts more customers than it can handle – that’s when you are wondering whether you’re in trouble. The trouble comes when you realize, that the architecture of your project does not support scaling and situation is even worse if your web developer has no clue about how to make it work in the cluster.

For .NET developers, though, the situation is much better than for PHP developers, for example. They can use SQL server to store the state data (and SQL server may reside on failover cluster, which is the second type of windows cluster that we’ll review later), files can be stored at mirrored network area storage (NAS) and that’s it.

Systems Administrators

For administrators, though, the situation is more difficult. First of all, they are the ones who needs to care about installation, maintenance and management of the cluster. They are the ones who migrate old applications to new clustered servers and must ensure they understand why these applications do not work under new conditions. While usually developers have the harder burden, this time it’s not the case, thanks to Visual Studio and .NET.

There is not much we can say about developer’s part of the job, as there is too little and too simple stuff to do, there is pretty much to say and to show to system administrators.

That’s why I had no choice than to prepare my first narrated lab about creating Windows Server 2008 Network Load Balancing cluster. Enjoy!

Implementing Network Load Balancing Clusters in Windows 2008

Perhaps my future labs will become narrated as well, excerpt for the short and simple ones. It takes a bit more work, since I am not preparing the text and have limited time to complete the lab (always do it in one take), but is definitely more fun, as I can tell more than you want / need to know about the subject.