Skip to content

MicahElliott/versionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

versionary — concise info on *nix system tools

SYNOPSIS

Sometimes it’s a pain to figure out what version of a tool is available on your system. Versionary removes the pain and gives a quick-glance view of most of the relevant tools on most *NIX systems. It also makes it quick to see what’s missing from your system. Useful in a MOTD.

versionary displays system info for distros based on Arch, Debian, SuSE, and Redhat. It’s similar to system(2), but gives more info. Whereas top, free, uptime, etc give dynamic status indicators, versionary gives a static snapshot of system parameters. It also shows version info for the most common interpreters and services. Some munging of output is done to help commands aspire to semantic versioning.

You may want to use this as a starter recipe for quickly showing the most pertinent info for your systems. The info shown is particularly useful for working with compilers (gcc, glibc, etc), but you may want to tune it for whatever common tools you work with (ruby/python/perl versions, etc). It’s also handy for generating consistent bug reports.

Info/tools worth tracking include: runtimes, interpreters/compilers, system services, databases, VCSs.

Might also be nice to indicate what services are running (systemctl). (not likely)

I’m trying to keep the running time of the script to under one second; so far, so good (but barely).

SYNTAX

Just run it! There are no options. You’ll get some parsable output as key-values.

% versionary
hostname: ario
distro:   archlinux
release:  rolling
codename: n/a
kernel:   3.4.4-2-ARCH
arch:     x86_64
glibc:    2.15
procs:    Pentium(R) Dual-Core CPU T4200 @ 2.00GHz (x2)
cache:    1024 KB
ram:      7924 MB
swap:     517 MB
bash:     4.2.29(2)-release
zsh:      4.3.17
gcc:      4.7.1
java:     1.7.0_05-icedtea
python:   3.2.3
ruby:     1.9.3p194
perl:     v5.16.0
erlang:   5.9.1
php:      5.4.4
node:     v0.8.0
haskell:  none
mysql:    14.14
postgres: 9.1.4
sqlite:   3.7.13
mongodb:  2.0.6
couchdb:  1.2.0
redis:    2.4.15
apache:   2.2.22
nginx:    1.2.1
git:      1.7.11.1
hg:       2.2.2

And it’s individually useful to avoid trying to remember whether a command uses: -v, -V, -version, --version, version, --help, or something else.

% alias ver=versionary

% ver node  # this functionality NYI, but a nice idea :)
0.8.16

% ver --cson  # NYI
{
  info:
    hostname: 'ario'
    distro: 'arch'
    arch: 'x86_64'
    ...
  versions:
    node: '0.8.16'
    zsh: '5.0.2'
    ...
  settings:
    shell: '/usr/bin/zsh'
    editor: 'vim'
    de: 'i3'
    term: 'rxvt-unicode-256color'
    ...
  managers:
    nvm: true
    chruby: true
    rbenv: false
    virtualenv: false
    ...
  running:
    postgres: true
    mysql: false
    ...
}

OMISSIONS

Some tools are just too slow to get version info from in a generic fashion (without relying on pacman, apt-get, etc). And sometimes they’ll be installed manually (outside the packaging system), anyway. These (and several other) somewhat common packages are excluded from the listing for speed or other concerns: clojure, scala, coffee, lsc, npm, go, dart, riak, neo4j.

HISTORY

Originally deployed in a compiler test lab to be used on 50+ diverse machines.

For Debian* you may have to install something like libpam-modules to get motd going. We had a convention of putting a specific one-line status message into our MOTDs, and this parsed that out, so is likely not too useful unless you adopt a similar convention. Anyway, it’s a nice approach when using many systems.

Much more could be done with the Platform Python library if you want to take the concepts here and apply to more OSes.

SIMILAR

I don’t know of any tool that derives all the system version info, but there are other status/info tools....

There’s a neat ascii-art utility similar in nature.

Also look for archey and alsi.

BUGS

This has been tested recently only in Arch (and barely on Debian).

The code is crap right now, but usable as-is. The forthcoming JSON and single-tool output features should be pretty useful, but require a rewrite. If a few people find the tool useful, I’ll do that.

TODO

See source for specific TODO items.

AUTHOR

Micah Elliott

Project originally hosted as a gist.

COPYRIGHT

WTFPL

About

console util to show concise version info for *nix tools

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages