change vim as default editor

 add the following to your shell configuration (probably `~/.bashrc`):

    export VISUAL=vim
    export EDITOR="$VISUAL"


sudo update-alternatives --config editor


change interface name in Ubuntu

To rename interface eth0 to wan0, edit /etc/udev/rules.d/70-persistent-net.rules file and change

NAME="eth0" to NAME="wan0"


# PCI device 0x11ab:0x4363 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",
KERNEL=="eth*", NAME="wan0"


apt-get update signatures couldn’t be verified NO_PUBKEY

# apt-get update
W: GPG error: wheezy Release: The following signatures were invalid: KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1557241909 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010

# apt-key adv --keyserver --recv-keys 7638D0442B90D010
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.IVpDwvue7y --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg --keyserver --recv-keys 7638D0442B90D010
gpg: requesting key 2B90D010 from hkp server
gpg: key 2B90D010: public key "Debian Archive Automatic Signing Key (8/jessie) <>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

# apt-get update 
Get:1 wheezy Release.gpg [2,373 B]
Hit wheezy Release   
Hit wheezy/main amd64 Packages
Get:2 wheezy/non-free amd64 Packages [641 B]
Hit wheezy/contrib amd64 Packages
Hit wheezy/contrib Translation-en
Hit wheezy/main Translation-en
Hit wheezy/non-free Translation-en
Err wheezy/non-free amd64 Packages
Fetched 3,014 B in 0s (4,389 B/s)                 
Reading package lists... Done

openstack new compute node can’t migrate for

update /etc/hosts resolve

restart nova_compute, nova_libvirt container

error log:

Live migration Error : Failed to connect to remote libvirt URI qemu tcp://compute1-VirtualBox/system: Unable to resolve address service '16509': Name or service not known


Hmm, that was not fixed because it is docker that manages /etc/hosts. It seems to be copying this on container restart indeed. Interesting. I run my deploy with DNS so never experienced this but this surely looks like an issue to be aware of when users report their problems. We might want to think about a possible workaround. Maybe start mounting /etc/hosts ro in all containers so it follows host's - we don't do docker networking so it does not matter that docker cannot add new entries this way.

link :

#!/usr/bin/env python

#!/usr/bin/env python
The first line in this file is the "shebang" line.  When you execute a file 
from the shell, the shell tries to run the file using the command specified 
on the shebang line.  The ! is called the "bang".  The # is not called the
"she", so sometimes the "shebang" line is also called the "hashbang".
The hash character is used because it defines a comment in most scripting
languages, so the shebang line will be ignored by the scripting language
by default.
The shebang line was invented because scripts are not compiled, so they are
not executable files, but people still want to "run" them.  The shebang
line specifies exactly how to run a script.  In other words, this shebang
line says that, when I type in ./, the shell will actuall run 
  /usr/bin/env python
We use 
  #!/usr/bin/env python
instead of 
because we must specify an absolute path to a program, and /usr/bin/env 
is a utility that uses the user's path to run an application (in this
case, python).  Thus, it's more portable.

More on shebang lines, including portability:

If you don't like this basic walk through python, check out

In order to execute a python script without explicitly running python,
you need to add execute permissions to the file.  To do add execute permission
to, use
  chmod u+x

refer from

openstack instance err:”Exeeded maximum number of retries”

0, the error instance log show:


1, check the /var/log/nova/nova-compute.log, the log show:


maybe the device cannot support the kvm or not have the modue

reference from : 



2, install the qemu-kvm


3, restart the nova-compute container 

and relaunch a new instance, it still show the same err:"Exeeded maximum number of retries", but the nova-compute.log show difference, there is no permission access kvm character device


reference from: ""

4, and the change the permission to 666 /dev/kvm


5, relaunch the instance and it works