fping is a ping like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up.
With fping we can ping multiple hosts at a time. Use following command to ping multiple hosts:
$ fping -f IPsFiles.txt
where in IPsFiles.txt I have multiple hots.
Below are some other examples of fping:
To ping a host/IP:
$ fping 192.168.2.2
192.168.2.2 is alive
$ fping 192.168.2.22
192.168.1.22 is unreachable
To ping range of IP’s:
$ fping -g 192.168.2.0/24
To list only unreachable hosts/IP’s
$ fping -q -u -f IPsFiles.txt
where -q is for Quiet mode and -u is to list only unreachable targets.
To list only reachable hots/IP’s
$ fping -q -a -f IPsFiles.txt
where -a is to list only alive hots.
While trying to install some module I got error saying that “OpenSSL is not properly installed on your system ubuntu”.
I tried to reinstall this module after installing openssl, but no luck.
After debugging and exploring for a while I got to know that installing libssl-dev could resolve this issue, so I installed libssl-dev with following command:
$ sudo apt-get install libssl-dev
Now retried installation and it worked like charm.
To allow only an ip to access a port use following iptables rule
iptables -I INPUT -p tcp -m tcp -s 192.168.2.20 --dport 8080 -j ACCEPT
Above iptables rule will allow only 192.168.2.20 to access port 8080 and reject all other ip addresses.
Similarly we can give any other ip address and port combination.
To run a cron every 30 seconds check following example:
* * * * * /path/to/your/script arg1 arg2
* * * * * (sleep 30; /path/to/your/script arg1 arg2)
In above example both commands will start at 0th second of every minute, but the second command will sleep for 30 seconds and then start.
By default search keyword won’t be highlighted in vim with Ubuntu OS.
To highlight search keyword we need to set hlsearch flag in vimrc.
Open /etc/vim/vimrc with sudo and append following line in it:
After that save & exit from vimrc file. This will enable search keyword highlight across all vim sessions.
If you want to enable highlighting only for current session run following command in vim after opening a file:
To download a url with basic authentication we need to pass username & password.
To acheive this functionality with wget or curl observer following examples:
$ curl -u 'username:password' 'http://www.example.com'
$ wget --user='username' --password='password' 'http://www.example.com'
Wget with cookie:
Login to server & save cookie to a file:
$ wget --save-cookies cookiesFile.txt --post-data 'user=username&password=password' http://www.example.com/login.html
Download a page by using saved cookie file:
$ wget --load-cookies cookiesFile.txt -p http://www.example.com/somecontent.html
To fix apt-get auto complete issue we need to edit /etc/bash.bashrc file.
Open /etc/bash.bashrc file with any text editor, here I am using vim.
$ vim /etc/bash.bashrc
Now search for below lines in /etc/bash.bashrc file:
# enable bash completion in interactive shells
# if ! shopt -oq posix; then
# if [ -f /usr/share/bash-completion/bash_completion ]; then
# . /usr/share/bash-completion/bash_completion
# elif [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
Uncomment external if condition(uncomment all line except first line), after uncomment it look like below:
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
elif [ -f /etc/bash_completion ]; then
Next save and exit /etc/bash.bashrc file and reopen terminal.
I got this issue after installing Ubuntu 14.04 64 bit desktop edition & and resolved it by following above mentioned procedure.
To play H.265/HEVC videos with VLC player in Ubuntu OS we need to install vlc-plugin-libde265 module.
Use following command to install vlc-plugin-libde265
$ apt-get install vlc-plugin-libde265
After install we can ply H.265/HEVC formate videos with VLC player.
To disable ssh warning message we need to add LogLevel to quiet in $HOME/.ssh/config file.
We can also diable warning messages with ssh command as shown below:
$ ssh -o LogLevel=quiet 192.168.1.10
With following example we can also disable Host Key Checking, set known hosts file to null and disable logging:
$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet 192.168.1.20
ssh-keygen command is used to remove offending key entries from .ssh/known_hosts
Syntax to remove offending key of a host:
$ ssh-keygen -R hostName/IP_Address
$ ssh-keygen -R test.example.com
Above example will remove ssh key associated with hostname test.example.com
$ ssh-keygen -R 192.168.1.10
This example will remove ssh key associated with IP Address 192.168.1.10