Site owners

  • Davide Madrisan

OpenSource Software

Linux distribution development

autospec suite

Autospec was created for the QiLinux distribution and is now used by the openmamba developers. Autospec is a fully configurable suite of bash scripts for automatically generating specfiles from source tarballs and downloading/upgrading/compiling/testing/uploading the rpm (RedHat Package Manager) packages provided by an rpm-based Linux distribution.


Tags : Utilities/Development
License 
GPL v2+
Operating System
Linux
Implementation 
Bash scripts
Developed by : Davide Madrisan (see the file AUTHORS for contributors)
Last stable version : 1.10.0


Architecture
  • Frontent (/usr/bin)
    • autospec
  • Plugins (/usr/bin)
    • pck-extract Extract a given file or list of files from a srpm archive
    • pck-update - Update a rpm package to a specified version and release
    • spec-create - Create a specfile for the specified source tarball
    • config-getvar - Print the value of a given configuration variable
  • Libraries (/usr/share/autospec/lib)
    • libapse.lib - Autospec Package Search Engine library
    • libcfg.lib - Load the configuration files
    • libmsgmng.lib - Manage debug/warning/error messages
    • librepository.lib - Interact with the distribution repositories
    • libspec.lib - Specfiles parser
  • Tests (/usr/share/autospec/tests)
    • test01_pkgquality
    • test02_pkgsecurity
  • Templates (/usr/share/autospec/templates)
    • gnome
    • kde3, kde4
    • library
    • perl
    • python
    • standard
  • Configuration files
    • /etc/autospec.conf
    • $HOME/.autospec
    • $HOME/.autospec.d/*.conf
  • Translation files (/usr/share/locale/it/LC_MESSAGES/)
    • po files
Roadmap
  • Fully modularization: frontend + libraries + plugins + localization (done)
  • Library code review to speed up execution (done)
  • spec-create: use distro-specific templates when generating specfiles - done
  • tests: add more tests and improve the usability - mostly done
  • Better documentation (in progress...)

Known bugs

    None known.

    Have you found a bug?
    Please post a description and possibly a way to reproduce the bug.
    You can found my mail address in the file AUTHORS. 
    If you're feeling especially nice, you should make a log of the autospec output when running in '--debug' mode or even make a patch to fix the flaw. Sending patches as attachments is preferred, but not required.

    Get it, Try it, Love it...

      Install autospec in openmamba by entering the following command in the terminal prompt:

      smart install autospec 

      Download the source code here or look at the openmamba autospec.source page.
      Browse GIT repository at http://git.openmamba.org/?p=autospec.git;a=summary
      RSS Feed available at http://git.openmamba.org/?p=autospec.git;a=rss

      Get involved

        Have you found a bug?
        Please post a description and a way to reproduce the bug.
        If you're feeling especially nice, you should make a log of the autospec output when running in '--debug' mode or even make a patch to fix the flaw. Sending patches (you can found my mail address in the file AUTHORS) as attachments is preferred, but not required.

        NRPE Plugins

        NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with Windows agent addons like NSClient++, so you can check metrics on remote Windows machines as well.

        You can download all the following plugins (C source files and bash scripts) here

        Note: rewrite in progress - NEW

        Package nagios-plugins-linux-health
        Tags : 
        Utilities/Monitoring
        License GPL v2+
        Operating System : Linux
        Implementation C

        Source code (beta): nagios-plugins-linux-health-0.tar.bz2
        You can compile these plugins by running: make

        This package currently provides the following nrpe plugins:

        • check_filesystem - in progress
        • check_update - done
        Some other plugins are planned:
        • check_passwd
        • check_time
        The plugin check_filesystem replaces check_ifmount and check_readonlyfs.

        check_filesystems - check if the specified filesystems are mounted.
        Copyright (C) 2012 Davide Madrisan <davide.madrisan@gmail.com>
        Usage:
                check_filesystems [options]
        Options:
                -x, --exclude     exclude filesystem(s) or type of filesystem
                -n, --netfs       do not ignore network filesystems
                -o, --rofs        check whether a fs is mounted read-only
                -w, --rwfs        check whether a fs is mounted read-write
                -L, --list        print the list of filesystems
                -V, --version     show version
                -h, --help        show this help
        Example:
                check_filesystems -L
                check_filesystems -n -x /proc -x nfs -w /media/samba

        check_ifmount

        check_ifmount: check if the specified filesystems are mounted

        Tags : Utilities/Monitoring
        License 
        GPL v2+
        Operating System : 
        Linux
        Implementation :
        C

        Usage

        check_ifmount <filesystem1[:ro], filesyste2[:ro],...>

        Examples

        shell $ /usr/lib/nagios/plugins/check_ifmount /mnt/shared:ro,/nosuchfs
        CRITICAL: /mnt/shared is not mounted ro, /nosuchfs unmounted

        Source code

        Download the source file here.
        You can compile this plugin by running: gcc check_ifmount.c -Wall -o check_ifmount

        check_passwd

        check_passwd: check password expiration

        Tags : Utilities/Monitoring
        License 
        GPL v2+
        Operating System : 
        Linux
        Implementation 
        Bash script

        Usage

          check_passwd [--limit <number_of_days>] [--user <username>]

            Examples

            shell $ /usr/lib/nagios/plugins/check_passwd --limit 7
            WARNING - user1(5day) user2(4day)

            shell $ /usr/lib/nagios/plugins/check_passwd --limit 7 --user user1
            WARNING - user1(5day)

            shell $ /usr/lib/nagios/plugins/check_passwd --limit 3
            OK


            This plugin requires the following lines in /etc/sudoers in order to work properly:
            Defaults:nrpe !requiretty
            nrpe ALL=(ALL) NOPASSWD: /usr/bin/chage

            Source code

              Download this shell script here

              check_readonlyfs

              check_readonly: check for readonly filesystems

              Tags : Utilities/Monitoring
              License 
              GPL v2+
              Operating System : 
              Linux
              Implementation 
              C

              Usage

                check_readonlyfs [-x|--exclude=filesystem1,...,filesystemN][,filesystem_type1,...,filesystem_typeN]

                  Examples

                  shell $ /usr/lib/nagios/plugins/check_readonlyfs -x /media/cdrom,/boot,nfs,proc,usbfs
                  CRITICAL: /readonly/fs: read only filesystem(s)

                  Source code

                    Download the source file here.
                    You can compile this plugin by running: gcc check_readonlyfs.c -Wall -o check_readonlyfs

                    check_uptime

                    check_uptime: display the host uptime

                    Tags : Utilities/Monitoring
                    License 
                    GPL v2+
                    Operating System : 
                    Linux
                    Implementation 
                    C

                    Usage

                      check_uptime

                        Examples

                        shell $ / usr/lib/nagios/plugins/check_uptime
                        Uptime: 190 days 3 hours 41 min

                        Source code

                          Download the source file here.
                          You can compile this plugin by running: gcc check_uptime.c -Wall -o check_uptime

                          Security tools

                          wtmpclean

                          wtmpclean is a tool for Unix operating systems (currently tested on Linux and AIX), written in standard C ANSI, which enables users with sufficient privileges dump wtmp databases and patch or delete wtmp records that log a user or that were created at a given date and time. It is available under the GPLv3. This project is registered at freecode.com

                          Tags : Utilities/Security
                          License 
                          GPL v3+
                          Operating System : 
                          Linux
                          Implementation 
                          C
                          Developed by Davide Madrisan
                          Last stable version :
                           0.6.7

                          Usage examples

                          # remove all the entries of the user "root" (preserving ownership and timestamp of the wtmp file)
                          wtmpclean --file /var/log/wtmp.1 root

                          # just remove a single entry for user "root" (on 6 september 2008 at 2.30 pm)...
                          wtmpclean --time 200809061430 root
                          # ...or replace the user "jekyll" with the user "hide"
                          wtmpclean --time 200809061430 jekyll hide

                          # show listing of user "root" in the current wtmp file in raw format
                          wtmpclean --raw root

                          Download the source code here.

                          Roadmap

                          • Better output when run with the --list option (mostly done!)
                          • Better output when run with the --raw option (done)
                          • Support OpenSolaris, FreeBSD and possibily other Unix operating systems
                          Note: Italian readers may read the article "Coprire le tracce" in Linux Magazine - April 2010 (page 45), which discuss a possible usage of such a tool.

                          cisco7crack

                          cisco7crack is a cracking tool for decoding (and encoding) the Cisco "enable 7" passwords.

                          Cisco "enable 7" passwords can be up to twenty-five mixed-case characters. In the "encrypted" representation, the first two bytes of the long string are a random decimal offset between 0 and 15 into a magic block of characters, and the remaining bytes are ascii-hex representations of the password bytes xored against the character-block bytes from the given offset on down, modulus the character-block length. The character block is "dsfd;kfoA,.iyewrkldJKDHSUB".

                          This program can decrypt and crypt passwords coded with such a pesky algorithm.

                          Download the source code here

                          cisco5crack

                          A cracking tool for decoding (and encoding) the Cisco "enable 5" passwords.

                          This tool is an off-line password cracker for the MD5 passwords used in all the Cisco devices running IOS
                          ("type 5" passwords) and in the PIX firewalls ("encrypted password'). The feasibility of an off-line password guessing is something that every network administrator should consider before leaving router or PIX
                          configuration files on TFTP servers or sending them via unencrypted emails.

                          Here some examples of passwords handled by this tool:

                          • enable secret 5 $1$GsYL$MEEYuiuto.ex9Km/hC1sl/
                          • enable secret level 10 5 $1$F1kl$jKXsHDkl9Qlu28b/8t1MU0
                          • passwd WT.PMwgB2ek6zyV3 encrypted
                          • enable password 2KFQnbNIdI.2KYOU encrypted

                          Its primary purpose is to detect weak passwords using:

                          • unbound brute-force attacks (for *very short* passwords only)
                          • brute-force attacks bound by
                            1. fixed length / range of lengths for plaintexts to be used
                            2. user defined alphabet (eventually combined with (1))
                            3. regular expressions
                            4. a given vocabulary (text file with line separated words)

                          While cracking, you can press the enter key for status, or Ctrl+C to abort the session, saving point information to a file (`restore_cc' by default) and restore the session later on. C5C doesn't use any external crypt library. Instead it has its own highly optimized crypt module.

                          C5C is known to compile and run on Intel x86, Sparc Sun Solaris, IA-64 (Itanium 2).

                          Download the latest source code here.

                          Some patches

                          nagios-plugins

                          Nagios is a program that will monitor hosts and services on your network, and to email or page you when a problem arises or is resolved. Nagios runs on a Unix server as a background or daemon process, intermittently running checks on various services that you specify. The actual service checks are performed by separate "plugin" programs which return the status of the checks to Nagios.

                          This patch against nagios-plugins 1.4.15
                          let
                          check_nagios to raise a critical error when more than one session leader nagios processes are detected.

                          Download the patch here

                          Note: If you do not want to redefine PS_COMMAND in check_nagios.c you must configure nagios-plugins with the following options in order the patch to work:

                          --with-ps-command="`which ps` -eo 'stat uid pid ppid vsz rss pcpu etime comm args'" \
                          --with-ps-format='%s %d %d %d %d %d %f %s %s %n' \
                          --with-ps-cols=10 \
                          --enable-extra-opts \
                          --with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,\
                          &procpcpu,procetime,procprog,&pos'

                          OCS Inventory Agent Standalone

                          OCS Inventory is a powerful inventory and package deployment system for Windows and Unix like systems.

                          This patch fixes the runtime error "Failed to load Ocsinventory::Agent, Can't locate loadable object for module Digest::MD5 in @INC ..." when the script tools/standalone.sh is executed.

                          distromatic

                          Distromatic is a tool written in C created by Silvan Calarco for the QiLinux distribution and is now used by the openmamba developers. Distromatic gets from the rpm headers of a set of configurable repositories the informations needed to perform all the tasks necessary for maintaining a Linux distribution. It can be used to manage the package dependencies, to generate the ISO images and snapshots of a Linux distribution and to dynamically generate the HTML pages containing some useful technical informations (see here for a complete example). It can also generate RSS news.

                          Download the source code here 

                          Last code contributions

                          Coloring-book

                          Coloring-book is a simple coloring book program written in Python w/ Pygame.

                          Here are some patches that can be applied to coloring-book version 0.13 to add the italian localization and increase mouse speedup for better program usability:

                          • patch1: take care of the LANG environment variable
                          • patch2: use 'books/default' only when 'books/$LANG' is not installed
                          • patch3: italian localization (translation provided by "KaeZar")
                          • patch4: increase the default mouse speedup

                          LILO-config

                          The lilo-config plugin for kcontrol is a module for configuring the lilo boot loader. It's part of KDE3, as a component of the KDE3 admin module. This patch fixes the kde bugs 57677 and 57679.

                          Bash Scripts

                          getif is a simple network tool that allow you to collect some basic informations from SNMP devices.
                           
                          Samples:
                          getif --routing 192.168.2.254
                          getif --int 1 192.168.2.254

                          linwall is a firewall for single-homed host, featuring restrictive input rule sets and restrictive ICMP rule set. Includes TCP flag validation and SYN rate limiting.

                          netcmpt computes mask, wildcard mask, network and broadcast addresses.
                           
                          Samples:
                          netcmpt 192.168.229.161 255.255.248.0
                          netcmpt 192.168.229.161/21

                          skeleton is a full-featured script for configuring cisco routers working as MPLS CPE, starting by a minimalistic set of input rules.