How to set your Domain name in Linux

Resume to set a domain name in Linux concepts: FQDN (Fully Qualified Domain Name) eg: hostname = server1 // FQDN = server1.example.com 1. First add FQDN to your hostname in /etc/hosts file. # cat /etc/hosts 10.120.68.23 server1.example.com server1 confirm the FQDN issue the following command: # hostname -f server1.example.com 2.1. Configure domain name (Red Hat RHEL, Fedora and CentOS) From these path add the parameters needs vi /etc/sysconfig/network DOMAINNAME=<domainname> vi /etc/sysctl....

2020-05-31

How to create a docker-compose.service

Here are the steps I made to set a service into my Fedora server to start/stop my Docker-compose (Wikijs) Why I decided to use a docker-compose into a Linux VM machine? —> for make it more stable, faster,portable, isolated, etc. First I stared using Docker for Windows and it was a little bit unstable and not quite easy to handled, so when I switched to Docker compose into a Fedora VM and in that point it was a huge different(I do not recommend to use Docker in Windows); I use a Vmware hypervisor ( in the office we use it )....

2019-09-08

Closing opened ports on Linux (Fedora 29)

Using the Nmap to list our opened port in our machine, how described the official website: Nmap “..is an utility for network discovery and security auditing..” Regarding CUPS from the official website: “is an open source printing system developed by Apple Inc. for macOS® and other UNIX®-like operating systems. CUPS uses the Internet Printing Protocol (IPP) to support printing to local and network printers.” By default we have the cups service running in the system’s startup we could check out issue the following commands:...

2019-05-05

Create a job using crontab

To automate tasks or create some monitoring job we can use the older and efficient tool the “CronJob”. For our example, I’ve created a simple script to detect the cache memory and clean it if raise to a condition then send a notification by mail. Library used: exim4 (mail server) or ssmtp (mail server). Both uses the same “mail” command. Script: # grab the buff/cache memory mem="$(free -m | grep 'Mem:' | awk '{print $6}')" if (( $mem > 350 )) then echo 'wooo is more than 250M' echo 3 | sudo tee /proc/sys/vm/drop_caches echo 'cache dropped' echo "Memory buff/cache cleaned last value:" $mem | mail -s "cache_memory" target_mail@local....

2019-04-03