Posts

How to Check Remote Ports are Reachable Using ‘nc’ Command

 How  to determine if ports on a remote host are reachable/open using simple  netcat  (in short  nc ) command. netcat  (or  nc  in short) is a powerful and easy-to-use utility that can be employed for just about anything in Linux in relation to TCP, UDP, or UNIX-domain sockets. # yum install nc [On CentOS/RHEL] # dnf install nc [On Fedora 22+] $ sudo apt-get install netcat [On Debian/Ubuntu] We can use it to: open TCP connections, listen on arbitrary TCP and UDP ports, send UDP packets, do port scanning under both IPv4 and IPv6 and beyond. Using  netcat , you can check if a single or multiple or a range of open ports as follows. The command below will help us see if the port  22  is open on the host  192.168.56.10 : $ nc -zv 192.168.1.15 22 In the command above, the flag: -z  – sets nc to simply scan for listening daemons, without actually sending any data to them. -v  – enables verbose mode. The next command will check if ports  80 ,  22  and  21

Crontab in Linux: EXAMPLES

Image
  Linux Crontab format Crontab of Linux has six fields. The first five fields define the time and date of execution, and the 6’th field is used for command execution. Crontab syntax: [Minute] [hour] [Day_of_the_Month] [Month_of_the_Year] [Day_of_the_Week] [command] Astrics (*):  Use for matching Define range:  Allows you to define a range with the help of hyphen like 1-10 or 30-40 or jan-mar, mon-wed. Define multiple ranges:  Allows you to define various ranges with command separated like apr-jun,oct-dec. How to Add/Modify Crontab User can edit their crontab jobs with the help of following crontab command: $ crontab -u -e The above command will open the personal crontab configuration of your computer system, which can be edited by using your default text editor. There is no need to restart your crontab as it will pick up your changes automatically when you use following command. $ crontab -l To remove your crontab tasks, use the following command. $ crontab -r To add or update job

Best Java Books for Beginners (2022)

  1.  Head First Java   Authors: Kathy Sierra & Bert Bates Head First Java is referred to as the Java programming bible by most readers and is probably the best Java book for beginners. It contains all the essential  Java programming  subjects -  classes ,  threads , objects, collection, and language features. The information is presented in visually rich formats containing puzzles and games, which makes Java very easy to understand. Additionally, it also comprises a number of  interviews  with professional Java programmers who share their secrets to Java so that beginners can learn it faster. If you’re completely new to Java, this is the first book worth investing in. 2.  Java: A Beginner’s Guide Author: Herbert Schildt Another perfect book for beginners is Java: A Beginner’s Guide by Herbert Schildt. It covers all the  fundamentals of Java , followed by tests and puzzles to test your knowledge. You will also find lots of Q&As from professional Java programmers who give insigh