Weblog Index
Comments disabled
I don't expect there is anybody reading this blog so comments will be disable for the foreseeable future due to spam. It amazes me that some idiotic spammer wasted time figuring how to spam a site with ~0 readers.
Posted 2006-12-29 22:17:42 by Eduardo Muñoz | Comments (0)
Dakar 2006
The Lisboa-Dakar (AKA Paris-Dakar) race did go this year near my house so went to take some photo in the nearby highway

Posted 2006-01-06 21:32:07 by Eduardo Muñoz | Comments (0)
What's in a Name?
I finally decided to give name to this pages just because as Kent M. Pitman says a name is an important thing and remembering and telling to people a bunch of numbers ceases to be fun after a while. That and because I found a somewhat punny name for it.
I got www.boundp.com too, but there is not much to see there.
Posted 2005-08-01 00:46:17 by Eduardo Muñoz | Comments (1)
CLSQL, Postgres & Memory starvation
This machine has only 64MB of ram. Very little for today standards. One of the problems I had was PostgreSQL memory consumption. There 7 postmaster process happily taking 6-7 MB each. Poking around the postgres documentation found some useful variables in postgresql.conf:
max_connections = 10 # about 500 bytes of shared memory per slot
shared_buffers = 40 # min 16, at least max_connections*2, 8KB each
This is a home machine and the databases holds little more than this blog plus some other stuff, so setting those variable much lower that the default is a safe bet.
Now, how to reduce the number of postmaster process running? Given that the priority is to reduce memory usage opening and closing the connections is the way to go. So I went from this:
;;; This leaves the connection open
(defvar *blog-db* (clsql:connect '(nil "blog" "user" nil)
:database-type :postgresql
:if-exists :old))
to this
(defvar *blog-db*)
(defparameter *blog-conn* '((nil "blog" "emf" nil)
:database-type :postgresql
:if-exists :new))
(defmacro with-db ((name spec) &body body)
`(let ((,name (apply #'clsql:connect ,spec)))
(unwind-protect
(multiple-value-prog1
(progn ,@body))
(clsql:disconnect :database ,name))))
;;; Now the connection is openned and closed at every page hit
(with-apache-address (*blog-address* :public t)
(standard-page "Weblog"
(with-db (*blog-db* *blog-conn*)
.....))
I think it may make the pages a tad slower than before, but if you are reading this you are ready to waste some time :)
Posted 2005-04-23 21:17:05 by Eduardo Muñoz | Comments (0)
Accept-Language
I wanted to display a different "welcome page" depending on the preferred language indicated by the browser. Until now I left that work to apache itself using pages named index.html.en and index.html.es but it didnt work very well. So I have rolled my own little parser for the Accept-Language header. I havent read any relevant RFC and I am going from the info posted two weeks ago in emacs.devel (I think). But it works for me and may be useful to someone else.
(defun sort-lang-header (header &optional (strip-country t))
"Returns a sorted list of preferred languages"
(delete-duplicates
(mapcar #'car (stable-sort (parse-lang-header header strip-country)
#'> :key #'cdr))
:test #'string=))
(defun parse-lang-header (header &optional (strip-country t))
(loop for start = 0 then (1+ comma)
for comma = (position #\, header :start start)
collect (parse-lang-item (subseq header start comma)
strip-country)
while comma))
(defun parse-lang-item (item &optional (strip-country t))
"Parse \"en-us;q=0.8\" into (\"en-us\" . 0.8). No quota (q=) means 1.0"
(flet ((maybe-strip-country (lang)
(string-trim " "
(if strip-country
(subseq lang 0 (position #\- lang))
lang))))
(if-bind (semicolon (position #\; item))
(cons (maybe-strip-country (subseq item 0 semicolon))
(let (*read-eval*)
(read-from-string
(string-trim "q=" (subseq item (1+ semicolon))))))
(cons (maybe-strip-country item) 1.0))))
The next feature will be (hopefully) one of those RSS thingies so I can bother a lot of lispers at the same time.Posted 2005-03-27 00:06:05 by Eduardo Muñoz | Comments (0)
GoogleJuice games
Suprisingly enough this site ranks quite high in certain Google searches so I am trying to give some Googlejuice to my workplace. It really needs it.
That being said, excuse me if I post the links in spanish and english.
Torres eléctricas y subestaciones. Y aunque no te lo creas una estación de ensayo de torres.
Electric transport towers and switchyards. And believe it or not a tower testing station.
Posted 2005-02-13 21:00:33 by Eduardo Muñoz | Comments (0)
More weblog stuff
I am seeing a lot of traffic coming from lispmeister.com (and planet lisp) interested on a Common Lisp weblog. So I am sharing some more code, the weblog master. Nothing too fancy, just enough to handle weblog admin via web.
As always comments are welcome.
Posted 2004-03-02 19:26:16 by Eduardo Muñoz | Comments (1)
Spam killer
Deleting 200 virus messages a day is no fun, so i wrote a naive spam killer in lisp. It will connect to your pop server and delete spam without downloading it. The selection of wich messages to delete is regexp based. This program requires "postoffice", that depends on "acl-compat", and "cl-ppcre".
Writing lisp programs in Debian is really easy because it includes every lisp library known to man.
Posted 2003-09-22 13:21:33 by Eduardo Muñoz | Comments (0)
HTML Generation
To make the site pages easier to understand, here is some source code:
- weblisp.lisp
- utils.lisp
- macros.lisp
- My modified mod-lisp.lisp
- And a copy of htout.lisp
You can find a copy of the weblog source in the Weblog test
Posted 2003-07-14 21:49:01 by Eduardo Muñoz | Comments (2)
Referers and Logs
Looking at this site logs I see that
a good chunck of traffic comes from
two places: Christopher B. Browne's
page and John Wiseman's
lemonodor. Thanks guys.
I have developed (in lisp) a system to log the visits to this site. It gives me a link with every address to "whois" the IP. Playing with it is easy to see that the lisp world is more than comp.lang.lisp, sourceforge, and some weblogs. I've seen some high profile companies and institutions, so I think that there is still hope for CL :)
Posted 2003-06-21 19:04:52 by Eduardo Muñoz | Comments (0)
Website comments/Guestbook
Send your comments or salutations to the owner of the site.
That's me :)
Posted 2003-05-16 15:16:32 by Eduardo Muñoz | Comments (5)
Weblog test
I'm only testing this thing, so be patient.