Installing Circos on OSX 10.8

Circos is a software package for visualizing data and information. It visualizes data in a circular layout — this makes Circos ideal for exploring relationships between objects or positions. There are other reasons why a circular layout is advantageous, not the least being the fact that it is attractive.

Circos is ideal for creating publication-quality infographics and illustrations with a high data-to-ink ratio, richly layered data and pleasant symmetries. You have fine control each element in the figure to tailor its focus points and detail to your audience.

The installation in OSX is some tricky, and well, after search and try a ton of options, this small recipe appear to works perfect. I assume you have installed brew and Command line tools from Xcode.

$ cd circos-0.64/
$ cd bin
$ vi circos
  --> change path to OSX "env" location (/usr/bin/env)
$ vi gddiag 
  --> change path to OSX "env" location (/usr/bin/env)
$ sudo perl -MCPAN -e shell
cpan> install Config::General
cpan> install Font::TTF::Font
cpan> install Math::VecStat
cpan> install Readonly
cpan> install Text::Format 
cpan> install Math::Bezier
cpan> install Set::IntSpan
$ brew install libpng
$ brew install freetype
$ brew install gd --with-freetype
$ cd $HOME/Downloads
$ curl -O
$ tar zxvf GD-2.49.tar.gz && cd GD-2.49
perl Makefile.PL 
sudo make install
cd ../circos-0.64/bin
circos-0.64/bin$ ./circos --conf ../example/etc/circos.conf


Thanks to Oracle, we need the latest version of Java SE -EVER- and next: pray.

After the recent news about the greatest security of Java, have the latest version of the runtime is imperative for me (and maybe for many others). The problem is that until we are notified of the update (automatic like in OSX), we may already be victims of some new “feature” as @jaimeblascob said:
To help, I prepared one small OSX widget that show the latest versions published on its website. Is a very simple app, I hope you find it useful.
MD5 (Java SE last = 9199736603bc094d676f41a78156245c


Incidentally, I used a service to build a RSS, a great contribution of Aaron Swartz to the world. 


Update 1: This is the feed that I prepared as a data source, use it freely!

TPP syntax colouring in TextWrangler and BBEdit

Some weeks ago, I discovered TPP, a Terminal Presentation Program. My favourite text editor is TextWrangler (under OSX) and well, the included vim syntaxt file is not enought.
This small hack fix my problem: add TPP highlighting syntax support to TextWrangler. To install, download the file and copy to:
~/Library/Application Support/TextWrangler/Language Modules/
and relaunch TextWrangler.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
        TextWrangler codeless language module for TPP files.
        To install, copy here:
                ~/Library/Application Support/TextWrangler/Language Modules/
        and relaunch TextWrangler.
	<key>Language Features</key>
		<key>Close horline</key>
		<key>Close bond</key>
		<key>Close list</key>
		<key>Close output</key>
		<key>end shell</key>
		<key>Identifier and Keyword Characters</key>
		<key>Begin horline</key>
		<key>Begin bond</key>
		<key>Open list</key>
		<key>Begin output</key>
		<key>begin shell</key>
		<key>Comment Pattern</key>
			(?&gt;	\(	                                    )	|
			(?&gt;	\-	                                    )	|
			(?&gt;	\)                                      )	|
			(?&gt;	\[	                                    )	|
			(?&gt;	\]	                                    )	|
			(?&gt;	\{	                                    )	|
			(?&gt;	\}	                                    )	|
			(?&gt;	\http	                                )	|
			(?&gt;	\:	                                    )	|
			(?&gt;	\@	                                    )	|
			(?&gt;	-&gt;	                                )	|
			(?&gt;	\#		.*			$				    )   |
			(?&gt;	\-\-\-		.*			$				)   |
			(?&gt;	\#\#	(?s:.*?)	(?: \#\# | \z ))
		<key>Open Line Comments</key>
And you can check also inside of my cloned git repo (original can be found here):

Terminal Presentation Program (TPP) ó presentaciones desde la terminal

Como extraño esos tiempos de LyX, TeX, magicpoint para hacer presentaciones. Esos días, cuando lo importante era lo que contabas y no la herramienta que usabas, cuando una presentación era sólo texto y en el peor de los casos, una que otra imagen, nada mas. Hoy, y aprendido desde Powerpoint (y cosas como prezi), necesitamos mas poder de cómputo para exponer un par de ideas en algo que se volvió indispensable en una charla: las diapositivas o slides*.

Recuerdo que al leer Slide:ology de Nancy Duarte, sugerencias como “hacer menos es hacer mas” y “los slides son una vía de apoyo, nada más” traían a mi varias lecciones aprendidas tras varios años de hacer presentaciones apoyándome en herramientas propias para este fin, mapas mentales y últimamente html5 (que por cierto, es mi favorita).

Hoy quiero hablar de otra herramienta que he comenzado a usar, una que me gusta porque la terminal es el gran protagonista, Terminal Presentation Program: tpp. Usa ncurses, está escrita en ruby1.8 y es fácilmente extendible, además de que las presentaciones son simples archivos de texto que se pueden escribir en el editor favorito y con una sintaxis minimalista.

La instalación en OSX es muy simple, los pre-requisitos:
  1. Tener ruby instalado.
  2. Tener XCode instalado.
  3. Instalar ncurses-ruby. El camino sugerido es descargar el código fuente, compilar e instalar en las ubicaciones definitivas. En caso de tener problemas con el “make”, esta breve nota puede ser útil.
  4. Aunque es opcional, es recomendable instalar figlet para poder generar “banners” dentro de las presentaciones. Si tenemos macports, basta con: “port install figlet”.
Para instalar: descargar el código fuente y:
tar -zxvf tpp-1.3.1.tar.gz && cd tpp-1.3.1 && sudo make install
Un ejemplo:
Muy vintage :)
* Por cierto, en este trabajo se encuentra una recopilación de herramientas “poco comunes” para hacer presentaciones.
* Y por último, un videotutorial sobre su uso.



error building ncurses-ruby over OSX

Trying to compile ncurses-ruby 1.3.1 over OSX, this error:
ncurses_wrap.c: In function 'rbncurshelper_nonblocking_wgetch':
ncurses_wrap.c:818: error: dereferencing pointer to incomplete type
ncurses_wrap.c:835: error: dereferencing pointer to incomplete type
ncurses_wrap.c:854: error: dereferencing pointer to incomplete type
ncurses_wrap.c: In function 'rbncurshelper_nonblocking_wgetch':
ncurses_wrap.c:818: error: dereferencing pointer to incomplete type
ncurses_wrap.c:835: error: dereferencing pointer to incomplete type
ncurses_wrap.c:854: error: dereferencing pointer to incomplete type
lipo: can't open input file: /var/tmp//ccYm3was.out (No such file or directory)
make: *** [ncurses_wrap.o] Error 1
Looks like the pre-processor definition NCURSES_OPAQUE has some problem. To solve, we can preset a value and try to compile:
sudo cflags=-DNCURSES_OPAQUE=0 make
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o ncurses_bin.bundle form_wrap.o menu_wrap.o ncurses_wrap.o panel_wrap.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64     -lruby -lmenu -lform -lpanel -lncurses  -lpthread -ldl -lobjc
After all,
sudo make install

easy way to know if “flashback Trojan” infected your mac (osx lion)

This last days, many people spoke about the new “Flashback Trojan” in OSX 10.7 (for more info, click here).

The way to know if you are infected requires some work with the terminal (two commands). Some users “hate” the terminal or simply not know it is there, that is why I wrote a simple applescript (fast and dirty) that check in a click (to my dear friend Dario).
The resultant application (created with applescript editor) is included in this post (Check Flashback Trojan, or you can check the source code:
display dialog "Lets go to check two simple values, if the result is not equal to OK, run some antivirus or do your job with the terminal app. Also, check" with icon stop with title "Simple Flashback Trojan detect tool"

	set test1 to do shell script "defaults read /Applications/ LSEnvironment  > /tmp/nada 2>&1; cat /tmp/nada | grep -i not"
	set test1 to result

	if test1 contains "does not exist" then
		display dialog "Step 1: OK" with icon note
		do shell script "rm -f /tmp/nada"
		display dialog "Step 1: Something is wrong with Info LSEnvironment" with icon stop
	end if
end try

	set test2 to do shell script "defaults read ~/.MacOSX/environment DYLD_INSERT_LIBRARIES  > /tmp/nada2 2>&1; cat /tmp/nada2 | grep -i not"
	set test2 to result

	if test2 contains "does not exist" then
		display dialog "Step 2: OK" with icon note
		do shell script "rm -f /tmp/nada2"
		display dialog "Step 2: Something is wrong with DYLD_INSERT_LIBRARIES" with icon stop
	end if
end try

Solving “VTDecoderXPCService quit unexpectedly” in OSX 10.7

The log error is:
Process:         VTDecoderXPCService [38461]
Path:            /System/Library/PrivateFrameworks/VideoToolbox.framework/Versions/A/XPCServices/VTDecoderXPCService.xpc/Contents/MacOS/VTDecoderXPCService
Identifier:      VTDecoderXPCService
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  ??? [1]

Date/Time:       2012-03-13 16:19:35.652 -0500
OS Version:      Mac OS X 10.7.3 (11D50)
Report Version:  9
Sleep/Wake UUID: C7F9D4B3-1728-4AB6-B314-FBC9E4B06761

Crashed Thread:  3  Dispatch queue:

Exception Codes: KERN_INVALID_ADDRESS at 0x00007fda92700000

VM Regions Near 0x7fda92700000:
    MALLOC_TINY            00007fda92400000-00007fda92700000 [ 3072K] rw-/rwx SM=PRV  
    MALLOC_SMALL           00007fda92800000-00007fda93800000 [ 16.0M] rw-/rwx SM=PRV  

Application Specific Information:
objc[38461]: garbage collection is OFF
VTDecoderXPCService is the sandboxing for video content in Lion. All things that are QuickTime related, audio or video, are sandboxed by this service.
The problem is caused by a corrupt video file, in my case it was a m4v file. And because the file was on the desktop, each time I restarted, or opened a finder window that opened to the desktop folder, the error would pop up.

However, some possible solutions are (each one, not together):

  1. Delete the file from the Desktop.
  2. Move the video/audio file to one directory (obviously, create them).
  3. Change the opening default app to another compatible, like VLC.
  4. In some cases, change the file extension to another, solves the problem.
For more info: