[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Managing Windows from Linux via Ruby

Glen Holcomb

3/4/2008 7:14:00 PM

[Note: parts of this message were removed to make it a legal post.]

Does anyone know of a reliable way to manage resources on Windows machines
from a Linux platform using Ruby? I'm currently using win32api and win32ole
to create directories and set permissions on multiple remote Windows
machines but would like to migrate my application to a Linux platform. I'm
also interacting with AD but that works fine with LDAP.

Anyone have any suggestions on how I could go about this, or is it not worth
my while?

Thanks,
Glen

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

5 Answers

Martin DeMello

3/4/2008 9:23:00 PM

0

On Tue, Mar 4, 2008 at 11:14 AM, Glen Holcomb <damnbigman@gmail.com> wrote:
> Does anyone know of a reliable way to manage resources on Windows machines
> from a Linux platform using Ruby? I'm currently using win32api and win32ole
> to create directories and set permissions on multiple remote Windows
> machines but would like to migrate my application to a Linux platform. I'm
> also interacting with AD but that works fine with LDAP.
>
> Anyone have any suggestions on how I could go about this, or is it not worth
> my while?

One reasonably cheap way is to use win32-service to run a drb server
that calls your other windows libraries across the network from your
linux box. I've used this approach quite successfully, albeit for very
trivial tasks. I used rubyscript2exe and srvany.exe to make the
service, because i was unaware of win32-service at the time; if I had
to do it again I'd probably use the latter.

martin

Glen Holcomb

3/4/2008 9:34:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Tue, Mar 4, 2008 at 2:22 PM, Martin DeMello <martindemello@gmail.com>
wrote:

> On Tue, Mar 4, 2008 at 11:14 AM, Glen Holcomb <damnbigman@gmail.com>
> wrote:
> > Does anyone know of a reliable way to manage resources on Windows
> machines
> > from a Linux platform using Ruby? I'm currently using win32api and
> win32ole
> > to create directories and set permissions on multiple remote Windows
> > machines but would like to migrate my application to a Linux platform.
> I'm
> > also interacting with AD but that works fine with LDAP.
> >
> > Anyone have any suggestions on how I could go about this, or is it not
> worth
> > my while?
>
> One reasonably cheap way is to use win32-service to run a drb server
> that calls your other windows libraries across the network from your
> linux box. I've used this approach quite successfully, albeit for very
> trivial tasks. I used rubyscript2exe and srvany.exe to make the
> service, because i was unaware of win32-service at the time; if I had
> to do it again I'd probably use the latter.
>
> martin
>


Thanks for the idea Martin. It doesn't sound too horrible. I'll look into
it.


--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

Marc Heiler

3/5/2008 9:53:00 AM

0

> I've used this approach quite successfully, albeit for very
> trivial tasks.

Trivial tasks sound great, it makes understanding them easier :)

Do you have a few example scripts for that? Just a few things what
is possible like that, snippets and the like.
(If you dont, dont worry, I dont intend to steal anyone's time).

I am using Linux mostly, but it would be nice if all the scripts on my
Linux box could work on my Windows machine just as well - but with me
staying here, and not even connecting via ssh or similar.
--
Posted via http://www.ruby-....

Rodrigo Bermejo

3/5/2008 8:41:00 PM

0

If you can access the windows boxes through SSH , you can trigger the
execution of any code you may run on the remote machine.
Drb is a more elegant solution.
--
Posted via http://www.ruby-....

Martin DeMello

3/5/2008 9:27:00 PM

0

On Wed, Mar 5, 2008 at 1:53 AM, Marc Heiler <shevegen@linuxmail.org> wrote:
> > I've used this approach quite successfully, albeit for very
> > trivial tasks.
>
> Trivial tasks sound great, it makes understanding them easier :)
>
> Do you have a few example scripts for that? Just a few things what
> is possible like that, snippets and the like.
> (If you dont, dont worry, I dont intend to steal anyone's time).

Sorry, no :( It was a while ago and I don't have a windows box any
more. The basic setup was very simple, though - I wrote a bunch of
code to do stuff, based on the excellent ruby-win32 library, then I
created an object that exposed all the methods thro drb, ran the
script through rubyscript.exe to create an executable, and then ran
anysrv.exe and instsrv.exe from the windows resource kit to install it
as a service. One problem is that sometimes stopping the service left
a stray ruby.exe process lying around, which is why I said I'd do it
using win32-service rather than anyserv if I had to do it again.

martin