Tech Junkie Blog - Real World Tutorials, Happy Coding!

Latest Posts

Sunday, May 30, 2021

Every JavaScript object has a toString() and a toLocaleString() method defined with it.  It is a string representation of the object.

For example if we define a date object like the following:

var date = new Date();

and we output the console.log(date.toString()) method without any extra code we would get the current date and time automatically

Saturday, May 29, 2021

The one of thing that Windows 8 forces you to do is to sign in with an e-mail account.  I am not here to debate if it's a good thing or a bad thing.  But I just wanted to say, Microsoft why do you make our lives so complicated.  I just wanted Windows 7 with a touchscreen.  I digress :(   Anyways, if you install SQL Server on Windows 8 there is a little quirk that you have to deal with.  When you search for an account to add to your dba user login, you have to search on the entire username including the stuff after the @ sign.  Once again, I digress :(

Anyways here is how you add a dba to SQL Server 2014 on a Windows 8 machine.

1.  Connect to your instance of SQL Server, then expand the "Logins" node

Friday, May 28, 2021

Thursday, May 27, 2021

Security Enhanced Linux (SELinux) is a set of kernel medications developed by the NSA and later distributed to the public to secure computer systems.  Most people would disable it on install because it's a pain to work with.  But, if configured correctly it could harden your system considerably.

First let's install all the packages that we need for SELinux with the following yum command

yum install policycoreutils policycoreutils-python selinux-policy selinux-policy-targeted libselinux-utils setroubleshoot-server setools setools-console mcstrans

Tuesday, May 25, 2021

The NOT IN operator in SQL means that you are retrieving records in the database that does not match the values in a comma separated list. In other words it retrieves the inverse of the IN statement by itself. Here is an example of how you can use the IN operator in the products table in the Northwind database.

SELECT * 
FROM Products
WHERE SupplierID NOT IN (1,2)

The above example all the products will be retrieved except for products with SupplierID of 1 or 2, here are the results

The IN operator in SQL means that you are retrieving records in the database that matches the values in a comma separated list. Here is an example of how you can use the IN operator in the products table in the Northwind database.

SELECT * 
FROM Products
WHERE SupplierID IN (1,2)

In the above example all the products with the SupplierID of 1 or 2 are retrieved.

Monday, May 24, 2021

 When you are planning and configuring your server farm, one of the most common task will probably be changing your server names to fit your organization's naming convention.  In this post we are going to change one of our Linux hostname with the hostnamectl command.  Here are the steps to change your Linux hostname.

1.  Open a terminal session on the host that you want to change the hostname, then type the command hostnamectl the hostname information will be displayed, as you can see the hostname is currently localhost.localdomain


2.  Let's see we want to change the name of the server to dc.acmebanking.com because this is the server for our company ACME Banking Inc.  and we want this server to be the domain controller hence the letters dc. to label it as the domain controller.  Some people like to be creative and use movie characters or attractions as the server names.  It's a matter of preference, but I like to look at a server name and know exactly what it's for.  But it's really up to you.

3. Now what you want to do is type in the following command, to change the hostname

hostnamectl set-hostname 'dc.acmebanking.com'

4. Type hostnamectl again to verify that the hostname has been changed



Monday, January 20, 2020

Now that we have our virtual network and subnet setup in Azure, the next thing we want to do is create a Windows Server virtual machine.  A virtual machine is a great way to learn Azure because it's a fixed cost.  You can try different things without paying anything extra, also most of the promotional deals that Microsoft gives you should be more than enough to cover your costs for the virtual machine.

The following steps is how you would create a Windows 2016 Server in the Azure Portal:

1. Log into Azure Portal, and mouse over "Virtual Machines", click on "Create"

















Monday, January 13, 2020

In the previous blog post we created a "Resource Group", in this post we are going to create a "Virtual Network" in that resource group so that we have more control over four Azure network settings.  Azure actually creates a virtual network for us automatically, but we want to have more control over our Azure infrastructure.

The following is how you would create a "Virtual Network" in Azure.

1. Search for "Virtual Network" and click on "Virtual Network", mouse over and click on "Create"

































Monday, January 6, 2020


The first thing you want to create after you have an Azure account is to create a "Resource Group"  as "Resource Group" as the name implies is an Azure Resource Group, groups all of your resources in a single group so that it's easily managed.

The following steps is how you would create a "Resource Group" in the Azure Portal.

1. Log into Azure portal, and click on "Resource Group" or "More Services" depending on your UI

























Search This Blog