Tech Junkie Blog - Real World Tutorials, Happy Coding!: May 2021

Monday, May 31, 2021

 In this post we are going to to go over how to install and configure the DNS capability in our Linux server.  A DNS server translate IP addresses into hostnames.  When you type in in the backend it actually maps to an IP address on the internet.  Therefore DNS is at the heart of the internet but you don't know that you are using it.

Here are the steps to configuring a DNS server on a Linux server:

Before you do anything get the name of you network adaptor and the IP address for it, my network adapter is enp0s3 and my IP address is  Yours will be different

ifconfig command on terminal session

You also want to know the hostname of the server for the configuration, you can find out what the hostname is by typing hostname

hostname command on a terminal session

Sunday, May 30, 2021

Yum is a update manager used by CentOS and other RPM-based Linux distributions.  It not only updates and install software from the defined repositories, it also takes cares of the dependencies.

One of the most common task that you will do is to keep your server up to date.  With yum it is quite easy because CentOS comes with many official repositories that enabled by default.  That means for the most part running software updates will not break your existing server.

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.

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.

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 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 ''

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

Search This Blog