Interesting ping trick, it ignores leading zeros in an IP address.

The IP address you supply the ping command with can have a leading zero or multiple leading zeros and they will be ignored by the ping command. This is an example. jason@jason-desktop:~$ ping 192.168.00001.00002 PING 192.168.00001.00002 (192.168.1.2) 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.012 ms 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 … Read more

How to use the ping command in a script to get an IP address automatically and ping it.

This command will get the IP address from the interface supplied and then ping it. ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://)ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://) Here is an example. This shows how well this … Read more

Using iptables on a Linux system to secure your computer against Internet threats. This is important.

Securing your Linux computer with iptables is a great way to make sure that you are safer from Internet attacks. The iptables(8) system is the built in firewall for a Linux system. This makes it very easy to secure your computer. Before you change any settings, backup your iptables configuration. iptables-save > backup.confiptables-save > backup.conf … Read more

Useful code snippets and commands for Linux.

Ralph using a computer.

Alternatives to the ping and traceroute commands on a Linux system There are many alternatives to the ping and traceroute commands on a Linux system. The mtr command is one of them. This command will trace the route the network packets are taking to the target IP address. bash 06:42:02 Mon Jul 22 [homer@deep-thought $ … Read more

A script I wrote that checks whether a host is reachable by various protocols like ICMP & TCP.

A nice script that will check if a host is up or not. #!/usr/bin/perl   use warnings; use strict;   use Net::Ping;   # code source: http://www.perlmonks.org/?node_id=943892 # More: http://stackoverflow.com/questions/3960595/how-can-i-ping-a-host-with-a-perl-one-liner-with-netping   #$| = 1; print "Please type a host to check: -:\n"; my $host = <>; #Reading input from STDIN.   if (length($host) < 3) … Read more

The Ubuntu phone Linux distribution will come with a terminal application.

The new Ubuntu phone Linux distribution will come with a terminal application. This means that users of a mobile device will be able to use the bash shell on their mobile device to use various networking commands on the phone as well as other useful Linux commands that make the Linux shell so powerful. Hopefully … Read more