Configure IP Address Manually on Ubuntu 12x 14x 16x

To configure IP Address Manually (Static) you need to open edit /etc/network/interfaces

nano /etc/network/interfaces

You will find default configuration

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

From above configure file we know that our interface name is eth0 and configured as dhcp

Below is an example of a static IP configuration on a system with only one Ethernet interface (eth0) and 192.168.1.10/24 for the IP address.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4

Add Let’s Encrypt SSL Certificate to Nagios 4.x running on CentOS 7

The easiest way to install Let’s Encrypt client by cloning github repository. To install git on your system you must enable Epel repositories with the following command

yum -y install epel-release

Install git client

yum -y install git

Change directory and go to /usr/src

cd /usr/src/

Clone Let’s Encrypt Client from Github

git clone https://github.com/letsencrypt/letsencrypt 
cd /usr/src/letsencrypt

Run letsencrypt-auto script with your domain name

./letsencrypt-auto --apache -d FullyQualifiedDomainName

This Script will download and install all necessary packages.

Answer following questions.

- Enter email address ( Used for urgent renewal and security notices)
- Please read the Terms of Service and Accept it
- Would you be willing to share your email.....
- Select ssl.conf

IMPORTANT NOTES: – Congratulations! Your certificate and chain have been saved at:   /etc/letsencrypt/live/ YourFullDomainName/fullchain.pem   Your key file has been saved at:   /etc/letsencrypt/live/YourFullDomainName /privkey.pem   Your cert will expire on 2017-11-12. To obtain a new or tweaked   version of this certificate in the future, simply run   letsencrypt-auto again with the “certonly” option. To   non-interactively renew *all* of your certificates, run   “letsencrypt-auto renew” – Your account credentials have been saved in your Certbot   configuration directory at /etc/letsencrypt. You should make a   secure backup of this folder now. This configuration directory will   also contain certificates and private keys obtained by Certbot so   making regular backups of this folder is ideal.

Certificate has been installed successfully.

Let’s Encrypt certificate is only valid for 90 days. To renew automatically add following line to your corn job.

0 1 12 * * /usr/src/letsencrypt/certbot-auto renew

How to find out information about a LXC VPS CPU

Find CPU information

cat /proc/cpuinfo

or

[root@server ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Model name: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz
Stepping: 2
CPU MHz: 2266.000
BogoMIPS: 4533.49
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 12288K
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23

Find out number of Virtual CPU Cores

cat /proc/cpuinfo | grep processor | wc -l

Create Custom CentOS 6x or 7x KVM template for Proxmox VE

Create a KVM with custom HDD, RAM, CPU, etc. using CentOS 6 or 7 minimal
Disable selinux
Edit the /etc/selinux/config

vi /etc/selinux/config

Change SELINUX=enforcing to SELINUX=disabled

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

Turn off Firewall
(CentOS 7x)

systemctl stop firewalld
systemctl disable firewalld
yum -y install net-tools

Turn off Firewall
(CentOS 6x)

service iptables save 
service iptables stop 
chkconfig iptables off

Create a bash shell script seal.sh

vi /usr/src/seal.sh

Paste following script in the seal.sh file

#!/bin/bash 
echo "Seal This Centos 6x and 7x Server"
yum clean all
> /etc/machie-id
rm -f /etc/ssh/ssh_host_rm -rf /root/.ssh/
rm -f /root/anaconda-ks.cfg
rm -f /root/.bash_history
unset HISTFILE
rm -f /var/log/boot.log
rm -f /var/log/cron
rm -f /var/log/dmesg
rm -f /var/log/grubby
rm -f /var/log/lastlog
rm -f /var/log/maillog
rm -f /var/log/messages
rm -f /var/log/secure
rm -f /var/log/spooler
rm -f /var/log/tallylog
rm -f /var/log/wpa_supplicant.log
rm -f /var/log/wtmp
rm -f /var/log/yum.log
rm -f /var/log/audit/audit.log
rm -f /var/log/tuned/tuned.logroot

Go to use /usr/src folder and make script executable

cd /usr/src
chmod +x seal.sh

Run seal.sh script

./seal.sh

Clear History

cat /dev/null > ~/.bash_history && history -c && exit

Generalize (seal) a Linux virtual machine using the sys-unconfig command before making it into a template. This prevents conflicts between virtual machines deployed from the template

sys-unconfig

 

Using Proxmox web interface Stop VM

Next right click on the VM and Convert to Template

Your Custom CentOS Template is ready.

How to create a Linux LXC Container in Proxmox VE

Open Proxmox web.

Select Server View then select your Node then click on Create CT

Step: 1 

Enter hostname and Password

Step: 2 

Select Template Storage and then Select OS from Dropdown List and click on Next

Step: 3

Enter Disk Size

Step: 4

Enter Number of CPU Cores

Step: 5

Enter RAM size in MB

Step: 6

Enter Network Details

Step: 7

Enter Name Servers Details

Step: 8

Click on Finish 

Wait for the task to complete.

You Proxmox Container is ready.

Direct query from a specific DNS server

You can use following command both Windows and Linux

nslookup IP_Address/Domain_name DNS_server

nslookup lg.ca.hostfav.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8

Non-authoritative answer:
Name: lg.ca.hostfav.com
Address: 104.225.209.xx