What Ports Need to be Opened for NTPD?
By default, NTPD uses UDP port 123 for NTP servers and 1023 port for NTP clients. These ports need to open to allow incoming NTP traffic.
By default, NTPD uses UDP port 123 for NTP servers and 1023 port for NTP clients. These ports need to open to allow incoming NTP traffic.
The “sudo rm -rf /*” command recursively deletes all files and directories from the root directory. It deletes all the files on the computer permanently.
To output the binary representation of a hex number, execute the “echo -n “
In Bash, the regular expression ‘^[0-9]+$’ matches a string that contains only one or more digits (0-9) and no other characters.
To set the default gateway in Ubuntu, execute the “sudo ip route add default via
Python regex capturing groups enable you to capture specific parts of a string based on a specified pattern such as using (\b\d+) pattern for capturing digits.
This value error occurs due to various reasons such as creating an array with different dimensions, replacing a single array element with an array, etc.
To convert the Pandas series to a DataFrame the “pd.DataFrame()” function and “series.to_frame()” function is used in Python.
To reattach an existing screen session, use the “screen” tool followed by the “-r(reattach)” argument and the “SID” or the “specific session name”.
To update the NodeJS versions in Ubuntu, use the “NVM(Node Version Manager)”, “NPM(Node Package Manager)”, and “Binary Packages”.
gdm3, kdm, and lightdm are display managers of Linux that provide the interface for the login screen and can be installed or uninstalled.
To instant search with the “less” command, use the “less
To install the latest version of Python on CentOS, use the YUM package manager, and source code that is given on the official Python website.
To extract dictionary values as a list, the “list()” function, “list comprehension”, “for loop”, “* operator”, and “map() function” is used in Python.
The error is caused when the user tries to change the hostname, which is not found in the /etc/hosts file, and it is fixed by adding the hostname to that file.
In Ubuntu, the “wheel” group is a special user group that provides administrative access to certain users on a system to perform administrative tasks.
In Linux, the error “cp: omitting directory” represents that the “cp” command expects a file as the source, not a directory.
To check the version of the package with pip, the “pip show
The find -mtime +1 only returns files older than two days because it only returns the files modified in the last two or less than two days.
To export a GPG private and public key, use the “gpg –export-secret-key -a
To add a DNS server via resolv.conf configuration file, add a nameserver directive followed by the IP address of the DNS server.
To capture all the UDP packets using the tcpdump command, execute the “sudo tcpdump -i
To step into, step over, and step out with GDB, use the “step”, “next”, and “finish” commands. These GDB commands quickly identify and fix bugs in the program.
In Ubuntu, the Apache access log files are stored in the “/var/log/apache2” directory. These files contain details of all the requests made to the web server.
To install and run the TFTP server, execute the “sudo apt install tftpd-hpa” command and configure the “tftpd-hpa” configuration file.
To give full permission to a folder and its subfolders, use the “chmod 777
To force a clock update using the NTP server, use the “ntpdate” command and “ntpd” service. They synchronize the time on the system with the time NTP server.
To upgrade Java on Ubuntu, use the “sudo apt install openjdk-19-jdk” command or download the latest version of Java from the Oracle website and install it.
To find out which users are in a group within Linux, utilize the “groups”, “getent”, and “id -Gn” commands and the “/etc/group” file.
To reverse SSH tunneling connection, execute the “ssh -R
The difference between cp -r and cp -a is that cp -a preserves all file attributes, while cp -r only preserves the ownership and permissions of the files.
To start and stop the MySQL server on ubuntu, execute the “sudo systemctl start mysql” and “sudo systemctl stop mysql” commands.
To make ZSH the default shell in Ubuntu, use the “chsh -s $(which zsh)” or “sudo usermod -s /usr/bin/zsh
To run the SSH server on a port other than 22 is possible by changing the port number in the “sshd_config” configuration file
To get the file created/creation time in Linux, use the “stat”, “debugfs”, “ls” commands, and “Properties” options in GUI.
While uninstalling docker, a few configuration files and components must be manually deleted through a series of commands which require execution one by one.
Sharing large videos takes a lot of time, so FFmpeg is used to manipulate videos, change resolutions, and trim so that the size is reduced.
To create a “.pem” file using the SCP, use the “ssh-keygen -f ~/.ssh/id_rsa -e -m pem” command. Then, upload or download a file or directory using SCP.
To move files or directories, the “shutil.move()” function, “os.rename()” method, and “pathlib.path()” function is used in Python.
To install PIL/Pillow, the “pip” package manager is used in Windows, Linux, and MacOS. The “pip install pillow” command is used to install the module.
To check your TensorFlow version in Colab, import the TensorFlow library and print the installed version using the “__version__” attributes.
To uninstall a package in Python using the “pip” package manager, you need to execute the “pip uninstall
To check or compare the strings’ equality, the “is” operator, “==” operator, “‘!=” operator, and “ __eq__()” function is used in Python.
When a user exceeds the assigned disk quota, it causes “Disk Quota Exceeded,” which is fixed by freeing the disk space or getting more quota.
In Bash, the main difference between $@ and $* is that “$@” preserves the individual arguments as separate words, while other preserves them as a single string.
Explore the differences between KDE and Gnome, two popular desktop environments for Linux. Decide which one is right for you.
To forcefully use wget for a proxy server without modifying system files, set “http_proxy” and “https_proxy” variables with server address and port.
The “ps -ef | grep processname” command filters out a process from a list of running processes and displays information in the Linux system.
In Ubuntu, major log files are located in the “/var/log” directory. It includes “sys.log”, “auth.log”, and “kern.log” log files.
Linux offers the “crontab -l” command to get a list of all scheduled cron jobs. It displays jobs on the basis of monthly, weekly, daily, and hourly.
To get a list of all installed PPA repositories, utilize the “apt policy” command, “Software & Updates” utility, and “/etc/apt/sources.list” file.
To install dependencies automatically with the dpkg package manager, users can execute the “sudo apt install -f” command in the terminal.
To unzip the “.tgz” file in the Linux terminal, utilize the “tar”, and “gunzip”, commands. They required the zip file to have the “.tgz” extension.
To generate random strings in Linux, use the “Random Number Generator”, “OpenSSL library”, “UUID generator”, and “mktemp” commands.
To upgrade Docker on Ubuntu, first, uninstall Docker’s old version. Then, download and install the latest Docker package from the official Docker repository.
The “for-in” expression, “list comprehension” and “map()” function is used to perform the “foreach” loop on every element of the given iterator in Python.
The “json.load()” and “json.loads()” functions are used to parse JSON data in Python objects such as dictionaries, lists, etc.
The “strftime()” function is used to represent the DateTime in string format based on the specific standard directives/character codes.
The “df.corr()”, “sn.heatmap()”, and “plt.show()” functions are used to create, represent, and plot correlation matrix in Python.
To convert a list or list of lists to a Numpy array the “numpy.array()” function and the “numpy.asarray()” function is used in Python.
To convert the JSON string to CSV the “pd.read_json()” and “df.to_csv()” functions of the Pandas module are used in Python.
To uninstall MySQL in Ubuntu, remove the “mysql-server”, “mysql-client” and “mysql-common” packages from the operating system.
In Linux, all the “.run” files can be installed by using the “chmod” command and the “Permissions” options to make them executable.
The “chmod +x” command modifies the file permissions and makes it executable. Also, make multiple files executables via the “chmod +x
To change the password on the root user and user account in Linux, execute the “sudo passwd root” and “sudo passwd
To set the date through the command line, utilize the “date”, “hwclock”, “timedatectl” and “ntpdate” commands by specifying the “YYYY-MM-DD hh:mm:ss” format.
The “export PATH=something:$PATH” command changes the “PATH” environment variable of the current system by specifying the path in the “something” variable.
To find all large files in the root filesystem, you can utilize the “find”, “du”, and “ncdu” commands. Also, you can specify the size limit, and sorting order.
To see the full log from systemctl status services, execute the “systemctl status service_name -l” command in the system.
In Bash, the “eval” command evaluates its arguments as a shell script including “commands”, “variables”, “arithmetic expressions”, and “strings”.