miércoles, 29 marzo 2006

Chequear integridad referencial en MySQL

He encontrado esta maravilla de script. Sirve para chequear la integridad referencial en todas las tablas de una base de datos. La url origina: En la web del Mysql El script modificado para que funcione con el MySQL 4.1:
#!/bin/sh

# check_constraints.sh
# --------------------
# Check foreign key contraints on MySQL database.
#
# Written by Frank Vanderhallen, licensed under GPL.

if [ -z "$1" ]
then
echo "Usage: ./`uname $0`  [-h ] [-u user] [-p ]\n"
exit
fi

CONSTRAINTS=`mysqldump $* | grep "CREATE\|CONSTRAINT" | sed 's/ /+/g'`

for c in $CONSTRAINTS
do
if [ "`echo $c | cut -d '+' -f 3`" = "CONSTRAINT" ]
then
CONSTRAINT=`echo $c | cut -d '+' -f 4 | tr -d '\`'`
CHILD_KEY=`echo $c | cut -d '+' -f 7 | tr -d '()\`,'`
PARENT_TABLE=`echo $c | cut -d '+' -f 9 | tr -d '\`'`
PARENT_KEY=`echo $c | cut -d '+' -f 10 | tr -d '()\`,'`
QUERY="select c.$CHILD_KEY from $CHILD_TABLE as c left join $PARENT_TABLE as p on p.$PARENT_KEY=c.$CHILD_KEY where c.$CHILD_KEY is not null and p.$PARENT_KEY is null;"
echo "Checking table '$CHILD_TABLE' constraint '$CONSTRAINT'"
mysql $* -e "$QUERY"
else
CHILD_TABLE=`echo $c | cut -d '+' -f 3`
fi
done
Posted by angel at 6:24 PM in Linux

viernes, 17 marzo 2006

Dividir imagen en cuatro

Tengo una imagen jpg que ocupa 8132x4628 y quiero imprimirla.
Es un modelo de datos y al imprimirlo sale tan pequeño que es imposible leerlo.
Lo quiero dividir en 4 imagenes:
$ convert -crop 4066x2314+0+0 modelo.jpg modelo11.jpg
$ convert -crop 4066x2314+4066+0 modelo.jpg modelo12.jpg
$ convert -crop 4066x2314+4066+0 modelo.jpg modelo21.jpg
$ convert -crop 4066x2314+4066+2314 modelo.jpg modelo22.jpg
O más fácil todavía:
$ convert modelo.jpg -crop 4066x2314 modelo%d.jpg
Posted by angel at 11:27 AM in Linux

miércoles, 7 diciembre 2005

VOIP.

Direcciones de interés:
  • En castellano:
  • En inglés:
  • Distribuciones:
  • Posted by angel at 11:33 AM in Linux

    miércoles, 3 agosto 2005

    PHP en un servidor Tomcat 5

    El Martes lo explico.
    De momento: http://wiki.apache.org/jakarta-tomcat/UsingPhp
    http://www.google.es/search?q=running+php+in+tomcat&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial
    http://www.google.es/search?hl=es&q=SAPI+php+tomcat&btnG=B%C3%BAsqueda&meta=
    http://www.php.net/manual/tw/ref.java.php#java.servlet
    http://analogueboy.blogspot.com/#106959689637832829
    Posted by angel at 8:28 PM in Linux

    miércoles, 20 julio 2005

    Direcciones de interés [Linux]

    A continuación listo urls interesante relacionadas con linux:
    Posted by angel at 10:26 AM in Linux
    « noviembre »
    lunmarmiéjueviesábdom
         12
    3456789
    10111213141516
    17181920212223
    24252627282930