The future of Maximus, the BlitzMax Module Manager

Lately I’ve been thinking of Maximus‘ future. I’ve had a draft blog post with the title ‘Pulling the plug on Maximus’ poking me in the face for at least 6 months now and I’m still not sure if I should be writing it or not. I’ve got a number of reasons to end the project but also to continue it.

Reasons to pull the plug would be that I no longer use BlitzMax and thus it’s wasting precious server resources. I’ve also got little time for maintaining the codebase (it’s stable software, so not much going on there though) and keeping the service running. Furthermore I’ve got no clue on how big the Maximus user base is. I know a couple of BlitzMaxers (though it seems they’ve moved on from BlitzMax) who use Maximus, but that’s about it. As far as I know it could be 5, 10, 100 or 0 users. Aside from the users there has also been little participation from module authors.

There are also reasons to keep the project alive. It’s still one of the coolest things available for BlitzMax. It’s a big central repository with almost all available BlitzMax modules and currently there’s no other solution for easily installing your desired BlitzMax modules and their dependencies. It’s also a stable code base and the way it’s running now doesn’t require much maintenance. I’ve still got plenty of ideas to implement and improve Maximus as well. It can also be a nice playground for trying out new technologies. One such example was adding Vagrant support which is something I now use on a daily basis.

Still, I’m more and more feeling like ending the Maximus project. It no longer scratches an itch of mine since I’m not using BlitzMax anymore and like I’ve said I’ve got no clue if other people actually use it. Sure, from time to time I can find an entry in my log files that shows a module has been downloaded, but that’s about it.

For the time being I’m going to think about what my decision is going to be. Once one has been made I’ll inform you again on my blog. In case of termination I’ll inform ahead of it. Comments and suggestions are more than welcome.

DiggEmailRedditShare

Tmux scripting

I’ve been using tmux for a while no to manage my terminal sessions. One thing I kept on doing was after starting tmux that I would be manually adding windows, splitting them and issuing commands in each pane such as echoing the contents of log files with tail -f.

I had heard about scripting tmux before but never really looked into it yet, until now. Since I solely use the key bindings I had to figure out how to issue these commands without them. Turns out this is pretty easy and it’s documented in the man page.

Here’s an example of a tmux script I just added to Maximus-Web.

#!/bin/bash
SESSION=$USER

tmux -2 new-session -d -s $SESSION

# Setup a window for tailing log files
tmux new-window -t $SESSION:1 -n 'Logs'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "tail -f /vagrant/maximus.log" C-m
tmux select-pane -t 1
tmux send-keys "tail -f /vagrant/maximus-worker.log" C-m
tmux split-window -v
tmux resize-pane -D 20
tmux send-keys "tail -f /vagrant/maximus-mojo.log" C-m
# Setup a CoffeeScript compiler/watchdog pane
tmux select-pane -t 0
tmux split-window -v
tmux resize-pane -D 20
tmux send-keys "coffee -o /vagrant/root/static/js/ -cw /vagrant/root/coffee/" C-m

# Setup a MySQL window
tmux new-window -t $SESSION:2 -n 'MySQL' 'mysql -uroot'

# Set default window
tmux select-window -t $SESSION:1

# Attach to session
tmux -2 attach-session -t $SESSION

You can view the (up to date) origin of this script at GitHub.

So what exactly does this script do?

  1. It creates a new tmux session.
  2. It creates a new window called ‘Logs’ which is split into a grid of 2×2 with the bottom 2 panes being smaller in size (height). In every pane a command is executed. For example in pane 0 the command tail -f /vagrant/maximus.log gets executed.
  3. A second window called ‘MySQL’ is created which runs the mysql -uroot command.
  4. Then we switch back to the first window (actually second, as tmux pane numbers start with 0) which is the window that shows us the contents of these log files.
  5. Finally we attach to the tmux session.

The added benefit of this small script is that from now on all I have to do is run it and my tmux session will be configured for this specific project (Maximus in this case).

I’ve also found some other useful tmux resources as well which are listed below:

DiggEmailRedditShare

Vim essentials: Ack

Ack is a tool for searching your (code)files, much like grep already does, but better. Ack is written in Perl and works on all major platforms, including Windows. To use Ack with Vim there’s this nice plugin called ack.vim. Install it together with App::Ack and you’re set to go.

With a single command (:Ack [options] {pattern} [{directory}]) you can recursively search for files matching {pattern}. The results returned from Ack will be visible in a newly opened pane in which you can navigate and open the file to start working with it. Every result line contains the file path, position of the matched search and the contents of that line.

ackvim

DiggEmailRedditShare

Vim essentials: NERD Commenter

Another great Vim plugin I use is NERD Commenter. Using this plugin makes it easy to comment out lines of code with just a few keystrokes. By pressing <leader>cc or <leader>c<space> you can comment out your selection using a single comment character per line. With <leader>cm you can comment your selection with one set of multipart delimiters, though your programming language has to support those. Repeat the commands to uncomment your code again. These commands work on single lines as well as on multiple lines which you’ve selected in visual mode (e.g. ranges).

In some cases it can happen that NERD Commenter doesn’t know which comment characters to use which causes it to use comment characters your language doesn’t or may not support. So far this only seems to happen when the filetype can’t be determined by Vim. This can be annoying at times, but I can live with it.

All NERD Commenter commands

For completeness I’ve copied the full command set from its README below. Personally I only use the ones I mentioned earlier. Though I think I’ll go and try to memorize the NERDComYankComment function since that particular case can pop up quite a lot when programming.

[count]<leader>cc |NERDComComment|
Comment out the current line or text selected in visual mode.

[count]<leader>cn |NERDComNestedComment|
Same as <leader>cc but forces nesting.

[count]<leader>c |NERDComToggleComment|
Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.

[count]<leader>cm |NERDComMinimalComment|
Comments the given lines using only one set of multipart delimiters.

[count]<leader>ci |NERDComInvertComment|
Toggles the comment state of the selected line(s) individually.

[count]<leader>cs |NERDComSexyComment|
Comments out the selected lines “sexily”

[count]<leader>cy |NERDComYankComment|
Same as <leader>cc except that the commented line(s) are yanked first.

<leader>c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line.

<leader>cA |NERDComAppendComment|
Adds comment delimiters to the end of line and goes into insert mode between them.

|NERDComInsertComment|
Adds comment delimiters at the current cursor position and inserts between. Disabled by default.

<leader>ca |NERDComAltDelim|
Switches to the alternative set of delimiters.

[count]<leader>cl
[count]<leader>cb |NERDComAlignedComment|
Same as |NERDComComment| except that the delimiters are aligned down the left side (<leader>cl) or both sides (<leader>cb).

[count]<leader>cu |NERDComUncommentLine|
Uncomments the selected line(s).

DiggEmailRedditShare

Any interest in a module manager for Monkey?

Having done a module manager for BlitzMax called Maximus I’ve received one question several times: will you also make a module manager for Monkey?

My answer at the time was ‘no’. Simply because I didn’t use Monkey nor was I planning to. To be honest, I’m still not planning on using Monkey myself. But there are lots of people who do use Monkey and with the (my assumption) amount of available modules I think Monkey would benefit from a module manager.

Sure, Monkey has a module page which lists some modules, but that’s just a listing. When in time there are more and more modules being released for Monkey it’ll become more tedious and painful to manage all your (installed) Monkey modules.

So I’d like to know if Monkey users have any interest in a module manager which for users will allow them to easily install and update modules. For module authors it’ll be an easy way to publish a module to a central repository (like Maximus does).

That way everyone can benefit from a central repository hosting these modules.

Why am I asking if there’s any interest in this? I’ve got some ideas and I think it’ll make up for a nice summer project. I’m interested to hear peoples opinions on this which I can use to decide to start it all up.

——————————————————————————————————————————

This is a cross post from a topic I started at the BlitzMax forum. Which has also been copied to the Monkey forum. I decided to put it on here as well.

DiggEmailRedditShare