Report inadequate content
Expand

Pasar enlaces Youtube a un punto de tiempo específico

Muchas veces pasamos enlaces de Youtube donde la parte interesante no llega hasta cierto punto. Puedes pasar a tus colegas el enlace para que salte directamente a un minuto y segundo que tu quieras.

Si por ejemplo quieres que un video empieze en el minuto 1 y el segundo 2 tan sólo tienes que añadir al final:

#t=1m02s

Delante de la m los minutos y delante de la s los segundos. Así de fácil. Por ejemplo:

http://www.youtube.com/watch?v=tTJMerul33E#t=1m02s

Desde el enlace anterior saltarás directamente a la escena de la Ostra Azul de la película Loca Academia de Policía.

{
}
Expand

"Unicomp Customizer" mechanical keyboard review

Unicomp mechanical keyboardAmong all the facts that remind me that I am getting old, one of them is chatting with other fellows about the technology we were using back when we started working at our first jobs. It has been 16 years since then in my case, and I sometimes find myself talking about how it was like working with a 386 and 4mb of ram, typing lots of text in such a fantastic wordprocessor as it was Wordperfect, switching from Windows 3.1 to Windows 95 and MS Word afterwards --which was such a bad experience in many ways--. I also clearly remember working with Mac OS 8 for the first time at a desktop publishing job, or the first time I played with a Silicon Graphics Octane machine and its Irix companion.

I perfecly recall using various IBM computers back in 1994, among Olivetti's, HP and other unnamed PC clones, and this IBM machines where all about sturdiness and quality of materials. That's when I had my first contact with IBM's model M mechanical keyboards, and I have been in love with them ever since. I have always been a very fast typing guy, and I immediately appreciated the accuracy of the model M keys response. I typed much more quicker with them and they also were a joy to use, perfect for continous typist hard work. I still think there are no better keyboards in the world should you click more than 1000 keys per day.

Now, try to explain marvels about this keyboards to someone ten years younger than you, who has never seen a keyboard more sophisticated than a Logitech one. Tell them about IBM's patented buckling spring "clicky" keys, about real concurrent multi keypresses, about superb tactile feedback. Tell them about these keyboard's lack of fancy multimedia buttons or usb ports... Forget it, they probably won't get it, and of course it's not their fault, as they are also not to blame for having never used a Commodore 64 or a real typewriter.

Despite my love for the mechanical keyboards, I recon I have been using membrane Apple keyboards at home during the last few years, and dull Dell keyboards at all my different works. But this has changed now, at least at my work's cubicle, thanks to the Unicom Customizer keyboard I bought a few days ago.

This keyboard is the real thing

It turns out that this little Unicomp company bought IBM's model M keyboard patents from Lexmark, which in turn bought them from IBM a few years ago, so the keyboards built by Unicomp are the real thing. And it is so true, this Customizer black keyboard has been built with the same technology and equipment the original keyboards were built with, and it shows: super sturdy, noise-clicky, mechanical keyboard heaven. At $69 (plus overseas delivery in my case) it is no cheap, but this keyboard cannot be considered expensive neither, given its construction quality and the fact that it will easily serve me for more than 10 years.

A keyboard is the main tool of my livelihood and one of the main tools of most of my hobbies. It makes sense to try to get the best tool for the job. The three most important parts of a computer in my opinion are the keyboard, mouse, and monitor. CPU? RAM? Hard disk space? I'll take whatever you give me. But the things I interact with on a constant basis, I want those things to be comfortable.

Experiencing a superb mechanical keyboard

The Unicomp Customizer black keyboard comes along also with a Wow factor, which may be a plus for some. I can tell you this old fashion keyboard has grabbed the attention of literally everyone that has come by my place, always in a positive way. When my setup of dual screens full of Vim sessions and the customizer get combined, the result is a powerful hackish, super productive image, it always seems I am working hard, which of course may not be the case, but anyway.

The keys have a lot of weight to them compared to the bland feel of modern keyboards (which usually use some rubber or plastic dome under the keys). The Customizer's keys have little springs in them, and you can feel the keys pushing back on your fingers as you type. You will clearly feel the difference with any other keyboard you've used before. The weight might lead to fatigue though; the keys are harder to press than other keyboards and my hands feel like they're getting a workout in comparison. That's not been my experience so far, so the worry may be unfounded.

The version of the keyboard I got has a modern Super ("windows") modifier key, but you can get a version without even that, if you like. I also ordered command and options keys as an option, should I use the keyboard attached to a mac computer in the future. You have to specify you want this extra keys by filling a comment text field during purchase, though, so remember it if you pretend to do so. The extra cost for this five keys is $10.

Very important to me, as a Vimmer, is the position and size of the Escape key. On the Customizer, Escape is positioned off by itself in the corner as it should be, with a ton of space between itself and the number row, and the Escape key itself is freaking enormous. This is a huge plus in my book. You can't miss Escape on this keyboard. Similarly, all the other keys are the right sizes and in the right places.

Veredict

So how is the Unicomp Customizer? It's solid, standard, unique, and has a nice retro, minimalist style that I personally enjoy. It's also huge, loud, and relatively expensive. Is it worth buying? If you have the money to spend, I think it is. I don't regret the buy at all. When I go to work and start typing on this stunning old school keyboard, I'm always pleasantly surprised.

 

Sources and related links

Expand

Reset iTerm preferences to default

If you have messed up your iTerm application preferences you can aways return to the factory settings by deleting your iTerm preferences file. Just delete the following file:

rm ~/Library/Preferences/net.sourceforge.iTerm.plist

This will delete your profiles, very useful when you have remapped keys and you can't remember how to go back.

Expand

Restore broken hard disk creating an image with Ubuntu

If your boot partition has been damaged and you cannot boot Ubuntu you still might be able to recover your hard disk and save your data by making an image. All you need is the Ubuntu LiveCD and Partimage, an excellent tool for making backups, or the SystemRescueCD.

Here you'll find a detailed explanation on how to use partimage as well:
http://www.psychocats.net/ubuntu/partimage

{
}
Expand

Instalar Memcache en Mac

Instalar el demonio de memcached en Mac no es tan complicado como parece siguiendo estos sencillos pasos.

Primero de todo asegúrate que tienes todos los requisitos

Requisitos para instalar Memcached

  • Un compilador GCC. No te asustes! Viene instalando las XTools de Mac si es que ya no las tienes
  • Descargarte el script de instalación desde topfunky

Instalación del servidor Memcached

Abre una terminal i navega hasta la ruta donde te has descargado el script. Dale permisos de ejecución y ejecútalo. Así:

chmod +x install-memcached.sh
sudo ./install-memcached.sh
echo "export EVENT_NOKQUEUE=1" >> ~/.bash_profile 

La última linea añade al inicio de tu shell la variable de entorno que requiere Memcache. Si durante la compilación ves que algo falla es que el compilador no está bien instalado. Asegúrate de bajarlo e instalarlo correctamente.

Si has instalado correctamente el servidor podrás ver la licencia o el manual de ayuda

memcached -i
memcached -h

Ahora, para arrancar memcached en mac con 100MB de memoria en el puerto 11211 como demonio haz:

memcached -m 100 -p 11211 -d

Puedes conectarte ahora y ver si está funcionando:

telnet 127.0.0.1 11211
	Trying 127.0.0.1...
	Connected to artomb.local.
	Escape character is '^]'.
	stats
	STAT pid 97257
	STAT uptime 10
	STAT time 1266004819
	STAT version 1.1.12
	STAT rusage_user 0.004421
	STAT rusage_system 0.005540
	STAT curr_items 0
	STAT total_items 0
	STAT bytes 0
	STAT curr_connections 1
	STAT total_connections 2
	STAT connection_structures 2
	STAT cmd_get 0
	STAT cmd_set 0
	STAT get_hits 0
	STAT get_misses 0
	STAT bytes_read 7
	STAT bytes_written 0
	STAT limit_maxbytes 104857600
	END
	quit
Connection closed by foreign host.

Para pararlo, tampoco sin misterios, un kill y arreando:

killall memcached

Instalar Memcache para PHP en Mac y scripts MAMP

Si quieres además integrar todo esto en MAMP para que se inicie al arrancar y instalar las librerías PHP hay un tutorial inglés muy bueno en Lullabot

Expand

TortoiseSVN for Ubuntu Linux: The real alternative

RabbitVCS logoI have posted several articles regarding subversion in this blog. If you ask me one thing I like in Windows, then I only have one answer: Tortoise SVN client. This small application is the only thing I love in Windows, for anything else, I'd rather user Mac or Linux.

But now, there is a Linux alternative to Tortoise SVN called RabbitVCS. I've tried it and it works pretty well. This project, formerly NautilusSVN, looks really well and is inspired in the windows tool. By now, it offers a good support for SVN but the aim is to cover other Version Control Systems (VCS), like Git.

RabbitVCS is integrated smartly in the Nautilus context menu, like Tortoise does, and contains all the options you might need. Logs, updates, merge, commit, full checkout... anything... plus you can play in the terminal and create your own scripts!

If you are a developer and you work in a Linux environment, then you need this tool.

 

Rabbit VCS Log viewer

There is still a long way to walk for RabbitVCS but I am sure that in short will be a perfect replacement. We don't have to forget that TortoiseSVN offers many many advanced features (not just the common commands), but if you are a regular developer who works with a small group of developers and you don't have a lot of branches that need to merge, reintegrate and so on, this is definetelly a perfect option.

Expand

All ISO-639 language codes for MySQL

If you ever needed a mysql table with all the languages detailed in the ISO-639 language codes, here it is. I took the list from the registration authority and created the table in Mysql.

There are 21 languages that have alternative codes for bibliographic or terminology purposes. In those cases I took the bibliographic ones. The script contains the 2 and 3 letter ISO-639 language codes, as well as the English and French names of the languages.

This is a preview:

CREATE TABLE `i18n_language_codes` (
  `3letter` char(3) NOT NULL COMMENT 'ISO 639-2 Code',
  `2letter` varchar(2) default NULL COMMENT 'ISO 639-1 Code',
  `english_name` varchar(255) default NULL,
  `french_name` varchar(255) default NULL,
  PRIMARY KEY  (`3letter`),
  KEY `2letter` (`2letter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO i18n_language_codes (3letter,2letter,english_name,french_name) VALUES
('aar','aa','Afar','afar'),
...

Download Mysql languages dump (structure and data):

download the ISO-639 MySQL script from GitHub

Expand

Fill: Smarty PHP plugin to fill variables in string (sprintf brother)

Today I quickly created a plugin for Smarty to fill variables inside a string (subject) using the passed parameters as variable names. I use this specially while constructing URLs because my addresses are translated and they "subjects" are always variables. This plugin does nearly the same you could do with the sprintf modifier, but I placed this behaviour inside a function.

The "subject" defines the string containing the pattern to be filled and containing the vars to be filled, and the variables are any string surrounded by your preferred delimiter (defaults to %). Let's see an example on how it works on these small Smarty snippets:

{fill subject="Hello %user%, welcome aboard!" user=Fred}
Outputs: Hello Fred, welcome aboard

You can use variables instead of static content as well (the normal usage):

{assign var=user value='Fred'}
{assign var=subject value='http://domain.com/profile/%user%/options'}

{fill subject=$subject user=$user }
Outputs: http://domain.com/profile/Fred/options

If you don't like the delimiter used by default (%) you can declare others in the call, and you can declare as many variables as you want:

{fill subject="Welcome __user__, make yourself confortable with the __plugin__ plugin."
        user=Fred
        plugin=fill
        delimiter='__'}
Outputs: Welcome Fred, make yourself confortable with the fill plugin. 
{fill subject="http://||subdomain||.domain.com/||page||/||action||"
        subdomain='www'
        page='my-first-post'
        action='vote'
        delimiter='||'}
Outputs: http://www.domain.com/my-first-post/vote

To download this plugin see the Github link OR you can copy paste the source code in the new file:

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {fill} function plugin
 *
 * Type:     function
* Name: fill
* Input:
* - [any] (required) - string * - subject (required) - string * - delimiter (optional, defaults to '%' ) - string * Purpose: Fills the variables found in 'subject' with the paramaters passed. The variables are any word surrounded by two delimiters. * * Examples of usage: * * {fill subject="http://domain.com/profile/%username%" username='fred'} * Output: http://domain.com/profile/fred * * {fill subject="Hello %user%, welcome aboard!" user=Fred} * Outputs: Hello Fred, welcome aboard * * {fill subject="http://||subdomain||.domain.com/||page||/||action||" subdomain='www' page='my-first-post' action='vote' delimiter='||'} * Outputs: http://www.domain.com/my-first-post/vote * * @link http://www.harecoded.com/fill-smarty-php-plugin-311577 * @author Albert Lombarte * @param array * @param Smarty * @return string */ function smarty_function_fill($params, &$smarty) { if ( isset($params['delimiter']) ) { $_delimiter = $params['delimiter']; unset($params['delimiter']); } else { $_delimiter = '%'; } if ( false !== strpos($_delimiter, '$' ) ) { $smarty->trigger_error("fill: The delimiter '$' is banned in function {url}", E_USER_NOTICE); } if (!isset($params['subject']) || count($params)trigger_error("fill: The attribute 'subject' and at least one parameter is needed in function {url}", E_USER_NOTICE); } $_html_result = $params['subject']; unset( $params['subject'] ); foreach($params as $_key => $_val) { $_html_result = str_replace( $_delimiter . $_key . $_delimiter, (string)$_val, $_html_result); } if ( false !== strpos($_html_result, $_delimiter) ) { $smarty->trigger_error("fill: There are still parameters to replace, because the '$_delimiter' delimiter was found in $_html_result"); } return $_html_result; } /* vim: set expandtab: */ ?>
Expand

Teclados mediacenter para el comedor

Actualmente dispongo de un ruidoso PC de DELL con la última versión de Ubuntu que utilizo a modo de media center en el comedor de casa. Estoy contentísimo de como funciona, pero para manejarlo tengo uno de los teclados más grandes de la historia (uno de esos que tienen botones hasta para tirar de la cadena del baño remotamente) junto con otro ratón que me desespera al uso.

El teclado no lo puedo perder porque es grandioso, pero el ratón lo pierdo casi a diario (además que funciona realmente mal), asi que harto de la situación me dispongo a buscar una teclado con ratón/trackpad integrado para el comedor (también debería cambiar el PC por un Mac Mini, menos bulto y más majo, pero eso ya es otro tema).

El mercado de teclados aptos para mediacenter no es muy amplio, cosas a valorar:

  • Que tenga un trackpad o similar
  • Que sea pequeño o muy pequeño
  • Que sea wireless y tenga un buen alcance
  • Que se pueda cerrar para que no le entre el polvo

Esto es lo que he encontrado, la cosa no es que esté para tirar cohetes...:

Logitech diNovo Mini

diNovo MiniEste teclado bluetooth tiene una duración de 30 días por carga de pilas, pero son recargables y se pueden tener cargadas en unas 4 horas. El alcance es de máximo 10 metros (más que suficiente en un comedor). Dispone de retroiluminación por lo que es práctico durante una sesión de cine donde todo está oscuro. El ClickPad puede usarse para mover el ratón o para desplazarse por los menús. Algunos usuarios han dicho que es compatible también con Mac pese que la web dice que es compatible con Windows y con PS3 solamente.

Este sin lugar a dudad es el que más me gusta de todos los teclados, ojo al precio...

Precio: 160 EUR

Ver el teclado en la web de Logitech

Logitech diNovo Edge

diNovo EdgeSi el anterior era caro, este le supera. Es mucho mayor que el anterior, pero quizá sea interesante para quien quiera un teclado de trabajo

Precio: 180 EUR

Ver el teclado en la web de Logitech

Keysonic Wireless Blueetooth

Keysonic Wireless Bluetooth KeyboardEste teclado bluetooth de membrana viene con un trackpad clásico y dos botones. Hay otro modelo similar en color plata. Mide unos 30cms de ancho y parece bastante interesante, pero no he encontrado ninguno con teclado español..

Precio: Al cambio unos 40€ aprox.

Teclado inglés en Amazon

Adesso Wireless keyboard

AdessoSimilar al anterior, tampoco lo he visto disponible con teclado español. Dimensiones más o menos contenidas, sin mucho más que destacar.

Precio: 110 USD

Web del producto

USB 2.4GHz RF Entertainment Slim Keyboard with Smart TouchPad

Slim Keyboard con Smart TouchPadEl touchpad puede ser utilizado también como teclado numérico, pero este es un teclado normal en tamaño, de unos 42cm de ancho. Excesivo si se quiere algo reducido, tampoco lo he visto disponible con teclado español. Otras funciones interesantes son que se puede utilizar el trackpad como en los Macs, para ampliar imágenes reducir, etc... con diferentes movimientos de los dedos.

Precio: 69 USD

Tienda con el producto

Apple Wireless keyboard

Apple WirelessPese a que es de Apple (para usar con un mac mini) Este teclado bluetooth es para mi el que esteticamente más me gusta. Pero por ahora seguiré con mi Ubuntu y además se necesita un ratón adicional, por lo que queda descartado de mi lista también.

Precio: 79€

Teclado de Apple

Y tu... ¿Sabes de algún otro que pueda ir bien?

Expand

Evitar que se abra iTunes al conectar el iPhone o Ipod

Esto es una chorrada, pero si sincronizas tu dispositivo con más de un ordernador y te interesa que al enchufarlo no se abra el iTunes hay que seguir estos sencillos pasos (esto vale para Windows y Mac):

  1. Enchufar el iPhone (o iPod) al ordenador
  2. En el iTunes, en el menú de la derecha, hacer click en el dispositivo
  3. Quitar la marca de la casilla "Sincronizar automáticamente al conectar este iPhone"
  4. Pulsar Aplicar.

y esto es todo! La siguiente vez que lo conectes, no se abrirá iTunes.

iTunes