Marko Budišić – Personal Website

Holding it all!

June 3, 2009 · Leave a Comment

If you ever used the “hold” command in Matlab and were annoyed by having to manage colors manually if you wanted to change colors for your data, there is hope! This link

http://blogs.mathworks.com/loren/2009/06/03/hold-everything/

shows you how you can harness Matlab plot’s color cycling mechanism across “hold”s!

→ Leave a CommentCategories: Online · Programming · Research

Monitoring from afar

April 3, 2009 · Leave a Comment

A test run of remotespy on fly

A test run of remotespy on fly

Let’s just assume that you have some important stuff being done on your server. A computation running, like I do, something getting compiled for a long time, or whatever else you might need. You don’t want to be sitting all the time, sshed in and running tail -f dump.log. So you think to yourself: “If only I could have this file posted to a website so I could just check it here and there from my cellphone”. That’s your wish (believe me — I can read minds). Well, I had the same wish a while back and this little script came out of it.

Of course, I like to at least try to code stuff up, instead of just writing to Santa. However, I usually go and try to generalize a bit. Let’s say that I want to monitor a few files or outputs of various commands at the same time. Moreover, let’s say I want to add these things as I go. Enter “remotespy”.

Remotespy is a script that parses a list of commands to run and compiles their output into a HTML webpage. The page is then saved to a local folder, e.g. public_html. Additionally, it can be scp-ed to a destination of your choice. This is useful if your “workhorse” server doesn’t have a http server setup, but you do have some other place to post your output to.

The syntax is simple:
remotespy COMMANDFILE HTMLFILE".
The spirit of the command file is similar to the one of crontab scripts: every line represents a command that is run. Syntax of every
line is:

TITLE ## COMMAND ## COMMENT

A sample script looks like this:
Hostname ## hostname
OS ## uname -orpi ## OS version
Disk ## df -h ## Free disk space
Top ## top -b -n 1 -i ## Process state
Vmstat ## vmstat ## Memory state

Every command is run as-is and its output captured and formatted into HTML. The HTML code is hardcoded in the script, but, script being a script, it can be easily edited. To make remotespy into a tool satisfying the initial desire of remote monitoring, it can be paired with cron and ssh to periodically run commands from the script and send the files to a (remote) public_html folder which is available to the internets. For the SCP upload to be useful, you should set up a ssh key pair between the source server (one running remotespy) and destination http server. These two articles can help if you don’t know how to do it yet:

The refresh meta tag is also set for the page so you don’t have to refresh the page manually to check if cron ran the command.

Remotespy was written in Python and tested on versions 2.4 – 2.6. I don’t know how far back the compatibility actually extends. I like to use it as it allows me to edit the command script without having to reinsert anything into cron. The HTML output is simple enough to be quickly read from mobile devices so I can check on my simulations state whenever I feel like it. You can find it in my Mercurial repository among other scripts I’ve written:
http://bitbucket.org/mbudisic/cl-goodies/src/tip/remotespy

(The repo name was taken from el-goodies collection for Emacs).

Let me know if you have suggestions for improvements. Future versions should probably migrate from “commands” to “subprocess” Python module. Also, I might make remotespy into a daemon to make it cron-independent, but that’s a low-priority for me. This does the job well. If you would like to extend remotespy, please let me know, I’d love to hear from you.

→ Leave a CommentCategories: Programming
Tagged: , , ,

Chemistry FTW

August 22, 2008 · Leave a Comment

This is just too funny

→ Leave a CommentCategories: Online

Huygens’s Experiment

May 12, 2008 · Leave a Comment

Here is a recreation of an experiment famously performed by Christiaan Huygens in 17th century. Huygens used pendulum clocks instead of metronomes, but he had only two ;)

http://www.youtube.com/watch?v=W1TMZASCR-I

→ Leave a CommentCategories: Professional

Chaotical experiments

February 22, 2008 · Leave a Comment

Curious about what I am dealing with, put into experiments? Here it is:

Nonlinear Dynamics Experiments by Steve Strogatz

The link to a video is at the bottom of the site.

→ Leave a CommentCategories: Professional

Matlab is sometimes just too complicated…

January 18, 2008 · Comments Off

… so MIT people thought of this:

http://www.youtube.com/watch?v=NZNTgglPbUA 

That would make various mechanics courses much easier :) (at least on mid/high-school level) …

Comments OffCategories: Professional · TAShip

Storying it up!

January 15, 2008 · Comments Off

An good article about making science accessible to non-scientists:

Popularize or perish (http://www.universityaffairs.ca/issues/2008/january/_print/opinion.html)

Comments OffCategories: Research

Two papers published

October 5, 2007 · Comments Off

Two papers, coauthored with my student colleague Josip Babić and my former advisor Professor Ivan Petrović have been published. Links to abstracts:

Comments OffCategories: Professional · Research

Math and Science Links

September 25, 2007 · Comments Off

A small and shy link in the link box will take you to the list of websites that I find useful in my line of work… please do suggest anything that you might find useful as well.

Comments OffCategories: Blogroll · Links · Research

Toolbox

August 30, 2007 · Comments Off

I added a list of programs that I’m using in everyday life… feel free to check it out. You can find the link in the sidebar as well.

Toolbox

Comments OffCategories: Professional