16 septiembre 2016

Hace tiempo que me hacía ilusión adquirir una cámara ip, así que hace unos días compré una Amcrest Pro HD 1080p. Algunas de sus principales características son:

-Resolución de imagen full hd (1080p).
-Ángulo de visión de 90º.
-Visión nocturna hasta 10 metros.
-Movimiento de la cámara horizontal y vertical.
-Compatible con ONVIF.
-Audio de dos vías.

La idea es conectarla a un NAS Synology con la aplicación Surveillance Station.

En cuanto me llegue os hago un post completo sobre esta cámara.

Si quieres consultar el precio y algunas características aquí te dejo el enlace.
Amcrest Cámara IP


30 julio 2015

Xiaomi Yi connection issue with some Androids

I have recently bought a Xiaomi Yi action camera. I think it's the best price/quality camera you can buy, but... I had some issues trying to connect to it.

I'm going to describe an easy way to get it connected:

-Delete the saved camera WiFi connection. I don't know if it's obligatory.
-Try to connect with the official app, as usual.
-If you can't connect to the camera, disable the network mobile data on your smartphone.
-Then, try to connect again. It must connect now.

I hope it can help you.

05 noviembre 2014

Android Studio en Linux 64 bits

Android Studio no tiene ningún problema para correr en versiones Linux de 64 bits, pero algunas herramientas del SDK sí. Como por ejemplo, ADB.

Para solucionar este problema, normalmente se instalan las librerías ia32. El único problema es que son enormes y ocupan mucho espacio. Y la verdad, seguramente no vas a usar ni un 10 % de esas librerías.

La solución pasa por instalar lo que verdaderamente hace falta.

En mi caso uso Debian Testing (Jessie) y lo he solucionado así:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libstdc++6:i386 zlib1g:i386

He instalado estos paquetes con sus dependencias y de momento funciona todo.

14 septiembre 2014

Buscar y borrar con un solo comando en Linux

¿Cómo buscar y borrar archivos o carpetas con un solo comando en Linux?

Por ejemplo... Vayamos a borrar los dichosos archivos Thumbs.db.

find /home/usuario -name "Thumbs.db" -exec rm {} ';'

Así de fácil.

11 septiembre 2014

Photorec easy file recovery tool

I have been testing Photorec to recover deleted files on a Linux EXT3 partition. It does extremely easy the job of recovering your deleted files! It also can recover files from windows partitions or disk images.

Photorec comes in the testdisk package. In Debian just apt-get install testdisk



Author:
       Christophe GRENIER <grenier@cgsecurity.org>
       http://www.cgsecurity.org

09 agosto 2014

Node error using bower on Debian testing

I was setting up bower in my Debian testing, to start developing with Polymer.
When i tried to install Polymer through bower i got the next error:

xxx@xxx:~/xxx$ bower init
/usr/bin/env: node: No existe el fichero o el directorio

The reason is that bower does search for node at /usr/bin/node, but this binary doesn't exist. Instead, /usr/bin/nodejs does exist.

So, the only thing we have to do is a symbolic link:

sudo ln -s /usr/bin/nodejs /usr/bin/node

And we are done! :)

06 julio 2014

Android image drawables - Resize bash linux script

I wrote a bash script to resize image drawables for your apps on android.
It requires the imagemagick package.

The usage is very simple:
./image_resizer <filename> <MDPI size>
./image_resizer.sh filename.png 48

At the moment, you can't provide the filename like /path/to/filename.png.
Instead, you have to copy the image or images, in the script's path.
Also you have to use an image at once. For now, you can't resize two or more images at the same time. Example: *.png it's not supported.

You are free to improve this script, but please, send me a copy to mito150 at gmail.com

#!/bin/bash
#
# Author: Mateu S. <mito150 at gmail.com>
# USAGE: ./image_resizer.sh <filename> <MDPI size> 
#
# TIP: 1 px = 1 dip on MDPI
#
# Example: ./image_resizer.sh  icon.png  48
#

# Path for generated images
RUTA=Drawable-Resized/res

# Detect the extension of the file
EXT=${1##*.}
FILENAME=${1%.*}

# Making Dirs
#mkdir -p $RUTA/drawable-ldpi
mkdir -p $RUTA/drawable-mdpi
mkdir -p $RUTA/drawable-hdpi
mkdir -p $RUTA/drawable-xhdpi
mkdir -p $RUTA/drawable-xxhdpi

# Calculate size for each density
# TIP: LDPI=0.75x, MDPI=1x, HDPI=1.5x, XHDPI=2x, XXHDPI=3x
#SIZE1="$(echo "$2 * 0.75" | bc)"
SIZE2=$2
SIZE3="$(echo "$2 * 1.5" | bc)"
SIZE4="$(echo "$2 * 2" | bc)"
SIZE5="$(echo "$2 * 3" | bc)"

# Scaling images
# TIP: -adaptive-resize is more accurate with details ; -resize less accurate
#convert "$1" -resize $SIZE1 "$RUTA/drawable-ldpi/$FILENAME.$EXT"
convert "$1" -resize $SIZE2 "$RUTA/drawable-mdpi/$FILENAME.$EXT"
convert "$1" -resize $SIZE3 "$RUTA/drawable-hdpi/$FILENAME.$EXT"
convert "$1" -resize $SIZE4 "$RUTA/drawable-xhdpi/$FILENAME.$EXT"
convert "$1" -resize $SIZE5 "$RUTA/drawable-xxhdpi/$FILENAME.$EXT"

16 junio 2014

Aprender a programar en C



Hola! Hoy os quería enseñar el libro con el que aprendí a programar en ANSI C. El título es "C Guía de autoenseñanza" escrito por Herbert Schildt.

Es un libro que empieza desde cero, apropiado para cualquier persona, con conocimientos de programación previos o no. Aunque creo que para primer lenguaje de programación hay otros más aconsejables y sencillos. Este libro trata sobre el lenguaje de programación C estándar o ANSI.



Los temas que se tratan en el libro son:
    • Los fundamentos de C.
    • Sentencias de control de programa.
    • Más sentencias de control.
    • Tipos de datos, variables y expresiones.
    • Arrays y cadenas.
    • Punteros.
    • Funciones.
    • E/S por consola.
    • E/S por archivos.
    • Estructuras y uniones.
    • Tipos de datos y operadores avanzados.
    • Preprocesador de C.
    • Funciones de la biblioteca de C.
    • Visión general de la programación en Windows.

El libro está basado en programación en un SO Unix o derivado (Linux), pero también trata al final algunos aspectos para hacerlo en Windows.

En mi opinión es un libro que vale la pena. A mí personalmente me gustó mucho y opino que es un gran libro para aprender a programar en el lenguaje de programación C. Lo malo es que creo que ya está descatalogado :(

26 mayo 2014

Linux y Windows GPT partition

El otro día me encontré con un problema al querer instalar Windows + Linux en un mismo portátil. El portátil venía con Windows 8 preinstalado, pero mi amigo quería Windows 7 y Ubuntu Linux.

Instalé Windows 7 y todo lo relacionado para dejarlo funcionando correctamente. A la hora de instalar Ubuntu, en la parte de particionar el disco duro, me salía como si estuviera vacío, sin ninguna partición. Sospechoso!

Me informé un poco y parece ser que el problema está relacionado con la tabla GPT y no se si por algún bug de alguna librería como libparted.

La solución fue "limpiar" la tabla GPT con un maravilloso programa llamado FixParts.

En la web del programa podemos encontrar un tutorial muy sencillo de seguir, con las instrucciones paso a paso.

Gracias Rod Smith!

Grabar imagen iso a un pendrive desde Linux

Para grabar una imagen iso a un pendrive o disco duro usb desde Linux es muy fácil. Usaremos el comando dd.

Primero de todo debemos tener bien claro cuál es el dispositivo que representa a nuestro pendrive o disco duro usb. Para ello al conectar dicho dispositivo por usb, ejecutaremos el comando dmesg. Debemos obtener una salida similar a ésta:

[ 3945.876038] usb 5-1: new high-speed USB device number 4 using ehci-pci
[ 3946.015789] usb 5-1: New USB device found, idVendor=0718, idProduct=0618
[ 3946.015795] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3946.015798] usb 5-1: Product: Trans-It Drive
[ 3946.015801] usb 5-1: Manufacturer: TDKMedia
[ 3946.015804] usb 5-1: SerialNumber: 07B60103F92D2A82
[ 3946.113010] usb-storage 5-1:1.0: USB Mass Storage device detected
[ 3946.113081] scsi4 : usb-storage 5-1:1.0
[ 3946.113159] usbcore: registered new interface driver usb-storage
[ 3947.294826] scsi 4:0:0:0: Direct-Access     TDKMedia Trans-It Drive   PMAP PQ: 0 ANSI: 0 CCS
[ 3947.780554] sd 4:0:0:0: [sdb] 7810176 512-byte logical blocks: (3.99 GB/3.72 GiB)
[ 3947.781166] sd 4:0:0:0: [sdb] Write Protect is off
[ 3947.781170] sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 3947.781789] sd 4:0:0:0: [sdb] No Caching mode page found
[ 3947.781793] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 3947.785915] sd 4:0:0:0: [sdb] No Caching mode page found
[ 3947.785919] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 3947.817319]  sdb: sdb1 sdb2
[ 3947.822545] sd 4:0:0:0: [sdb] No Caching mode page found
[ 3947.822550] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 3947.822555] sd 4:0:0:0: [sdb] Attached SCSI removable disk

Como podemos ver, nos dice que nuestro dispositivo es accesible desde /dev/sdb

Ahora que ya tenemos la ruta de nuestro dispositivo y la imagen iso ya la podemos "grabar", creo que sería mejor decir, volcar la imagen al dispositivo usb.

El siguiente comando debe ser ejecutado con permisos de root:

sudo dd if=/ruta/al/archivo.iso of=/dev/sdb

Y esperaremos a que finalice el proceso :) Puede tardar unos minutos. Así que tranquilos.

*** Warning: El contenido de /dev/sdb quedará completamente eliminado. Así que asegúrate de haber puesto el dispositivo correcto.

18 marzo 2014

05 diciembre 2013

Linux Android emulator and KVM Opengl problems

If you want to try to accelerate the Linux Android emulator through KVM, and you see errors like these...
Failed to load libOpenglRender.so
Failed to load libEGL_translator.so
error libEGL_translator.so: cannot open shared object file: No such file or directory
Failed to open libEGL_translator.so
Failed to init_egl_dispatch
emulator: ERROR: OpenGLES initialization failed!
emulator: ERROR: OpenGLES emulation library could not be initialized!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Failed to load libGLES_CM_translator.so
error libGLES_CM_translator.so: cannot open shared object file: No such file or directory
Failed to init_gl_dispatch
Failed to load libGLES_V2_translator.so
error libGLES_V2_translator.so: cannot open shared object file: No such file or directory
Failed to load libGLES_V2_translator.so
error libGLES_V2_translator.so: cannot open shared object file: No such file or directory
could not find ifaces for GLES 2.0
 In my case, i use Debian Testing and Android Studio. These files are located in Android Studio SDK folder: ~/android-studio/sdk/tools/lib/

To solve that errors, i simply created a symbolic link to /usr/lib/
sudo ln -s ~/android-studio/sdk/tools/lib/libOpenglRender.so /usr/lib/
sudo ln -s ~/android-studio/sdk/tools/lib/libEGL_translator.so /usr/lib/
sudo ln -s ~/android-studio/sdk/tools/lib/libGLES_CM_translator.so /usr/lib/
sudo ln -s ~/android-studio/sdk/tools/lib/libGLES_V2_translator.so /usr/lib/

And that's all! :)

14 septiembre 2013

Expression Studio - test regexp regular expressions

Expression Studio is a tool that allows us to write and test regular expressions online. Supports regular expressions from a lot of different languages.

http://expstudio.pl/

I think it's a very useful tool!

10 septiembre 2013

Parole Media Player xfce4 autoaudiosink

I installed Parole as my Media Player for my Debian Linux. But there was an error launching it.

...
autoaudiosink load failed
...

The way i fixed it was installing the package gstreamer0.10-plugins-good.

Now it launches succesfully! :)

Android SDK Emulator libGL.so problem

Recently i installed and configured my new Linux setup. A Debian Testing with XFCE4 as desktop. Well, i'm not going to talk about this now.

After installing Android Studio and running an emulated device, i saw the error: "... libGL.so not found ...". Then, i did a search for that lib. I found this in /usr/lib/i386-linux-gnu/ and created a symbolic link to point the not found lib libGL.so to the real file libGL.so.1.2.0.

I don't know if it really fix it, but at least the error doesn't appear now.

Symbolic link creation: sudo ln -s /usr/lib/i386-linux-gnu/libGL.so.1.2.0 /usr/lib/i386-linux-gnu/libGL.so

04 septiembre 2013

Tails Incognito Linux Live System

Tails is a Debian and Tor based Linux Live system. The major goal of Tails distro is to preserve your privacy and anonymity over internet. All connections runs under Tor network.

Tails is an amnesic and incognito system. It's bundled with software preconfigured for security and anonymity.

More info at Tails Linux.

26 agosto 2013

Linux Mint Debian, Google Chrome, libnss

Linux Mint Debian runs under Debian Testing, but the updates come in a form of compilation packages from Linux Mint. Not directly from Debian Testing.

With the latest update of Google Chrome beta on Linux, i was unable to launch the browser. I had to run it from terminal to see what was happening.

The problem was the library libnss, it was too old for the new version of Google Chrome browser. So i decided to add the Debian Testing repository to apt. And then update and upgrade the system.

Add "deb http://ftp.debian.org/debian testing main contrib non-free" to the file /etc/apt/sources.list
Exec apt-get update and finally apt-get upgrade.
A reboot is recommended.

At the moment i don't have any problem, as it is a modded Debian Testing.