Python 加密库之 cryptography、PyCrypto、rsa

cryptography

解决某台服务器上 /boot 空间不足的问题

步骤

  • sudo apt autoremove --purge

    将会删除那些 headers 文件。

    1
    2
    The following packages will be REMOVED:
    linux-headers-4.4.0-92* linux-headers-4.4.0-92-generic*
  • df -h

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Filesystem                   Size  Used Avail Use% Mounted on
    udev 982M 0 982M 0% /dev
    tmpfs 201M 6.2M 194M 4% /run
    /dev/mapper/noname--vg-root 97G 7.2G 84G 8% /
    tmpfs 1001M 108K 1000M 1% /dev/shm
    tmpfs 5.0M 0 5.0M 0% /run/lock
    tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
    /dev/sda1 236M 233M 0 100% /boot
    cgmfs 100K 0 100K 0% /run/cgmanager/fs
    tmpfs 201M 16K 201M 1% /run/user/116
    tmpfs 201M 0 201M 0% /run/user/0

    可以看到,/boot 的可用空间为 0。

  • dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)

    1
    2
    3
    4
    5
    ii  linux-image-3.19.0-25-generic         3.19.0-25.26~14.04.1                       amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
    rc linux-image-3.19.0-80-generic 3.19.0-80.88~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP
    ii linux-image-4.4.0-77-generic 4.4.0-77.98 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
    ii linux-image-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
    ii linux-image-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP

    There will be three status in the listed kernel images:

    1
    2
    3
    rc: means it has already been removed.
    ii: means installed, eligible for removal.
    iU: DON’T REMOVE. It means not installed, but queued for install in apt.
  • dpkg --purge linux-image-extra-3.19.0-25-generic
    dpkg --purge linux-image-3.19.0-25-generic

  • dpkg --purge linux-image-extra-4.4.0-77-generic
    dpkg --purge linux-image-4.4.0-77-generic

  • dpkg --purge linux-image-extra-4.4.0-78-generic
    dpkg --purge linux-image-4.4.0-78-generic

  • dpkg --purge linux-image-extra-4.4.0-79-generic
    dpkg --purge linux-image-4.4.0-79-generic

  • df -h

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Filesystem                   Size  Used Avail Use% Mounted on
    udev 982M 0 982M 0% /dev
    tmpfs 201M 6.2M 194M 4% /run
    /dev/mapper/noname--vg-root 97G 6.5G 85G 8% /
    tmpfs 1001M 108K 1000M 1% /dev/shm
    tmpfs 5.0M 0 5.0M 0% /run/lock
    tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
    /dev/sda1 236M 56M 169M 25% /boot
    cgmfs 100K 0 100K 0% /run/cgmanager/fs
    tmpfs 201M 16K 201M 1% /run/user/116
    tmpfs 201M 0 201M 0% /run/user/0
  • sudo apt autoremove --purge