Xaprb

Stay curious!

Get Maatkit fast from the command line

with 4 comments

I have been using Maatkit in a different way since I joined Percona as a consultant. When I’m working on a system now, it’s a new, unfamiliar system — not one where I have already installed my favorite programs. And that means I want to grab my favorite productivity tools fast.

I intentionally wrote the Maatkit tools so they don’t need to be “installed.” You just run them, that’s all. But I never made them easy to download.

I fixed that. Now, at the command line, you can just run this:

wget http://www.maatkit.org/get/mk-table-sync

Now it’s ready to run. Behind the scenes are some Apache mod_rewrite rules, a Perl script or two, and Subversion. When you do this, you’re getting the latest code from Subversion’s trunk.[1][2] (I like to run on the bleeding edge. Releases are for people who want to install stuff.)

Because there’s some Perl magic behind it, I made it even easier — it does pattern-matching on partial names and Does The Right Thing:

baron@kanga:~$ wget http://www.maatkit.org/get/sync
--21:38:50--  http://www.maatkit.org/get/sync
           => `sync'
Resolving www.maatkit.org... 64.130.10.15
Connecting to www.maatkit.org|64.130.10.15|:80... connected.
HTTP request sent, awaiting response... 302 Moved
Location: http://www.maatkit.org/get/mk-table-sync [following]
--21:38:50--  http://www.maatkit.org/get/mk-table-sync
           => `mk-table-sync'
Connecting to www.maatkit.org|64.130.10.15|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-perl]

    [      <=>                            ] 163,259      136.51K/s             

21:38:51 (136.13 KB/s) - `mk-table-sync' saved [163259]

The redirection is there because otherwise wget will save the file under the name ’sync’ instead of ‘mk-table-sync’.

And if you’ve forgotten which tools exist, you can just click on over to http://www.maatkit.org/get/ and see.

A quick poll: instead of getting the latest trunk, should this give you the code from the last release? I can do that, if you want.

[1] OK, it’s only refreshed every hour. So you’re getting code that’s up to an hour old.

[2] update: now /get/foo gets the latest release, and /trunk/foo gets the latest trunk code.

Written by Xaprb

May 21st, 2008 at 8:57 am

Posted in Maatkit, Perl, SQL, Tools

Tagged with , ,

4 Responses to 'Get Maatkit fast from the command line'

Subscribe to comments with RSS or TrackBack to 'Get Maatkit fast from the command line'.

  1. Latest release

    Jeff Cornejo

    21 May 08 at 11:01 pm

  2. You rock dude. Thanks for making it easier to get these tools.

    Sunny Walia

    21 May 08 at 11:49 pm

  3. Great idea! This will boost the usage of maatkit a lot.

    What about /get/mk… for the latest released version and /get-latest/mk… for svn trunk version?

    Peter Romianowski

    22 May 08 at 2:06 pm

  4. Peter’s idea was good, but I wanted it to be even shorter. So:

    /get/foo now gets the latest release.

    /trunk/foo now gets the latest SVN trunk.

    Xaprb

    22 May 08 at 10:31 pm

Leave a Reply