I note this for me . I need to see a log directory on the account over scp. So one soulution for me was to mount with bind the log directory.
mount --bind /some/where /mnt/readonly
mount -o remount,ro,bind /mnt/readonly
August 29, 2019
Bind mount
August 19, 2019
Docker COPY failed: stat
Today I am trying to use docker and saw this problem
COPY failed: stat /var/lib/docker/tmp/docker-builder749895154/docker-directory/apache/project.conf: no such file or directory
The fix for this problem is to check your .gitignore file , and add a exception for that directory
!docker-directory/
February 12, 2019
Docker Command-line completion
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
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
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
/etc/systemd/system/rc-local.service
You add into it this
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
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