Agras Zeta Atino

Un blog mas de tecnologia, locuras y procrastinacion

This is a post of the series: How I.
Este es un post simple en la serie “Como yo“.

The idea for now is to show JSON strings in a fashion way so that we can read complex JSON strings easier, ill show some ways, its up to you which one to use.

La idea es poder ver cadenas JSON en una forma bonita y sencilla de leer complejas cadenas JSON, de una forma realmente sencilla. Mostrare algunas formas, tu decides cual te conviene.

Python:

cat file.json | python -mjson.tool

Perl:

cat file.json | perl jsonpp.pl
#!/usr/bin/env perl

use JSON;

my $json = JSON->new;
undef $/;
while (<>) {
    print $json->pretty->encode($json->decode($_));
}
view raw jsonpp.pl This Gist brought to you by GitHub.

ps: Most of the info comes from a post at endpoint’s blog

Facebook Twitter Email

Calidad de servicio en Venezuela, un existe: Caso Librerias Nacho

Desde hace unos dias estoy buscando un libro de Giorgio Faletti, cuyo titulo es “Yo mato”.

En vista de que tecni-ciencia y librerias nacho poseen cuentas de twitter (@tecniciencia y @libreriasnacho), me decidi a tomar un momento y escribirle a ambos:

estoy buscando el libro “Yo mato” de giorgio faletti… alguna idea de si se puede conseguir?…

Las respuestas obtenidas de uno y de otro:

@tecniciencia

es una Ed. del 2005, se agoto RT @foursixnine: @tecniciencia estoy buscando el libro “Yo mato” de giorgio faletti…

Algo que puedo traducir como un “No, no tenemos y no vamos a buscar.”

@libreriasnacho

@foursixnine Oye, gran libro, una buena novela negra contemporánea debe haber edición de bolsillo en alguna tienda te averiguamos y avisamos

Algo que puedo traducir como un “No estamos seguros, pero vamos a ver… si nos acordamos de ti, te avisamos.”

Dias despues, recibo un DM via twitter:

11:31am, May 18
Hola, de verdad ha sido infructuosa la localización de “Yo mato”, le pedí a la editorial q investigara donde pueda haber alguno te aviso.

A esto le llamo yo calidad de servicio… No consiguieron el libro, no se si buscaron, pero se preocuparon por enviarme un mensaje, para hacerme saber el status de la busqueda.

Por eso y mucho mas, hasta ahora prefiero comprar en Nachos que en Tecniciencia. Seria interesante que en Nachos, hicieran unos cuantos eventos… como un intercambio de libros, una feria abierta pues. Sera que me escuchan esta vez?… :)

Saludos. Y de verdad… KUDOS! por Librerias Nacho

Facebook Twitter Email

Compilando PostgreSQL 9 Beta 1

¿Has sentido ganas de compilar PostgreSQL 9-beta-1? ¿Tienes ese impulso de pasión por descubrir que trae de nuevo?

Puedes hacerlo en X sencillos pasos:

  1. Descarga las fuentes:  http://www.postgresql.org/ftp/source/v9.0beta1/
  2. Luego de descargar, descomprimir con su herramienta favorita (tar -xvvzf o tar -xvvjf por nombrar un ejemplo)
  3. Moverse al directorio que se acaba de crear (postgresql-9.0beta1) y revisar las opciones de compilación (./configure –help)
  4. Instalar librerías necesarias,  de acuerdo con lo que se desee habilitar:

    libreadline-dev (Opcional, podrias usar –without-readline (revisar este link)
    libpam-dev (–with-pam)
    libxml2-dev (–with-xml)
    Soporte para lenguajes procedimentales o PL
    perl-dev (–with-perl)
    python-dev (–with-python)

  5. finalmente:

    ./configure –with-pgport=5433 –with-perl –with-python –with-pam –with-openssl –with-libxml –prefix=$(pwd)/../pg9

  6. make && make:
  7. Al final del make veras un mensaje similar a este: All of PostgreSQL successfully made. Ready to install
  8. Al final del make install veras otro mensaje similar: PostgreSQL installation complete.
  9. A jugar!:  PGDATA=$(pwd)/pg_data bin/initdb

Luego de todo esto, deberías tener una salida similar a esta:

foursixnine@quaoar:~/proyectos/postgresql/pg9$ PGDATA=$(pwd)/pg_data bin/initdb
The files belonging to this database system will be owned by user “foursixnine”.
This user must also own the server process.

The database cluster will be initialized with locale es_VE.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to “spanish”.

fixing permissions on existing directory /home/foursixnine/proyectos/postgresql/pg9/pg_data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 28MB
creating configuration files … ok
creating template1 database in /home/foursixnine/proyectos/postgresql/pg9/pg_data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok

WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

bin/postgres -D /home/foursixnine/proyectos/postgresql/pg9/pg_data
or
bin/pg_ctl -D /home/foursixnine/proyectos/postgresql/pg9/pg_data -l logfile start

Si todo va bien… ¡Felicitaciones, ya tienes instalado PostgreSQL en tu sistema (en mi caso, lo instale dentro de mi usuario, para no tener que estar usando sudo, o crear un script de inicio siempre…). Para verificar que esta todo bien:

foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/psql –port 5433 postgres
psql (9.0beta1)
Type “help” for help.

postgres=#
postgres=# q
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -p 5433 -d postgres plperl
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -p 5433 -d postgres plpythonu
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -l -p 5433 postgres
Procedural Languages
Name | Trusted?
———–+———-
plpgsql | yes
plperl | yes
plpythonu | no

Facebook Twitter Email
Social links powered by Ecreative Internet Marketing