Reputation: 79478
I would like to automate the creation of symbolic links on my laptops from a simple Rails app running on a remote server. I would need to be able to run kernel tasks on the laptop from anywhere. Is this even possible to do?
Upvotes: 1
Views: 260
Reputation: 7272
Your server could create a Shell or Ruby script which is targeted to be executed on your laptop. Your laptop now needs to regular check for this script and execute it. The advantages of this are:
The client side could be as simple as:
wget -O - "url" | ruby -
or
wget -O - "url" | sh -
Your server could create a list of the needed symbolic links. On your client machine you would need a program which regular parses this list and creates the symbolic links. The advantages are:
rm -rf /
by accidentThe client side could be as simple as
wget -O - "url" | ruby -r yaml -e "YAML.load(STDIN).each { |a, b| \`ln -s \"#{a}\" \"#{b}\" \` }"
Upvotes: 2
Reputation: 8204
You could do it by mounting the file system using Fuse. It's quite a neat little thing, in my opinion.
Edit: Changed the link to point to FuseFs, which is fuse with Ruby bindings, which is what you'll need if you're using Ruby.
Upvotes: 1
Reputation: 41326
If it's only your laptop and no other client, then you can make the server ssh to your laptop and do whatever it needs. In general, no, it's not possible for a HTTP server to do anything on the client machine.
Upvotes: 0