Thursday, March 18, 2021

git - check branch of detached head

If your git branch is in detached head state and you want to know the branch name of this detached head state, this is a simple solution for you.

cd into your git project directory and run the command. 

git branch --contains HEAD

This way you can find the correct branch of your git project dir.


In above screenshot, head is detached from branch branch-two.

If user wants to know the branch name from where head was detached, above command is the solution.

You can see in the above screenshot that we can find the detached head branch using above command.


Thursday, February 11, 2021

pip install error - sys.stderr.write(f"ERROR: {exc}")

If you are getting the following error while installing a pip package, this solution should work for you.

sys.stderr.write(f"ERROR: {exc}")

Solution :

A) If you are installing a pip package with default python (2.7) and getting above error, run following command


curl https://bootstrap.pypa.io/2.7/get-pip.py --output get-pip.py
python get-pip.py

B) If you are installing a pip package with python3 and you are installing a package using pip3 command, run following command


curl https://bootstrap.pypa.io/3.5/get-pip.py --output get-pip.py
python3 get-pip.py

Change the python version in url, it depends on your system's python version.

C)  If you are installing a pip package in a virtual environment with python3.5,  run following command in your virtual environment


curl https://bootstrap.pypa.io/3.5/get-pip.py --output get-pip.py
python3 get-pip.py
Command python or python3 both should work same in the virtual env.

Monday, January 18, 2021

phpLiteAdmin : No option visible to create / rename / delete database

If you have installed phpLiteAdmin in your Apache but you are unable to see the options to create / rename / delete database. Here is the solution for you.

Solution :

Your php code of  phpLiteAdmin does not have sufficient permission to show these options. You need to change the owner of the folder phpLiteAdmin.

If you have installed phpLiteAdmin in CentOS, your httpd user is apache, change the owner of the folder.

chown -R apache:apache phpLiteAdmin
If you have installed phpLiteAdmin in Ubuntu, your apache user is www-data, change the owner of the folder.
chown -R www-data:www-data phpLiteAdmin

If you have installed phpLiteAdmin in Lampp/Xampp, your apache user is daemon, change the owner of the folder.

chown -R daemon:daemon phpLiteAdmin

Now open again phpLiteAdmin in the browser. You should be able to see all options.

You can also try with 777 permission to the folder phpLiteAdmin but this is not a good practice to give full permissions to a folder of Document Root.