Skip to main content

Ralsina.Me — Roberto Alsina's website

Trick question!

Just to see if any­one can fig­ure this out:

How do you in­stall Lin­ux on a box with the fol­low­ing hand­i­cap­s:

  • No eth­er­net (or to­ken ring or ar­c­net, etc)

  • No CD (or DVD)

  • A pcm­­cia flop­py that has no Lin­ux driv­er

  • No oth­­er OS in­­stalled

  • You can't add any hard­ware

  • You can't move the HD to an­oth­er box or open the box at al­l.

  • It must be a re­al dis­­tro, like Red Hat, SuSE or De­bian, not a toy or flop­py dis­­tro.

  • Avail­able hard­ware in the box: key­board, mouse, se­ri­al port, par­al­lel port, mon­i­­tor, a toshi­­ba li­bret­­to flop­py drive (as­­sume it does­n't work with lin­ux, yes, I know there's a "driver", if you can make it work, I want a copy ;-)

  • Use of an­oth­er PC with what­ev­er soft­­ware or hard­ware you want is al­lowed, ex­­cept the soft­­ware must all be Lin­ux (no DOS flop­pies or stuff like that)

  • Any ca­bles you want can be used.

  • Any me­­dia you want can be used for the in­­stal­l.

I will give the an­swer in a week, hope­ful­ly some­one will an­swer first.

Yes, it can be done. In fac­t, I have al­ready done it, a while ago (see the "S­mall Lin­ux" ar­ti­cle in ths very site)

Nifty python/xmlrpc thing

Us­ing python, it's triv­ial to turn any mod­ule in­to a XML­R­PC serv­er. So, if you are care­ful writ­ing your app in a mod­u­lar way, you can move the back­end else­where in very lit­tle code.

For ex­am­ple, if I had a mod­ule that has some func­tion­al­i­ty, like this (mod­ule.py):

#Stupid simple module

def  add(a,b):
        return a+b

A pro­gram would use it like this:

import module
print module.add(2,4)

Now, if I move the mod­ule to a re­mote box (server), cre­ate this xml­r­pc serv­er pro­gram in the serv­er (and run it ;-):

#!/usr/bin/env python

#Simple generic XML-RPC server

import module

import SimpleXMLRPCServer

server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 800
0))

server.register_instance(module)
server.serve_forever()

And this bridge mod­ule in the client (client­mod­ule.py):

import xmlrpclib

server = xmlrpclib.Server('http://remotserver.com:8000')

Now this very slight­ly mod­i­fied ver­sion of our pro­gram works in ex­act­ly the same way as the orig­i­nal:

from clientmodule import server as module

print module.add(2,4)

Of course this has is­sues:

  • It has no se­cu­ri­ty
  • XML­R­PC could in­tro­duce er­rors and the pro­gram does­n't catch them.
  • It could be made even more trans­par­ent with some more python­ing

But any­way, I think it's cute.

Late at night....

...and still lots to do. Well, not re­al­ly late, just 8P­M, but lots and lots and lots to do.

I re­al­ly should start say­ing no to some job­s. Or hire some­one.

As of now, I am teach­ing 3 cours­es, to­tal 21 hours/week, plus con­sult­ing (about 30 hours/week). Call me lazy, but 50h­s/week is just too much.

Sure, I get paid for it, but what do I want mon­ey for if I can't do any­thing I wan­t?

Of course what I want is to play "Driv­er 2"[1] for hours and then code a lit­tle. But hey, to each his own taste.

[1] Yes, I am play­ing Playsta­tion 1 games. I own a PS1. It's nice, it hooks to the TV, so the im­age is big, and the sound is loud. That's about all I ask of the gam­ing ex­pe­ri­ence :-)

Bartleblog now in sf.net

So, the link below will disappear in a minute or two. Right now, you can get it via CVS.