14 de marzo de 2010

Instalando un repositorio de Subversion (en Debian Squeeze)

Estos pasos fueron realizados con la version testing de Debian Squeeze, pero deberian servir como punto de partida. También debo señalar que estos pasos fueron pensado para facilitar el acceso de los usuarios, y no tanto por la seguridad.

Creación del repositorio

Como root creamos un directorio donde estara el positorio, por ejemplo:
# mkdir /var/svn-repos
Creamos el repositorio propiamente dicho:
# svnadmin create --fs-type fsfs /var/svn-repos/test_repo

Ajustar permisos del repositorio

Para que el repositorio pueda ser usado por otros usuarios tenemos que ajustar algunos permisos.
Primero creamos un grupo donde agregaremos a todos aquellos usuarios que van a poder acceder al repositorio. Por ejemplo:
# addgroup development
Agregamos los usuarios al grupo creado:
# adduser juan development
# adduser luis development
Ajustamos los permisos del repositorio:
# chown -R www-data:development /var/svn-repos/*
# chmod -R 775 /var/svn-repos/*

Accediendo al repositorio

Ahora podemos acceder al repositorio a través de ssh:
$ svn co svn+ssh://hostname/var/svn-repos/test_repo
Para evitar que debamos responder repetidas veces la password conviene utilizar ssh-agent con una clave privada.
Si queremos acceder al repositorio por http primero tenemos que crear una base de datos con los usuarios permitidos:
# htpasswd -c -m /etc/apache2/dav_svn.passwd juan
# htpasswd -m /etc/apache2/dav_svn.passwd luis
La primera linea crea el archivo, la siguiente sirve para agregar los demas usuarios.
Ahora modificamos el archivo /etc/apache2/mods-available/dav_svn.conf agregando:
<Location /test_repo>
  DAV svn
  SVNPath /var/svn-repos/test_repo
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
</Location>
Recargando la configuracion de apache con # invoke-rc.d apache2 reload, podemos acceder al repositorio como usuario:
$ svn co http://hostname/test_repo
También podremos acceder desde un navegador, con nuestro usuario y password, al repositorio desde la dirección http://hostname/test_repo.

Instalando ViewVC

La página de acceso por web es bastante simple, si queremos algo con más funcionalidad podemos instalar ViewVC.
Editamos el archivo /etc/viewvc/viewvc.conf. Dentro de la sección [general] agregamos una linea así:
svn_roots = test_repo : /var/svn-repos/test_repo
Opcionalmente: podemos comentar la linea que comienza con cvs_roots, a menos que hayamos instalado un repositorio Cvs. Tambien podemos habilitar la opción root_as_url_component.
Creamos un archivo /etc/viewvc/apache.conf con la configuración para apache. Este archivo contiene la siguiente linea:
ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi

Agregamos este archivo al directorio con las configuraciones de apache y recargamos:
# ln -sf /etc/viewvc/apache.conf /etc/apache/conf.d/viewvc.conf
# invoke-rc.d apache2 reload
Una vez terminado los pasos anteriores tenemos un interfaz web más bonita que se puede acceder desde: http://hostname/viewvc/test_repo.

Referencias:

28 de enero de 2010

Programmer's Tools (Part II)

More tools that can be useful for the windows programmer

You can check Scott Hanselman's Tool List for Windows http://www.hanselman.com/tools for more utilities.

10 de enero de 2010

Programmer's Tools (Part I)

There are some tools that are useful for a programmer working under windows, independently from the language they work on.

Next installment will bring more advanced tools.

18 de mayo de 2009

The Beauty and the Ugly of C++ coding

This both snippets of code will do the same.
The first one is longer but more readable:

if (show) {
    p->Show();
}
else {
    p->Hide();
}

And the second one is more compact but is almost illegible I've to say:

(p->*(show ? &View::Show : &View::Hide))();

19 de noviembre de 2008

Hace mucho escribía artículos de matemática...

En esta página hay una muestra http://www.geocities.com/xhantt/, no eran buenos, ni nuevos, pero a mi me parecian interesante escribirlos.

Update: Desde que publicé este mensaje Yahoo! decidió cerrar GeoCities por así que todas páginas desaparecieron. Afortunadamente algunas páginas todavía sobreviven, por ejemplo “The Immortal Game” por Adolf Anderseen http://www.geocities.com/lifemasteraj/a_ander.html.

11 de julio de 2008

Libros

Libros que en este momento tengo cerca, lo que quiere decir que los estube/estoy/estaré leyendo
  • Brevisima historia del tiempo, Stephen Hawking: Lo escribi en un post anterior, es un libro de divulgación. Los capitulos que leí eran bastante interesante, aunque si uno lo que busca es profundidad saben a poco.
  • Cronica del pajaro que da cuerda al mundo, Harumi Murakami: Todavía no lo mire.
  • Tsugumi, Banana Yoshimoto: Lo miré un poco, pero no puedo decir mucho.
  • Out, Natsuo Kirino: Un policial bastante crudo y realista, en la contratapa dice que la autora se la conoce como la reina japonesa del Crimen, hasta ahora no me decepciona.
  • Nieve de primavera & El templo del Alba, Yukio Mishima: Forma parte de la tetralogía El Mar de la Fertilidad, las otras novelas son Caballos desbocados, La corrupcion de un angel. Tengo que conseguir las otras dos novelas de la tetralogía.
  • Crónica de una muerte anunciada, Gabriel Garcia Márquez: Uno de los mejores libros que leí, tiene un cierto aire de realismo que me hace acordar a A sangre fria de Capote, pero es muy distinto es claramente un exponente del realismo mágico.
  • El día de los Trifidos, John Wyndham: Ciencia ficción de la época dorada. Pero el mundo es muy distinto 50 años después de que fue escrita, me pasó lo mismo cuando vi El ciudadano, son obras maestras pero me siento fuera de contexto.
  • Ciberiada, Stanislaw Lem: Una colección de historias buenísimas, es un libro que no quiero terminar de leer. Son las historias de dos constructores que se involucran en situaciones totalmente desopilantes.
  • La trilogía de New York, Paul Auster: Es un policial, todavía no lo leí.
  • El coleccionista de mundos, Ilija Trojanow: Biografía novelada de Richard Burton, un incansable aventurero.

4 de julio de 2008

Revelation (kind of)

And I stood upon the sand of the sea, and saw a beast rise up out of the sea, having seven heads and ten horns, and upon his horns ten crowns, and upon his heads the name of blasphemy. And they worshipped the dragon which gave power unto the beast: and they worshipped the beast, saying, Who is like unto the beast? who is able to make war with him?
The Book of Revelation, St. John, 13:1,4

12 de junio de 2008

GTH parte II.

Para el ejercicio 3 habia que saber algo de redes, como se rutean mensajes entre computadoras, y no mirar el grafo! El ejercicio 4 era el que tenia base matematica, igual no mucha. Habia que buscar varias secuencias de numeros primos consecutivos cuya suma tambien sea primo. Era mucho mas facil de lo que me habia imaginado al principio. Una posible solucion es crear una tabla de primos grande (107 por ejemplo), y luego poner las condiciones mas fuertes primero, y luego las mas debiles.

9 de junio de 2008

Sayonara Kubuntu.

Until last year I was a happy Kubuntu user. I started as an occasional user with HoaryHedgehog and Dapper Drake, first with the normal Gnome version later switching to KDE. Almost two years ago with the release of Edgy Eft I've switched my main desktop to Kubuntu, I remember this version was a bit sloppy, because it was a rushed version with only 4 months of development, but in general was a good release. The same goes for the next versions, but unfortunately they keep releasing sloppy versions. A change here, a change there, and little bits of pieces were broken, really nothing too serious, but when you take a look from a distance you find that you have to solve same problems over and over again, and it start to look ridiculous. All started with this bug report Can't init Maxima session withing TeXmacs, to have a better startup times Ubuntu have switched the defaul shell from Bash to Dash, these change broke a large number of scripts that relly on the assumption that sh=bash. These bug report have a workaround, it is not elegant but works, but in the three versions since them (Feisty, Gutsy and Hardy), these package is broken. I can live with these it's annoying, but because I use my box mostly to develop, I've to make the change so sh points to bash, or else a lot of configure scripts didn't work as expected. But the worst bug is this DDC report some ridiculous physical screen size, but it was reported previously as Large font in Gdm login text and the oldest related report I can find of Gdm login text field shows overly large characters. In Gnome the only affected is Gdm, if you can correctly type your username and password you get the desktop and everything is normal. But in KDE the whole desktop is a mess and you really can't work, one ugly workaround is adding a line Option "DDC" "False" in your xorg.conf. These bug was not fixed in Gutsy, but still intel was an optional driver and you can have it installed alongside the old i810 driver. But the default driver in Hardy is now intel. Another fault of Gutsy was that it included D3lphin as default filemanager instead of Konqueror. It is a good filemanager but the KDE 3 version is no longer supported, because most of the resources were focused in the KDE 4 release. So d3lphin was a spinoff while KDE4 was not released, and huge problem for me was that it didn't support # in filenames or folders, I can't rename filenames inside a CDR!! Here is another problem with Ubuntu, once a final version is released the packages are frozen, no more updated versions, only critical and security bugfixes. If you want a new version you have to request a backport and wait if a developer is interested enough, or compile your own version (which I think is the fastest way). But I know that some packages are allowed to break this rule, ie Firefox. Other problem is that between versions you have to do a full upgrade and can't do a partial upgrade. Well if you are lucky enough you can upgrade a simple package if it not have a complex set of dependencies, but you have to install it manually. I know Ubuntu is moslty done by volunteers, I've talked to several of them in the IRC channels, they are passionate, dedicated and good persons. You can't blame them, they work really hard, just a Linux distribution like Ubuntu require a lots of people to work together to make a release, and they are not enough. Perhaps Ubuntu is a victim of it own success, having a large user base also implies there are a large number of bugs reported, this in turn requires a better organization as a whole, a more formal QA process and more involvement from Canonical.

8 de junio de 2008

Cine: Los crimenes de Oxford.

Hace algún tiempo comentaba sobre el libro Crímenes imperceptibles de Guillermo Martínez, el libro tiene un par de vueltas interesantes, mezcla de género policial con algo de matemáticas (a veces demasiada), y si les gusta el género policial resulta una lectura recomendable, pero si les gusta la matemática hay partes que no les va a gustar. Luego me enteré de que se estaba planeando una película sobre el libro, y que iba a ser dirigida nada más y nada menos que por Alex de la Iglesia, todo presagiaba una buena película. Bueno ahora que vi la película mi conclusión es que deja bastante que desear. Hay muchos cambios respecto a la historia del libro:
  • El protagonista principal es norteamericano y se llama Martin, en el libro es argentino y se llama Guillermo.
  • La introducción de los personajes es bastante apresurada y parece forzada, en el libro es más casual.
  • El personaje de Beth tiene una actitud activa y decidida, en el libro es más sumisa y se deja llevar por las circunstancias.
  • El protagonista juegan squash, en el libro en cambio juega tenis.
  • Cuando Seldom esta dando su clase, el contenido del pizarrón no coincide con el tema.
  • El protagonista llega a Oxford y no tiene director, en el libro cuando llega si tiene una directora de tesis.
Y así hay cambios a lo largo de toda la película que no los pongo por si les interesa verla. No me gustan los juego de palabras pero en este caso la película es un crimen (de buen gusto) bastante perceptible.