Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I am planning/designing an app running on Mac that will send commands and make data requests to a linux server. Some of the things I would need to do will be send file manipulation commands, zip files, send commands to a screen, and retrieve the output of a screen. Basically, it will be for administering a Minecraft server.

My question is, is there an endpoint or service in Linux I can use to trigger shell scripts to do this? How can I read a stream from the screen? If none of this exists, what language is best? What protocol? I'm most familiar with HTTP but that might not be ideal here.

share|improve this question
1  
What do you mean by "send commands to a screen"? –  bahamat Aug 7 '12 at 17:28
    
SSH / Xforwading on Linux and PuTTY / Xming on Windows? It gives you shell access on the client and the possibility to display remote X applications. –  jippie Aug 7 '12 at 18:43
    
@bahamat my bad, forgot a tag, I mean the program called screen, I actually have seen how to do this in a minecraft backup script someone wrote, they are able to send minecraft commands to the screen exactly as if they were there typing it with a keyboard, etc. –  ioSamurai Aug 7 '12 at 20:42

2 Answers 2

Minecraft is a Java game if I am not mistaken, so maybe Java will be a suitable tool. But I would recommend Python, especially the python's socket libraries.

Doug Hellmann has an exceptional example at his site (Doug's the man with Python examples)

Python is installed by default with any modern OSX and quickly installable with any Linux distro.

share|improve this answer
    
Ah good call, I've learned a bit of Python on my own and never had a real good project in mind, this sounds like it might be it. –  ioSamurai Aug 7 '12 at 20:47
    
Take a peek at the tool for Python: iPython, will let you test your code interactively. –  Tim Aug 7 '12 at 20:52

Sounds like a fun project. If your more familiar with HTTP protocols, I'd recommend XML-RPC. Most popular languages will have a native XML-RPC binding, so slight-to-no issues developing on OS X & pushing to Linux production box. You'll still need to write an API to handle your exact requirements, but there's enough info & community support for XML-RPC to get started.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.