How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

September 19, 2022

Using FTP usernames with @ – symbol in midnight commander, virtual username

Filed under: Linux — Tags: , , , , — admin @ 5:47 pm

Mc, is a file manager for linux. But if you want to use a virtual ftp account you will have a problem

The format is  [username[:password]@]hostname  . However if you have a username with @ into it that is the problem.

The solution is to replace the @ with +

So if you have then you will input

July 14, 2020

redirect to https

Filed under: Linux — Tags: , , , , — admin @ 12:33 pm

I have more versions of redirect

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

Other version is

#non-www. http to www. https
RewriteCond %{ENV:HTTPS} !on
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule (.*)$1 [R=301,L]

#non-www. https to www. https
RewriteCond %{ENV:HTTPS} on
RewriteCond %{HTTP_HOST} ^$
RewriteRule (.*)$1 [R=301,L]

Other version is

RewriteEngine on

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^{REQUEST_URI} [NC,L,R=301,NE]

Another one :

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

June 2, 2020

Change docker root directory by creating a systemd drop-in service file

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

 It is possible to change docker root directory by creating a systemd drop-in service file. This is useful when you want images and containers or docker generated files to be located in another partition or drive.

Create drop-in configuration file

  1. Create the systemd directory:
    sudo mkdir /etc/systemd/system/docker.service.d/
  2. Create the docker.service drop-in file:
    sudo nano /etc/systemd/system/docker.service.d/docker.root.conf
  3. Add the following configuration :
ExecStart=/usr/bin/dockerd -g /your/custom/docker/root -H fd://

April 8, 2020

Vps with openVZ problems

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

If you ever encounter problems on your vps, first please check this

cat /proc/user_beancounters

If you see failcnt >0 then you have some limitation problems.

January 30, 2020

Ubuntu 18 imagemagick convert: not authorized

Filed under: Linux — Tags: , , , — admin @ 7:01 pm

Well on ubuntu 18 try to convert some pdf error

convert: not authorized /pdf/original/70/5770.pdf' @ error/constitute.c/ReadImage/412. convert: no images defined/pdf/processed/70/5770.jpg’ @ error/convert.c/ConvertImageCommand/3258.

The solution is to modify the /etc/ImageMagick-6/policy.xml

At the end this

domain=”coder” rights=”none” pattern=”PDF”

Into this

domain=”coder” rights=”read|write” pattern=”PDF”

Older Posts »

Powered by WordPress