Skip to content
Julien Moreau edited this page Apr 30, 2014 · 4 revisions

Presentation

Welcome to the PixShellScripts wiki! It is the documentation of PixEye's shell scripts.

I get famous with those scripts when I was at the university (ISTY / UVSQ).

Selection

Here is a list of more interesting scripts with a short description:

  1. clean-old-kernels.sh - useful to clean /boot/ partition, it keeps only 2 Linux kernels
  2. ad2ldap.sh - import an LDIF file exported from an active directory (AD) with a mapping from AD to LDAP.

To be continued.

Example(s)

clean-old-kernels.sh

Example #1 (no kernel to uninstall):

$ clean-old-kernels.sh
Current kernel is.......: vmlinuz-3.11.0-17-generic
/ Installed kernels:
     1	vmlinuz-3.11.0-15-generic
     2	vmlinuz-3.11.0-17-generic
\ -> 2 kernels installed.
Last installed kernel is: vmlinuz-3.11.0-17-generic
There is no kernel to remove.

Example #2 (1 kernel to uninstall):

$ sudo ~/bin/clean-old-kernels.sh
Current kernel is.......: vmlinuz-3.11.0-20-generic
/ Installed kernels:
     1	vmlinuz-3.11.0-18-generic
     2	vmlinuz-3.11.0-19-generic
     3	vmlinuz-3.11.0-20-generic
\ -> 3 kernels installed.
Last installed kernel is: vmlinuz-3.11.0-20-generic
Kernels to remove: 3.11.0-18.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-3.11.0-18* linux-headers-3.11.0-18-generic* linux-image-3.11.0-18-generic*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 278 MB disk space will be freed.
Do you want to continue [Y/n]?
(...)
Clone this wiki locally