Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

New qmail plugin idea: overload

But then you start seeing how your "not pre­pro­ce­ss­e­d" queue star­ts gro­win­g, and gro­win­g...

This can al­so mean things like cla­mav or spa­ma­ssas­si­n, whi­ch need to che­ck the mail be­fo­re it ge­ts queued are not kee­ping up wi­th the mail flo­w, or ma­y­be so­me IO per­for­ma­ce is­sue.

But what can you do ri­gh now to fix it?

We­ll, you can di­sa­ble spa­ma­ssas­si­n, or, in ex­tre­me ca­ses, shu­tdo­wn SM­TP so the sys­tem has a chan­ce to ca­tch its brea­th so to speak.

Of cour­se, clo­sing SM­TP means your own users can't send email ei­the­r, whi­ch su­cks.

Now the­re is a li­gh­ter al­ter­na­ti­ve: shu­tdo­wn SM­TP for tho­se who are not your user­s.

He­re's the tri­vial co­de, im­ple­men­ted as a SPP plu­gi­n:

#!/bin/dash

if [ -f /var/qmail/control/overloaded ]
then
      if [ -z "$SMTPAUTHUSER" ]
      then
              echo R451 Temporary Failure: Server overload
              echo overload: $PPID Temporary Failure: Server overload >&2
      fi
fi

And if you are da­ring and want to make your sys­tem se­l­f-­co­rrec­tin­g, ma­y­be you should cron so­me­thing like this:

* * * * * if [ `qmail-qstat  | tail -1 | cut -d: -f2` -gt 100 ];\
then touch /var/qmail/control/overloaded ;\
else rm -f /var/qmail/control/overloaded; fi

I wi­ll pro­ba­bly co­de it again in C and make it part of ra/­plu­gin­s.

Me and the subte.

I moved to Buenos Aires (BA) al­most ex­act­ly 8 years ago. For those who have nev­er been here, let me tell you some things about it. It's large. Do you know Sao Paulo? A bit small­er. Much small­er than Mex­i­co DF. About the same size as New York. Twice the pop­u­la­tion of the Rand­stad. About the same as greater Paris or Is­tan­bul. So fig­ur­ing out a way to move around it was im­por­tan­t.

Vista dos Aires

The way most na­tives do it is by bus. There is a pret­ty ex­ten­sive and ef­fi­cient net­work of bus­es which will take you any­where. There are maybe 150 dif­fer­ent lines, but if you don't know the city, spe­cial­ly the place you are try­ing to reach, they are a recipe for get­ting lost, be­cause you can (will) miss your stop and end any­where else.

Colectivos

To make it worse, I get dizzy on bus­es. The brak­ing and start­ing makes me re­al­ly sick. I can con­trol it, as long as I look out the win­dow, or straight for­ward, and breath re­al­ly care­ful­ly.

So, since I don't drive, and cabs are rel­a­tive­ly ex­pen­sive, I al­ways pre­ferred the sub­way, or, as it is called here, the subte. Plus, on trains and sub­ways I can even read and not get dizzy. I al­ways tried to live close to a sta­tion, I had al­most one hour to read while trav­el­ing and we got along great.

The subte is pret­ty old. The first in Latin Amer­i­ca, and still the on­ly one in a few mil­lion near­by square miles. But it's al­so ... quirky.

For in­stance, I lived in Bel­gra­no, close to the D line. Which had ja­pa­nese cars. How did I know they were ja­pa­nese cars? Well, they had all these things writ­ten on the win­dows in Ja­pa­nese. Sad­ly, I can't find pic­tures of that, and in a re­cent trip I did­n't see them, so it may be that af­ter maybe 20 years some­one de­cid­ed to rub them of­f. That's a pity. I al­ways imag­ined they said in­ter­est­ing stuff, even if they prob­a­bly said "keep your hands in­side the car, you id­iot".

There's al­so the bo­letería-kiosco. A kiosco is a sort of mi­ni drug­store, where you can buy can­dy, a so­da, maybe a com­b, or con­dom­s. A bo­letería is a palce where you buy tick­ets to ride the subte. And in some places, you can do both things. Be­cause they turned the tick­et booths in­to kioscos.

El hombre del Kiosco

Tere is the line at Re­tiro sta­tion, in the C line. There's 4 or 5 bo­leterías. When you get there, of­ten there's 40 or 50 peo­ple in line on the first one. And you can walk just be­side them and buy a tick­et in the 4th or 5th booth, where there's noone wait­ing.

And of course, a clas­sic, the one ev­ery tourist sees. The A line. The orig­i­nal BA sub­te, opened 90 years ago or so... and still us­ing the same cars. Yes, you can ride an­tique, wood­en cars to work on that line. With in­can­des­cent bulbs on glass tulip­s. With man­u­al doors (man­u­al open­ing on­ly, they close au­to­mat­i­cal­ly with bone crush­ing force).

Empty train car

Sure, it's hot. There's no air con­di­tion­ing, and BA can get pret­ty hot in sum­mer. But it's nice in win­ter! It's fast, you can't get lost, and it's just so BA.

Extraño bug con Django/PyODB

Pa­ra lo­guear un usua­rio se pue­de ha­cer al­go así:

[root@wally app]# python manage.py shell
Python 2.3.4 (#1, May  2 2007, 19:26:00)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from pyodb import *
>>> import django.contrib.auth
>>> print django.contrib.auth.authenticate(username='user',password='pass')
user

Y des­pués se usa el ob­je­to user pa­ra djan­go­.­con­tri­b.au­th.­lo­gin

Una par­te de los da­tos de au­ten­ti­ca­ción es­tán dis­po­ni­bles en un Mi­cro­so­ft SQL Ser­ve­r, y los ob­ten­go via pyo­db. Y es­to es lo que su­ce­de cuan­do tra­to de au­ten­ti­car el usua­rio (a­su­ma­mos que user y pa­ss son vá­li­do­s, es­to es el frag­men­to más pe­que­ño que dis­pa­ra el bu­g):

[root@wally app]# python manage.py shell
Python 2.3.4 (#1, May  2 2007, 19:26:00)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from pyodb import Connect
>>> import django.contrib.auth
>>> c1=Connect("moodle_emisql",uid="gruposintramed",pwd="yev431")
>>> print django.contrib.auth.authenticate(username='user',password='pass')
None

Com pue­den ve­r, lo del pyo­db no de­be­ría in­ter­fe­rir con lo de djan­go. Im­por­to so­lo una fun­ción y co­nec­to con la BB­DD, ni si­quie­ra eje­cu­to na­da de SQ­L, no uso nin­gún da­to bte­ni­do de la co­ne­xión SQ­L. Pe­ro las lla­ma­das a au­then­ti­ca­te fa­llan.

¿Co­mo se su­po­ne que uno de­pu­ra es­to? Me las arre­glé mo­vien­do lo de PyO­DB a otro mó­du­lo pe­ro es ra­ro.

Presentaciones en modo texto

Ya que me gus­ta el res­truc­tu­red text y Py­Q­t, es­tá ba­sa­do en eso, pe­ro se pue­de usar con vi y una wyse60.

Mi pro­yec­to se lla­ma To­bo­gan y se pue­de des­car­ga­r, y fun­cio­na has­ta cier­to pun­to.

Tie­ne una in­ter­fa­ce grá­fi­ca, pe­ro ig­no­ré­mos­la en es­te men­sa­je acer­ca de so­ftwa­re en mo­do tex­to ;-) y mos­tre­mos el tex­to que tie­ne atrá­s.

===============
Why use Tobogan
===============

-------------------
(If you are a nerd)
-------------------

:transitions: from_left,to_left,from_top,to_top,from_right,to_right,to_bottom,fade_out



It's nerd-oriented
------------------

It's trivial to display source code, with
proper syntax highlighting.

.. code-block:: python

    from base64 import *
    def myFirstFunction():
          print b64decode ('YnllIHdvcmxkIQ==')

Even for things like shell sessions.
Dammit, I am a nerd, I will try to add every nerd
feature I deem cool.



It does things simply
---------------------

This is a subtitle?
===================

Wanna show a flickr photo?

.. code-block:: rst

    .. flickr:: myPhotoTitle

How about using openomy.com to share your files?
And whatever else you can think of, it probably
**can**\  be done.

.. footer:: Smart thing goes here

Y aquí es­tá el re­sul­ta­do des­pués de co­rrer el script rs­t2s­l.­p­y.

Pis­ta­s:

  • Si el cu­r­­sor se mue­­ve ha­s­­ta la pa­r­­te su­­pe­­rior de la ven­­ta­­na, se pue­­de ver fle­­chas de an­­te­­rio­­­r/­­si­­guien­­te.

  • Si se ha­­ce cli­­ck en la ven­­ta­­na, se va a la si­­guien­­te pá­­gi­­na.

ha­ce ca­si un año que no lo to­co, y ne­ce­si­ta mu­cho ca­ri­ño, pe­ro no es una ma­la idea, me pa­re­ce.


Contents © 2000-2024 Roberto Alsina