How to , and other stuff about linux, photo, php … Another blog just like others on internet

February 12, 2019

Docker Command-line completion

Filed under: Linux — Tags: , — admin @ 1:51 pm

Today installed centos7 and then docker . Wanted to run something but docker TAB didn’t work to autocomplete.

The solution is to install the bash-completion

yum -y install bash-completion

February 5, 2019

How to exclude subfolder from password protection with .htaccess

Filed under: Linux — Tags: , , , , , — admin @ 1:38 pm

So if you want to protect a website with .htaccess and .htpasswd basically you will use

AuthType Basic
AuthName “Password Protected Area”
AuthUserFile /path/.htpasswd
Require valid-user

If you want a subdirectory to be excluded from auth like .well-known , for lets encrypt then a easy way it to create a .htaccess on .well-known directory and place in it

Satisfy any

January 24, 2019

Ubuntu rc-local

Filed under: Linux — Tags: , — admin @ 11:55 am

On a ubuntu 18 I try to reboot a service after it start so I was try to use rc.local but this is no longer there .

So you create this file


You add into it this

Description=/etc/rc.local Compatibility

ExecStart=/etc/rc.local start


Then make the file chmod +x /etc/rc.local

and add

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

exit 0

Final step is to enable the service

systemctl enable rc-local

January 16, 2019

How to deny execution of php on some directory

Filed under: Linux — Tags: , , , — admin @ 1:12 pm
Just add this on your .htaccess in that directory and php will not be executed.
# Kill PHP Execution
<Files ~ "\.ph(?:p[345]?|t|tml)$">
deny from all

January 15, 2019

MySQL database exists on the server, but does not show up in the cPanel

Filed under: Linux — Tags: , , — admin @ 2:22 pm

I have created a database manually on server with user_dbname however won’t show up on cpanel / phpmyadmin .

The solution was to run this

/usr/local/cpanel/bin/dbmaptool cpanelusername --type mysql --dbs 'nameofdatabase' --dbusers 'dbusername'

Older Posts »

Powered by WordPress