Install and run Zeronet on your Raspberry Pi

The motivation: Access to Play, World’s first server-less, P2P distributed torrent site on ZeroNet.

As easy as:

Continue reading

Compile PHP 7 for Raspberry Pi (with memcached)

The PHP version that comes with Raspbian is the 5.4.45 at the time I’m writing this. Recently I’ve installed OwnCloud 8.2.2, which recommends PHP 5.6 or newer, so, I decided to compile a newer version by myself. Indeed I tried with a couple of newer versions: 5.6.18 and 7.0.3, both with php-fpm support.

After compiling, configuring and running both versions as separated php-fpm sockets, I runned this benchmark script to compare them, and these were the results:

PHP-5-6-18:

PHP-7.0.3:

It’s awesome, isn’t it? 🙂

Continue reading

Configure a DNS server with your Raspberry Pi

This is just a quick recipe so you can have a DNS server on your local network. In my case, I wanted to log every DNS query made from my network into a custom file.

This is useful if you want to know, for example as was my case, where your mobile phone is accessing to when it’s connected to your wireless network after installing an app (among other hacker/spy things that I’m not going even to mention 🙂 ).

Continue reading

Convert video from x265 to x264 codecs with Raspberry Pi

Recently I realized that the x265 codecs are not using the GPU as the x264 codecs does, at least in Linux. Then, you need a quite new CPU to smoothly reproduce these videos, which is quite annoying for people using a Raspberry Pi or a similar device as home-cinema. Like me.

Well, I downloaded a whole series encoded with this x265 codecs. And after a few minutes cursing this crazy-codecs world, I decided to take my time and learning how to transform videos from x265 to x264 format (the good and fast one). This re-encoding process takes about 2x or 3x the time of each video, which means several hours for a whole series, so I preferred to use my Raspberry Pi server to do the process during the nights.

(By the way, to see how to install ffmpeg and x265 support on Ubuntu 14.04, click here)

First, I needed the last version of ffmpeg command, with both x265 and x264 support in my Raspberry. Sadly, there is no packages for that, so I had to download, compile and install them. This is the whole process:

Continue reading

Javascript cross-domain localStorage

Utilidad para compartir el mismo espacio de localStorage entre varios dominios (o subdominios) distintos.

Si tienes varias webs, o varias formas de acceder a una web como www.miweb.com, miweb.com, wiki.miweb.com, etc.., la información almacenada por cualquiera de ellas con javaScript en el espacio de localStorage del navegador, no será accesible para el resto de dominios. Esto se puede solventar mediante el uso de un iframe oculto y la función postMessage soportada por la mayoría de navegadores.

Continue reading

Javascript tools for localStorage and cross-domain localStorage

Share the same localStorage unit between different domains (or subdomains).

If you have a few webs, or a few access ways to a web, like www.myweb.com, myweb.com, wiki.myweb.com, etc…, and you use the localStorage javaScript utility, the stored information by one of them won’t be accesible from the other ones. Nonetheless, there is a way to do it by using a hidden iframe and the window.postMessage function which is supported by the most of the browsers.

Continue reading

Communications between Python and Arduino (USB-Serial)

 
In this post we’ll implement the basic communications between the PC and Arduino for our purpose. Also we’ll use the coordinate transformation with Arduino to implement a program that receive the equatorial coordinates as input, and then returns the azimuthal equivalent as output.

For the moment we can obtain this coordinates with Stellarium. With this data we’ll implement a Python script to communicate with Arduino to establish the reference objects and then calculate the azumuthal coordinates (Az/Alt in Stellarium) from the equatorial ones for any object. It will be a kind of Arduino based “USB coprocessor” to coordinate transformation.. Although as coprocessor it will be as unuseful as curious, I think 🙂

Continue reading

Telescope control with Stellarium and Arduino

 

Initially the main reason for this blog is the publication of a personal project that I believe could be interesting for astronomy amateurs.

It consists on a first approach to control a telescope mechanism by the USB port, builded from scratch and based on Arduino microcontroller, from a computer with GNU/Linux and the Stellarium software.

By the moment, the code has been tested only in a mini-dobsonian mount with a green laser pointer. The laser points towards the celestial objects indicated from Stellarium, by using a stepper motors system.

 

Prototype, interface, Stellarium screen and laser pointer.

Continue reading

Comunicaciones con Arduino (USB-Serial)

 

En esta entrada implementaremos las comunicaciones básicas entre el PC y Arduino, que servirán de introducción para el control del dispositivo láser mencionado en este otro post. Por ir completando un poco el proyecto, aprovecharemos la implementación de la conversión de coordenadas en Arduino para diseñar un programa que reciba las coordenadas ecuatoriales y devuelva las acimutales correspondientes (equivalentes a coordenadas locales u horizontales).

 

Estas coordenadas las podemos obtener, por el momento, de forma manual con Stellarium. Con estos datos, implementaremos un script en Python que se comunicará con Arduino para establecer los objetos de referencia, y posteriormente calcular las coordenadas acimutales  (Az/Alt en Stellarium) a partir de las ecuatoriales de un objeto cualquiera. Será una especie de “co-procesador USB” para la conversión de coordenadas basado en Arduino.. aunque como co-procesador será tan inútil como curioso, creo :).

En otras publicaciones usaremos esta información para mover motores paso-a-paso y dirigir así el puntero láser hacia las coordenadas locales de los objetos celestes, en lugar de simplemente devolver los resultados al PC.

Continue reading