Connect to serial console from Linux command line

The easiest way to connect to a serial console from Linux command line is using the screen command. In my example below, I will show you how to connect to a serial console of a server using the serial to usb cable.

[root@test ~]# screen /dev/ttyUSB0
 Connected to *******

Enjoy 🙂


Delete files starting with hyphen (-)

Today I have gone through something interesting, Just to remove a file in Linux; but the file starts with a hyphen!

[root@test]# rm '-g.txt'
rm: invalid option -- 'g'
Try rm ./-g.txt' to remove the file `-g.txt'.
Try `rm --help' for more information.

Yes error message said it, just use the format

rm -rf ./filename_with_hiphen

Enjoy 🙂

Device eth0 does not seem to be present, delaying initialization.

You might have come across this headline, especially if you working with Oracle Virtual box machines, machines those are cloned from previous setups etc.


To resolve the issue, just remove the file /etc/udev/rules.d/70-persistent-net.rules and reboot the machine. This file contains the MAC address details associated with the machine. If you don’t want to reboot the machine, run the below command :

udevadm trigger --subsystem-match=net

This command will trigger the rules again.

Enjoy 🙂

Install Oracle JDK

Go to the link :

Accept the license agreement and Download the tar.gz file (eg: jdk -8u65-linux-i586.tar.gz)

Extract the file using the command tar -xzvf jdk-8u65-linux-i586.tar.gz

Copy the extracted directory (In my case jdk1.8.0_65) to the required location say /scratch

alternatives –install /usr/bin/java java /scratch/jdk1.8.0_65/bin/java 20000

alternatives –config java

You can see the list of available java versions and select our installed one by typing the number corresponding to that one.

Hack the permissions in Linux

Many of you reached here because of the term ‘Hack’. Sorry to say, I have to disappoint you(or may be not!). Here I am just discussing about how the Linux permissions work and not anything about hacking the system in a way script kiddies think. I am just mentioning few things about how the permissions are actually working and how it can lead to unwanted results if you are not sure what you are doing. I have put some commands below and for a Linux guy, it is enough and you will get an idea what I am talking about :

root@ubuntu:~# mkdir /root/test
root@ubuntu:~# ls -ld /root/test/
drwxr-xr-x 2 root root 4096 Mar 1 15:27 /root/test/
root@ubuntu:~# useradd tom
root@ubuntu:~# cat /etc/passwd|grep tom
root@ubuntu:~# chown -R tom:tom /root/test/
root@ubuntu:~# ls -ld /root/test/
drwxr-xr-x 2 tom tom 4096 Mar 1 15:27 /root/test/
root@ubuntu:~# userdel tom
root@ubuntu:~# ls -ld /root/test/
drwxr-xr-x 2 1001 1001 4096 Mar 1 15:27 /root/test/
root@ubuntu:~# useradd jerry
root@ubuntu:~# cat /etc/passwd|grep jerry
root@ubuntu:~# ls -ld /root/test/
drwxr-xr-x 2 jerry jerry 4096 Mar 1 15:27 /root/test/

See how the user jerry got access to tom’s files. It was caused by the same uid both were having. So if you are dealing with a large number of users, never simply delete the user. Just disable the user or change all the permission of the user to something more suitable before removing the user.

Enjoy 🙂

“This page includes other resources which are not secure.” || “The connection to this website is not fully secure because it contains unencrypted elements(such as images) or the encryption is not strong enough”

“This page includes other resources which are not secure.”

“The connection to this website is not fully secure because it contains unencrypted elements(such as images) or the encryption is not strong enough”

You might have noticed these warnings in your browsers even though you installed your SSL certificates correctly and wondering what is the next step to do. The answer is just replace the http links with https in your websites. Yes, you should find out all the insecure calls(http) to images,videos,css,javascript and replace it with https. It is a hair pulling job to find out these links manually and replace them correctly. But I can definitely help you to find out the http links.

Try the below things.


Just give your website link in this website and check. It will list all the insecure URLs in your website.

In some cases, I have noted that the SSL warning comes only after you login, In that case, you cant use my first suggestion and you can use the chrome console as mentioned below

2. Using Chrome console

Load the site in google chrome -> Press F12 -> Select Console.
You can see the warning in red color that the mixed content should be replaced. Once you replace all those http links with https, your site should load fine.

Hope this helps 🙂