Skip to main content

Ralsina.Me — Roberto Alsina's website

An application idea

Yes­ter­day I wrote that I have too many ideas. Ok, here's an­oth­er one:

A word pro­ces­sor for writ­er­s. And when I say writ­er­s, I mean nov­el­ist­s, tech­ni­cal book writ­er­s, script writ­er­s, play­wright­s...

Word is not very good for a writ­er. Open­Office is not good. KWord is prob­a­bly worse (be­cause of the em­pha­sis on page lay­out). LyX is prob­a­bly as good as it get­s, and it's not ex­act­ly per­fec­t.

A writ­er ac­tu­al­ly needs a sim­ple-ish word pro­ces­sor with a bunch of an­cil­lary gad­getry.

For ex­am­ple:

  • Statis­tic­s:

    • How many word­s/chars/­­­pages a day is he writ­ing

    • A live word/char counter

    • A live word fre­quen­­­cy mon­i­­­tor (put the cur­­­sor on a word and see how of­ten it's used)

    • Live counter of doc­u­­­men­t/chap­ter/­sec­­­tion/scene size.

  • Out­­lin­ing

    • Re­al live out­­­lin­ing. The kind where you drag stuff around and the text fol­lows.

    • An ed­itable ful­l-­­­text out­­­­­line view

  • Col­lab­o­ra­­tion

    • Mul­ti­­­ple ed­i­­­tors

    • Ver­­­sion­ing con­trol

  • Projects

    • Mul­ti­­­ple files per project

    • Link­ing files to places on the text in oth­­­er files

  • In­­dex cards

    • As­­­so­­­ci­at­ing in­­­dex cards to places on the text

    • Group­ing in­­­dex cards (for ex­am­­­ple, per char­ac­ter, or per lo­­­ca­­­tion)

    • Plac­ing them on a time­­­line or a sto­ry­board

  • Live The­saurus / Dic­­tio­­nary

    • Show de­f­i­ni­­­tions and al­ter­­­na­­­tives as the point­er cross­es a word.

    • One click re­­­place­­­ment

  • Styling

    • Per frag­­­men­t/­­­para­­­graph styles

    • Us­er de­fined

    • Pre­de­fined styles

There are a bazil­lion things he does not need, though, like de­tailed page lay­out­ing, or gram­mar check­ing.

It would be nice if it could lat­er be eas­i­ly im­port­ed (styled!) in­to some­thing like Scribus so a de­cent page lay­out could be done, but it does­n't need to be in the same app at al­l.

The text en­gines in Qt4 are good enough for all this app needs graph­i­cal­ly.

Re­struc­tured­Text is good enough to pro­vide a back­end, a parser, an ex­porter, a read­er, a trans­former, what­ev­er.

So there it is, an­oth­er idea I will most like­ly not im­ple­men­t. Some­one please run with it, you can prob­a­bly make it a rather ex­pen­sive GPL share­ware on Mac ;-)

Wifi dongle

Bought an Eu­sso (No, I had nev­er heard of them ei­ther) Wifi USB don­gle.


  • It says "lin­ux driver" on the blis­ter

  • It's the cheap­­est 802.11g thing on the lo­­cal ebay-­­like place

  • My an­­cient pcm­­cia 802.11b card suck­­s.

I am think­ing of buy­ing half a dozen more and get­ting rid of all the ca­bles for all my box­es, all of Rosar­i­o's of­fice and the guest com­put­ers (yes, I do have guest com­put­er­s. They are there so my guests have their own com­put­ers :-).

Plugged it and it worked (ok, I had to in­stall the zd1211 driv­er which took me 40 sec­ond­s). On­ly prob­lem: it's hot. HOT.

So, need a US­B/WiFi thingie that works well in Lin­ux? You can do worse than this ba­by.

So much cool stuff, so little time.

I read Za­ck Rus­in's blog about bench­mark­ing vec­tor graph­ic APIs... then I see a com­ment men­tion­ing Anti­grain. Then I check the anti­grain ex­am­ples, and they are gor­geous, and pret­ty fast! Even on a lame Sis630!

Then it hit me... I am nev­er go­ing to do any­ht­ing with it (or with Qt's Arthur). Maybe I am get­ting old, but I see a swirl of cool soft­ware... dpars­er... asymp­tote... tx­t2­tags ... (and those are on­ly the ones I saw in the last week).

All of them are about some­thing that in­ter­ests me, but I sim­ply can't do any­thing. I mean, would it be cool to write a vec­tor-ap­p-­for-kids with anti­grain (or Arthur?) Sure!

Would I like to im­ple­ment this shel­l-style lan­guage I have float­ing in my head for a year us­ing dpars­er (or py­pars­ing?) Yeah! Would I like to hack a Trac plug­in us­ing tx­t2­tags (or re­struc­tured tex­t?) Sure!

But when can I do that? I have my busi­ness, my wife, her preg­nan­cy, my oth­er project­s... maybe that's what hap­pens when you be­come old. You gath­er enough bag­gage that you can't lift any more back­packs in your trek.

But what can I do with all the ideas swirling in my head? Re­al­ly! What?

Moving load around with netpipes.

I had an emer­gen­cy. The CPU us­age of a cer­tain mail serv­er was rais­ing, and the cul­prit was clamd.

For some rea­son, in the last few month­s, the CPU us­age of clamd kept ris­ing, and was now near 70% av­er­age of the server's CPU.

Re­mov­ing the an­tivirus is, of course, not an op­tion. On the oth­er hand, per­for­mance was start­ing to suf­fer.

The usu­al re­sponse would be a full re­tool­ing of the se­tup, mul­ti­ple SMTP servers han­dling the load against a cen­tral stor­age server, cla­mav run­ning on each SMT­P... but switch­ing to that in­volves a full reim­ple­men­ta­tion of the sys­tem. Be­cause of the an­tivirus??? Hell no.

So, I start­ed in­ves­ti­gat­ing how I could move clamd to an­oth­er box, like I did with spa­mas­sas­sin. It was not pret­ty.

  • cla­­mav has a pro­­to­­col de­fined for con­nec­t­ing to re­­mote server­s.

  • cla­­mav does­n't have a client for it.

  • clamd-stream-­­client does­n't seem to work.

So, I thought... let's be orig­i­nal. What do I ac­tu­al­ly need?

I need to be able to call clamd­scan, and have it scan the cur­rent fold­er. Based on its ex­it sta­tus code (0/1/2) the mail is ac­cept­ed, re­ject­ed, tem­po­rar­ily re­ject­ed.

Hav­ing the same fold­ers struc­ture avail­able to two box­es is triv­ial. I have NF­S, lots of band­width and an­oth­er com­put­er.

Run­ning clamd­scan in the sec­ond box, scan­ning those fold­ers is triv­ial too.

The miss­ing piece is a way to tell the sec­ond box's clamd to scan, and get the ex­it code in the mail serv­er.

En­ter net­pipes!

Net­pipes is soft­ware to "make TCP sock­ets us­able from the shel­l". You can find it at http://we­b.pur­ple­frog.­com/~thoth/net­pipes/net­pipes.html.

And here's a re­place­ment clamd­scan which works the way I want­ed it:

exit `echo \$PWD | hose 9000 --slave `

This ver­sion takes the fold­er you want to scan as an ar­gu­men­t:

exit `echo \$* | hose 9000 --slave `

And here is the "serv­er side". First net­

#!/bin/dash -x
read args
/usr/bin/clamdscan \$args >/dev/null 2>&1
echo \$?

Then the "net­work code":

faucet 9000  --in --out /usr/bin/

And there you have it. Cla­mAV moved to an­oth­er serv­er. With 5 lines of shell code.

No, I don't get a dime from them

For a few months I have been us­ing an un­man­aged vir­tu­al pri­vate serv­er from Tek­ton­ic, and I love it.

What's that? Let's take it one word at a time, and then some more.

  1. It's a serv­er: which means it's a ful­l-ish lin­ux in­­stal­la­­tion. So it is ca­­pa­ble of do­ing lots of things. I can run all sorts of weird python thin­­gies in it if I wan­t. IMAPS and SSMT­P? No prob­le­­mo.

  2. It's pri­­vate: which means I am root on it. I have the shel­l. I choose what to in­­stal­l.

  3. It's vir­­tu­al: it's a Vir­­tuoz­­zo par­ti­­tion in a re­al serv­er. That means no cus­­tom ker­nel mod­­ules, and that since al­­most ev­ery­thing is shared with oth­­er in­­s­tances, 5GB of disk and 128MB of RAM go a long way.

  4. It's un­­man­aged: which means I man­age it. Which is just the way I pre­fer it, since that's my job.

  5. It's cheap. I start­ed on a 8 dol­lars a month plan (which does­n't seem to be there any­­more, the cur­rent cheap­­est is a 15 dol­lars plan).

  6. It's a throw­­away. I want to host some client as a favour? I just put it there. I could even rent an­oth­er of these servers for a while, use it, then close it. Back­­up­s? Click­­ing on a we­b­­page saves the im­age! Oth­­er than that... I back it.

  7. Fixed IP­s. All you want (for ex­­tra coin­s).

  8. A home away from home. All my stuff is there. I need it, I get it. With­­out both­­er­ing about hav­ing my own serv­er at home via no-ip or some­­such (which of course I still have too ;-)

  9. It works. It hard­­ly ev­er break­s. And hav­ing sur­­vived ex­pen­­sive, man­aged server­s, this ba­­by is work­ing just as well.

  10. It's a nice gift. Sup­­pose you have a con­nec­­tion to a free soft­­ware pro­­jec­t/LUG/­­fam­i­­ly/what­ev­er, and they need a place on the in­­ter­net. Why not spon­­sor them with some­thing like this? I of­fered one to PyAr (which did­n't take it, but it's the thought that counts ;-)

  11. The ul­ti­­mate learn­ing ex­pe­ri­ence: you can re­­s­tore the sys­tem in 2 min­utes. Want to play/learn sysad­min­ing? Do it on the re­al vir­­tu­al thing! Much cheap­­er than hos­ing your own box ;-)

  12. They of­fer a good ser­vice. So, peo­­ple should know about it. And of course... if you know a sim­i­lar, but even bet­ter deal... I'm all ears!