Пн, 26 февраля, 12:50

lxd and adjusting size of root device

That's normal. With LXD 2.9 and the storage pool changes, LXD stopped generating automatic «root» devices for the containers, instead relying on inheritance from the default profile.

So in LXD < 2.9, every container had a local «root» device which you could then set properties directly on. With those LXD versions, adding a «root» device to your default profile would be entirely ignored as all containers would override it.

In LXD > 2.9, containers don't have any devices by default, they instead rely on inheritance. Meaning that if you want to override it, you have to add a new device to the container with the same name so that it overrides the one coming from the profiles.

«lxc config show NAME» vs "lxc config show --expanded NAME" is pretty useful to see how this all works.

© https://discuss.linuxcontainers.org/u/stgraber

 

Ср, 21 февраля, 15:49

nginx and letsencrypt locations

server {
    listen 80;
    server_name example.com;

    location / {
       return 301 https://$server_name$request_uri;
    }
   
    location /.well-known/acme-challenge/ {
      root /var/www/html;
    }
 }

 

 

Ср, 21 февраля, 14:54

macOs / Linux ssh autocomplete hint

_complete_ssh_hosts ()
{
        COMPREPLY=()
        cur="${COMP_WORDS[COMP_CWORD]}"
        comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
                        cut -f 1 -d ' ' | \
                        sed -e s/,.*//g | \
                        grep -v ^# | \
                        uniq | \
                        grep -v "\[" ;
                cat ~/.ssh/config | \
                        grep "^Host " | \
                        awk '{print $2}'
                `
        COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur))
        return 0
}


complete -F _complete_ssh_hosts ssh