Добавьте следующую конфигурацию в/etc/network/intercaes:
auto eth0:0
iface eth0:0 inet static
address ADDRESS
netmask NETMASK
broadcast BROADCAST
network NETWORK
Время выполнения:
ifconfig eth0:0 ADDRESS/NETMASK
такой как ifconfig eth0:0 8.8.8.8/32
АДРЕС, СЕТЕВАЯ МАСКА, данная поставщика
#!/usr/bin/python
import os
import sys
import subprocess
if len(sys.argv) != 2:
print >> sys.stderr, "error: Wrong number of arguments. One argument expected (the directory name)"
sys.exit(1)
for dirpath, dirnames, filenames in os.walk(sys.argv[1]):
for dirname in dirnames:
subdirpath = os.path.join(dirpath, dirname)
p = subprocess.Popen(["fs", "lsmount", subdirpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# It seems we can distinguish an AFS volume mount point from a normal directory by just
# looking at the return code.
# Maybe we should also look at the stdout and stderr?
# (In other words the variables out and err)
out, err = p.communicate()
if ( p.returncode == 0 ):
dirnames.remove(dirname)
total_size = 0
for filename in filenames:
filepath = os.path.join(dirpath, filename)
statinfo = os.lstat(filepath)
total_size += statinfo.st_size
print "%i %s" % (total_size, dirpath)
Используйте такую команду
olifri@ubuntu:~$ python /tmp/script.py ~ | sort -n