各种坑之遇险记

how to access share folder in ubuntu virtualbox

sudo adduser [username] vboxsf

enable root and ssh root login

step 1:

   sudo passwd root

step 2:

    sudo passwd -u root 

you want to work on a root console you can also use 

   sudo -i

If you want to disable root account in Ubuntu you need to lock the root account by using the following command 

  sudo passwd -l root

You also need to edit /etc/ssh/sshd_config, and comment out the following line:

PermitRootLogin without-password

Just below it, add the following line:

PermitRootLogin yes

Then restart SSH:

service ssh restart

npm config settings

  1. I run this command:

    npm config set strict-ssl false
  2. Then set npm to run with http, instead of https:

    npm config set registry "http://registry.npmjs.org/"
  3. Then I install packages using this syntax:

    npm --proxy http://username:password@cacheaddress.com.br:80 \
    install packagename
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

docker proxy settings

step1: create a systemd drop-in directory for the docker service

           mkdir /etc/systemd/system/docker.service.d

step2: create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable

           [Service]

           Environment="HTTP_PROXY=http://proxy.example.com:80/"

       Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

step3: Flush changes

           sudo systemctl daemon-reload

       sudo systemctl show docker --property Environment

step4:Restart Docker

           sudo systemctl restart docker

docker change docker image location

step1:

  sudo service docker stop

  or

  systemctl stop docker

step2: check if stop will show nothing

   ps -ef | grep -E 'docker (-d|daemon)\b' | grep -v grep

step3: change your docker file

   docker daemon -g /home/dockeruser/mydocker

How to copy docker images from one host to another without via repository

You will need to save the docker image as a tar file:

docker save -o <save image to path> <image name>

Then copy your image to a new system with regular file transfer tools such as cp or scp. After that you will have to load the image into docker:

docker load -i <path to image tar file>

PS: You may need to sudo all commands.

s

 

posted @ 2016-07-09 15:51  Jeffrey Chan  阅读(117)  评论(0编辑  收藏  举报