Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Linux Installation Kung Fu

I de­cid­ed to try Arch Lin­ux on my note­book. The rea­sons don't mat­ter.

How­ev­er, there was this prob­lem about the CD drive be­ing bro­ken, and the lack of a flop­py drive.

So, how did I do it?

I had a par­ti­tion I could de­stroy (/de­v/h­da3)

I in­stalled qe­mu.

Then, I start­ed qe­mu us­ing the whole HD and a CD ISO im­age (boot­ing from the CD!):

qemu -hda /dev/hda -cdrom arch-0.7.1.iso -boot d

Then, very care­ful­ly I in­stalled it on hda3 and did not in­stall GRUB.

Copied the ker­nel and ini­trd im­ages to /boot on the oth­er lin­ux in­stal­la­tion.

Edit­ed grub.­con­f, adding the Arch en­try...

And it worked.

Keep in mind that if you make a mis­take, this will com­plete­ly de­stroy all your da­ta. But if you are care­ful, and have enough space, you can in­stall your next Lin­ux while you use your cur­rent one.

Now, is that cool or what? :-)

Cool toys: Synergy

In the last week or so I have been re­or­ga­niz­ing my workspace. Or rather, Rosar­i­o's workspace, and that meant mov­ing some fur­ni­ture my way.

One of the things I got is a long desk­top, with room for two PCs (it was used in the class­room in Conec­ti­va, and I got it as part of my sev­er­ance pay­men­t).

So, I put my desk­top on it, a key­board and mouse of the tray be­low, and my home serv­er on the oth­er side of it.

That home serv­er has been head­less for a loooong time.

But since I have room in the table, I hooked a mon­i­tor, key­board, mouse set to it, and thought "maybe it will work as a guest ma­chine", for when some­one comes to work or stay at my place.

Then I thought, there must be some way to use one key­board and mouse to drive both ma­chi­nes, and start­ed look­ing for KVM switch­es and stuff.

Then I thought... maybe there is a way to do it by soft­ware... and yeah! En­ter syn­er­gy ...

You run a serv­er on the box with the key­board, and a client on the oth­er­s. Ex­plain the re­la­tion­ship be­tween them in the sim­ple con­fig file... that's it.

Now I can slide the mouse off a screen to the oth­er com­put­er's, and you even share a clip­board!

Re­al­ly, re­al­ly, re­al­ly nice stuff. Works flaw­less­ly.

And since I am a bit weird in my ways, now... how can I make this work as a xin­era­ma so­lu­tion, where all the apps are in my note­book, and the oth­er is just a dis­play server?

Right now, I am start­ing a full screen FreeNX ses­sion point­ed back at me, so ev­ery­thing is on the same box. But I can't move win­dows be­tween both mon­i­tors.

I think with some cre­ative think­ing this can work. X app dis­play mi­gra­tion...

Ideas for SMTP plugins

The on­ly cur­rent soft­ware I wrote that some peo­ple ac­tu­al­ly use is called RA-­Plu­g­in­s. It's a se­ries of prog­gies you plug in your SMTP server's con­ver­sa­tion, and do di­verse things with it, like re­ject­ing mes­sages that fail cer­tain cri­te­ri­a, check­ing the sta­tus of the re­cip­i­en­t's ac­coun­t, what­ev­er.

In­ject­ing this stuff in the mid­dle of SMTP is good be­cause it means you will re­ject the mes­sages be­fore they get in­to your serv­er. But... I am run­ning out of ideas, so... have any you can spare? :-)

You can see the cur­rent plug­in list here and the on­ly ideas I have left are:

  • A plug­in that calls back to the sender's email serv­er and tries to email him, ala mil­ter-sender to catch forged sender­s.

  • A plug­in to au­­towhitelist in spa­­mas­sas­sin those ad­­dress­es to which you send mail.

  • A plug­in to keep an ac­­count of how many con­nec­­tions you hold to each IP, and lim­it them. (Not cur­ren­t­­ly pos­si­ble)

If you un­der­stand what I wrote, and have any ideas... feel free to post them as com­ments and/or email me with them!

Annoying APIs: djbdns

Look­ing for a sim­ple way to lookup the MXs for a giv­en do­main, I ran in­to lib­d­jbdns. Which has a de­light­ful­ly sim­ple API.

Of course it has its wrin­kles.

Con­sid­er the MX lookup in­ter­face:


Where out and fqdn are stral­locs (a sort of string that can con­tain 0).

But just try pars­ing out! Here's the ex­pla­na­tion:

Each MX record is a two-byte MX dis­tance fol­lowed by a 0-ter­mi­nat­ed dot-en­cod­ed do­main name. If the do­main does not ex­ist in DNS, or has no MX record­s, out will be emp­ty.

Be­cause al­most noone us­es MX dis­tances high­er than 256, sad­ly, this usu­al­ly looks like this (sor­ry for the no­ta­tion ;-)

\0 10 f i r s t . m x \0 \0 20 s e c o n d . m x

So, you can not split on the NULLs be­cause there are NULLs in the dis­tances.

Which is not hard to parse, but is def­i­nite­ly more an­noy­ing than it should be. How hard would it be to re­turn an ar­ray of struct­s?

CMake is nice. Or not?

I am play­ing with CMake. Specif­i­cal­ly, I am try­ing to re­place the sim­plis­tic hand­made Make­files for my RA-­Plu­g­ins projec­t.

The parts about de­tect­ing li­braries and con­di­tion­al­ly com­pil­ing plug­ins based on what you have were sur­pris­ing­ly easy!

Un­til I ran in­to ... man pages.

Here is a Make­file that would build all the man­pages for the plu­g­in­s:

MANPAGES=plugins-ra.8 authchecks.8 rcptchecks.8
man: \$(MANPAGES)
      txt2man -t \${basename $< .man.txt} < $< > $@

As you can see... triv­ial. All I need to do in or­der to add a man page is add what­ev­er.8 to the list, and it will be cre­at­ed from what­ev­er.­man.tx­t.

But... how does one do that us­ing CMake?

I start­ed think­ing of us­ing a FILE (GLOB *.­man.tx­t) and then a FORE­ACH over that, and then... then what? Re­al­ly, I am stumped. I am a new­bie, though, and get­ting the big, dif­fi­cult stuff done is enough to switch. I should gen­er­ate these be­fore dis­tri­bu­tion any­way.

So, I wrote a wee Make­file.­man­pages and added this for CMAKE:

ADD_CUSTOM_TARGET ( manpages make -f Makefile.manpages )

But I am cu­ri­ous about find­ing the cmakeish way.

Contents © 2000-2022 Roberto Alsina