jci's blog

Earthquakes can't stop the rock

Escrito el 06/11/11 03:51:13 am por jci

You know? Just enjoy the big show. We'll talk later.

Categories: Web Link Blog

Red Special

Saben?

Cuando pienso que nada podria mejorar, todo cambia.

Cambie mi trabajo hace unos meses. Y tambien cambie lo que me quedaba de vida. Todos los que me conocen me han visto distinto. Eso es bueno.

_MG_8026
You cannot say it's something awful

Por donde empezar a explicar como fue el cambio? Nah, quizas fue dejar mi antiguo laburo y tener uno mucho mejor.

Incluso con el sentido chauvinista. Pero estar alla por Paranal me ha dado clases de todo. Fisica, quimica, astronomia...

Lo que si doy gracias es tener amigos como Fernando.

Gracias. Infinitas!

Dios Salve a la Reina
Keep passing the open windows that will rock you

:D

3629 views » 1 feedback »

Escrito el 05/23/11 02:40:36 pm por jci

After all this bullshit, something must come to a good end

Categories: Web Link Blog, GNOME, GNU/Linux, Programacion, Hacks

Hace un tiempo atras, Claudio subio un script en Python que permite esto:

jci@rock:~/Photos/l$ ls
IMG_1190.JPG  IMG_1191.JPG  IMG_1192.JPG  IMG_1193.JPG
jci@rock:~/Photos/l$ ~/scripts/picsdir.py .
IMG_1191.JPG
creating dir ./2011-05-23
./2011-05-23
IMG_1192.JPG
./2011-05-23
IMG_1193.JPG
./2011-05-23
IMG_1190.JPG
./2011-05-23
Traceback (most recent call last):
  File "/home/jci/scripts/picsdir.py", line 66, in <module>
    print sum(getsize(join(root, name)) for name in files)
NameError: name 'files' is not defined
jci@rock:~/Photos/l$ ls
2011-05-23

Pero desde que me dio por actualizar a Natty...

jci@socrates:~/Photos/untitled folder 2$ ~/scripts/picsdir.py  .
IMG_1101.JPG
Traceback (most recent call last):
  File "/home/jci/scripts/picsdir.py", line 64, in <module>
    start=Main(sys.argv)
  File "/home/jci/scripts/picsdir.py", line 62, in Main
    move_smartly (filename, dir_in, dir_out)
  File "/home/jci/scripts/picsdir.py", line 29, in move_smartly
    image = pyexiv2.Image(image_file)
AttributeError: 'module' object has no attribute 'Image'

Nada que un hack no pueda hacer :-)

#!/usr/bin/env python

# Copyright (C) 2008  Claudio Saavedra 
# modified by jci :-)
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

import sys
import pyexiv2
import os
import os.path
import shutil
import mimetypes

def move_smartly(file, dir_in, dir_out):
    image_file = os.path.join (dir_in, file)
    image = pyexiv2.ImageMetadata(image_file)
    image.read()
    try:
    	date_creation = image['Exif.Image.DateTime']  
    except:
	print "i'm ignoring this"
        return
    print date_creation
    str_date = date_creation.value.strftime('%Y-%m-%d')
    target_dir = os.path.join (dir_out, str_date)

    if (not os.path.exists(target_dir)):
        print "creating dir " + target_dir
        os.mkdir(target_dir)
    print target_dir
    shutil.move (image_file, target_dir)


def Main(args):
    if (len (args) < 1):
        sys.exit("not enough parameters")
    dir_in = args[1]
    if (len (args) < 3):
        dir_out = dir_in
    else:
        dir_out = args[2]

    for root, dirs, files in os.walk (dir_in):
        for f in files:
	    print f
            filename = os.path.join (root, f)
            if mimetypes.guess_type(filename)[0] == 'image/jpeg':
                move_smartly (filename, dir_in, dir_out)

start=Main(sys.argv)

print sum(getsize(join(root, name)) for name in files)
2851 views » Send feedback »

Escrito el 05/15/11 11:19:38 am por jci

Pretty much like Nutella and Chocolate, but with less fat

Categories: Web Link Blog, GNOME, GNU/Linux, Beer, Fotografia, Hacks

Para la gente que no me conozca, tengo varios hobbies que he conservado a lo largo del tiempo. Aparte del PS3, es la fotografia.

Nublado en la plataforma en Paranal

Bueh, y como desde hace un tiempo estoy trabajando en un lugar que tecnicamente se pueden ver las estrellas durante la noche. El gran problema de ciudades como Santiago es que la contaminacion luminica no permite ver las estrellas. Algo similar a "los arboles no dejan ver el bosque".

Entonces pense que seria interesante hacer un stop motion de las estrellas moviendose. Asi que a mirar no solamente el manual de la camara, sino tambien que clase de desechos podria tener en casa que pudieran ayudarme.

IMG_0928

Gphoto

Libgphoto2 es una biblioteca de manejo de camaras digitales. Pero, lamentablemente, tiene un soporte medio fulero para algunas camaras. Y lamentablemente, tengo una camara que no soporta a libgphoto2...

"Canon and some Nikon cameras only: capturetarget - setting this to sdram will make the camera capture directly into the camera RAM and not on the memory card. You need to download the image in the same gphoto2 call..."

Bueh, puedo vivir con eso. Incluso, la comunicacion con la camara me permite hacer video!

jci@arthur:~$ gphoto2 --list-config
/main/actions/uilock                                                           
/main/actions/syncdatetime
/main/actions/autofocusdrive
/main/actions/manualfocusdrive
/main/actions/eoszoom
/main/actions/eoszoomposition
/main/actions/eosviewfinder
/main/actions/eosremoterelease
/main/settings/datetime
/main/settings/reviewtime
/main/settings/output
/main/settings/evfmode
/main/settings/ownername
/main/settings/artist
/main/settings/copyright
/main/settings/capturetarget
/main/settings/capture
/main/status/model
/main/status/ptpversion
/main/status/batterylevel
/main/status/lensname
/main/status/serialnumber
/main/status/shuttercounter
/main/status/availableshots
/main/imgsettings/imageformat
/main/imgsettings/imageformatsd
/main/imgsettings/iso
/main/imgsettings/whitebalance
/main/imgsettings/whitebalanceadjusta
/main/imgsettings/whitebalanceadjustb
/main/imgsettings/whitebalancexa
/main/imgsettings/whitebalancexb
/main/imgsettings/colorspace
/main/capturesettings/autoexposuremode
/main/capturesettings/drivemode
/main/capturesettings/picturestyle
/main/capturesettings/aperture
/main/capturesettings/shutterspeed
/main/capturesettings/meteringmode
/main/capturesettings/bracketmode
/main/capturesettings/aeb
/main/other/d402
/main/other/d407
/main/other/d406
/main/other/d303
/main/other/5001
jci@arthur:~$ 

Todas las anteriores son las opciones que puedo modificar : autoexposure, drive mode...pero no le puedo decir donde almacenar las fotos. Ok, como dije, puedo vivir con eso.

Asi que solamente dejar seteada la camara y hacer :

jci@arthur:~$ gphoto2 -I 60 -F 120 --capture-image-and-download

El veintiunico problema es que debe estar conectado a una maquina con USB. Lo otro es que, algunas veces, no tener actividad en la maquina termina activando los modos de ahorro de energia que a veces involucran desconectar el subsistema de USB.

Pollona FTW!
Like cooking this

Teniendo todas las imagenes, luego montar usando mencoder. Aqui esta la parte truculenta. Entre comillas, por que es la mas simple...

Encode all *.jpg files in the current directory:
mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4

// mencoder man page

La otra opcion, por cierto, es ir META. O sea, conseguir un disparador remoto. Programable, ojala.

Aqui es donde aparece este juguetito. Una baratela en Amazon :-)

IMG_1068

Con este juguetito se puede programar el delay inicial, la cantidad de tiempo de exposicion (dejando el sensor abierto), el intervalo entre capturas y la cantidad de tomas a sacar.

Es como tener

jci@arthur:~$ sleep 5s; gphoto2 -I 60 -F 120 --capture-image-and-download

pero en version fisica :-)

Ah, ademas estoy intentando comprender como funcionan las curvas de color automaticas/manuales de las camaras.

Algo que GIMP ayuda bastante para lograr algo como esto...

Clouds over the mountains

Como queda? Este es un resultado de un experimento, claro que fue hecho _manualmente_

O mejor aun...

1887 views » Send feedback »

Escrito el 04/09/11 09:26:52 am por jci

To the hammer, all problems look like bent nails

Categories: Web Link Blog, GNOME, GNU/Linux, Hacks
ERROR 1251: Client does not support authentication protocol requested by server; 
consider upgrading MySQL client

Debido a "ciertos problemas con mis maquinas" (lease : viejas instalaciones), no he podido sincronizar bien las versiones de MySQL. Asi que tengo dos maquinas, una con MySQL Client 3 y el server, MySQL 4.1

Y no se hablan.

Hasta que...

jci@eatatjoes:$ mysql -u root -p -h XX.XX.X.XXX
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 181 to server version: 5.0.75-0ubuntu10.3

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> update mysql.user set password=old_password('shiaaaaaa') where 
host='xx.xxx.xx.xxx' and user='user'; 

mysql> flush privileges

1208 views » Send feedback »

Escrito el 04/08/11 11:14:31 am por jci

This should *NOT* be the best time to write about it

Categories: Web Link Blog

Tzdata. Oh, tzdata.
En Chile te odiamos con toda nuestra alma.

Gracias a la genial idea de retrasar el horario de Invierno, es que varios sysadmins (yo no lo he sufrido, grande UTC :D ) han sentido a traves de la fuerza como miles de incautas almas lloran cuando los relojes saltan una hora hacia atras (o adelante, depende de donde esten) de forma automagica mal intencionada.

Todo el cacho se lo debemos, al menos en Linux, a la genial configuracion de tzdata. Se que al menos cualquier distro que se precie de ser, debe tener zdump instalado:

jci@jaggermeister:~$ zdump  -v America/Santiago | grep 201[01]
America/Santiago  Sun Apr  4 02:59:59 2010 UTC = Sat Apr  3 23:59:59 2010 CLST isdst=1 gmtoff=-10800
America/Santiago  Sun Apr  4 03:00:00 2010 UTC = Sat Apr  3 23:00:00 2010 CLT isdst=0 gmtoff=-14400
America/Santiago  Sun Oct 10 03:59:59 2010 UTC = Sat Oct  9 23:59:59 2010 CLT isdst=0 gmtoff=-14400
America/Santiago  Sun Oct 10 04:00:00 2010 UTC = Sun Oct 10 01:00:00 2010 CLST isdst=1 gmtoff=-10800
America/Santiago  Sun May  8 02:59:59 2011 UTC = Sat May  7 23:59:59 2011 CLST isdst=1 gmtoff=-10800
America/Santiago  Sun May  8 03:00:00 2011 UTC = Sat May  7 23:00:00 2011 CLT isdst=0 gmtoff=-14400
America/Santiago  Sun Aug 21 03:59:59 2011 UTC = Sat Aug 20 23:59:59 2011 CLT isdst=0 gmtoff=-14400
America/Santiago  Sun Aug 21 04:00:00 2011 UTC = Sun Aug 21 01:00:00 2011 CLST isdst=1 gmtoff=-10800

Nota : tambien funciona con Chile/Continental.

Para los machos que quieran hacer esto "a la mala", simplemente bajense un timezone file (por aqui hay un par) y apliquense zic.

301 views » Send feedback »

Escrito el 11:05:12 am por jci

:: Next >>

Acerca de este glob

On the Sixth Day, there was a Running Man looking for a Predator to stop a Raw Deal with a Commando. Only True Lies were said. But nao, Junior is about to get Twins, with the help of a Kindergarden Cop. That will be the Terminator of all struggles.

Archives