DNS RFC References

https://tools.ietf.org/html/rfc1123
:RFC standard for naming host names

2.1 Host Names and Numbers

The syntax of a legal Internet host name was specified in RFC-952
[DNS:4]. One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.

Host software MUST handle host names of up to 63 characters and
SHOULD handle host names of up to 255 characters.

Whenever a user inputs the identity of an Internet host, it SHOULD
be possible to enter either (1) a host domain name or (2) an IP
address in dotted-decimal (“#.#.#.#”) form. The host SHOULD check
the string syntactically for a dotted-decimal number before
looking it up in the Domain Name System.

Other references
DOMAIN NAMES – CONCEPTS AND FACILITIES

DOMAIN ADMINISTRATORS OPERATIONS GUIDE

how-to-install-cinnamon-gui-in-centos-7-linux

Install Cinnamon In CentOS

The instructions below assume that you installed Centos minimal without the X windows system. If you already have Gnome running , you can just install the epel repo and then yum install cinnamon.

While there are many different graphical user interfaces available for Linux, in this example we will be using Cinnamon.

First we need to configure the EPEL repository, as this is where we will be installing packages from.

[root@centos7 ~]# yum install epel-release -y && yum update 

Next I needed to install the “Server with GUI” group before proceeding. Note that this will also install GNOME, you’ll be able to change to Cinnamon later though.

[root@centos7 ~]# yum groupinstall "Gnome Desktop" -y

Installing the Cinnamon Desktop is now as simple as installing the “cinnamon” package, which then has many dependencies to install many more packages that are required for a GUI installation.

[root@centos7 ~]# yum install cinnamon -y

Remember to set the systemd graphical target
systemctl set-default graphical.target

More information

Debian Upgrade to 9

Debian Distro upgrade. For this example we are upgrading from jessie to stretch
A)
# apt-get update
# apt-get upgrade
# apt-get dist-upgrade

sed -i 's/jessie/stretch/g' /etc/apt/sources.list

B)
# apt-get update
(if you receive a error similar to E: Release file expired. run apt-get -o Acquire::Check-Valid-Until=false update )
# apt-get upgrade
# apt-get dist-upgrade

C)
some housekeeping after the upgrade. The below commands will remove old packages from the system
# Check dpkg -l | awk '/^rc/ { print $2 }'

Process
# apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')
# apt-get autoremove

How to Generate a Random Number in Python

Check out the code snippet below to see how it works to generate a number between 1 and 100.

import random
for x in range(10):
  print random.randint(1,101)

The code above will print 10 random values of numbers between 1 and 100. The second line, for x in range(10), determines how many values will be printed (when you use range(x), the number that you use in place of x will be the amount of values that you’ll have printed. if you want 20 values, use range(20). use range(5) if you only want 5 values returned, etc.). Then the third line: print random.randint(1,101) will automatically select a random integer between 1 and 100 for you. The process is fairly simple.

 

Source 

IP-tables config

Block an IP
iptables -I INPUT -s 43.229.53.37 -j DROP

After rebooting the server we notice the rules are removed. It’s best to save your configs and restore them after a reboot.
iptables-save > /etc/iptables/rules

iptables-restore < /etc/iptables/rules

flush all rules
iptables -F

flush rules in the input chain
iptables -F INPUT

iptables -L –line-numbers

iptables -D INPUT 3 – delete a line

Computer , server issues and solutions