I bring you: floep

I've been wanting to get started with python for quite a bit, but to do so I just really needed a useful program to write. Yesterday, I came up with the idea of writing a very simple script allowing me to execute command over ssh on a couple servers in parallel.

I decided to call it 'floep' for unknown reasons. This is pronounced as 'floop'. The code is a bit wonky, but fortunately its just a little under 150 lines. I've made a google code project if you'd like to criticize, judge or mock me. I'm sure this type of app has been done many times before, but nevertheless I'm open to feature requests and what-not.

Example output:

  1. $ floep -q date
  2. Sat Apr 4 16:09:26 EDT 2009
  3. Sat Apr 4 16:09:26 EDT 2009
  4. Sat Apr 4 16:09:26 EDT 2009
  5. Sat Apr 4 16:09:39 EDT 2009
  6. Sat Apr 4 16:09:26 EDT 2009
  7. Sat Apr 4 16:09:26 EDT 2009
  8. Sat Apr 4 16:07:49 EDT 2009
  9. Sat Apr 4 16:08:07 EDT 2009
  10. Sat Apr 4 16:09:27 EDT 2009
  11. Sat Apr 4 16:09:26 EDT 2009
  12. Sat Apr 4 16:09:27 EDT 2009
  13. Sat Apr 4 16:09:27 EDT 2009
  14. Sat Apr 4 16:09:27 EDT 2009
  15. Sat Apr 4 16:09:28 EDT 2009

The '-q' suppresses the hostname, but I can quickly see this way if all the system clocks are in sync (not!).

I don't consider myself a bad programmer, but starting with a new language is always difficult. To get the syntax down is easy, but it's much more difficult to write 'good' code. 'Good' code is well-structured, follows standard coding conventions and also uses the correct libraries (in the correct way).

I've been doing PHP for very long, so as a result you get to a point where you actually know most of the built-in functions. It's good for me to start with something entirely new, because I hope this will also teach me how other people might look at my (possibly unfamiliar and confusing) conventions.

It turns out Stack Overflow is a great tool for getting through this quickly, and I've got some great (and fast!) responses there. For anyone learning a new tool or language, I can highly recommend Stack Overflow


0 Responses to I bring you: floep

  1. There are currently no comments.

Leave a Reply



About

My name is Evert, and I've been writing semi-regularly on this blog since 2006.

I'm currently available for contract work.

more info.

Subscribe

Dropbox

Dropbox is a simple cross-platform online backup and sync application. The first 2GB of space is free, and both you and me get an extra 250MB extra space if you sign up through this link.