Native flash plugin in 64 bits, Debian package

Adobe has had an awful track record with their Flash plugin as far as 64bits support go, forcing us to use 32 bits plugins. But since some time ago they re-booted their efforts with the Flash Player "Square" project, gaining *native* 64bits support in Linux, Mac OS X and Windows, albeit in a parallel unofficial developer release.

For those of you using Debian, Ubuntu or derivatives on the amd64 platform, I'm sharing here my packaging script which will generate a DEB package that should install (and uninstall) cleanly. I won't be sharing binary packages since this is non-free stuff but it should be easy enough to create them following these instructions.

Instructions:

This should generate a package named "mozilla-flashplugin-square-nonfree_10.3.d162.p3-out.1_amd64.deb", which you can install with 'dpkg -i'.

The plugin should be loaded on the next start of Firefox/Iceweasel, Mozilla/IceApe, Google Chrome, etc.

La TDT en el futuro próximo

El despliegue de la TDT ha sido hasta ahora, cuanto menos, opaco y es difícil saber qué falta por completar y qué pasará con temas como la emisión en HD.

Por eso quiero compartir esta web que encontré hace poco y que trae bastantes detalles de interés: Televisión Digital Terrestre [http://televisiondigitalterrestre.wordpress.com].

Ejemplo: Reorganización de los canales existentes en el 2011 (aunque está sin actualizar porque ahora Telecinco tiene ocho canales, incluyendo los de Cuatro).

Reparto de múltiples en la fase 2

Fuente: La TDT en 2010 [http://televisiondigitalterrestre.wordpress.com/acerca-de/], mundoplus.tv
Imagen: josezkaos en mundoplus.tv

Site is back to normal, finally

After a whole month of mess after my shared webhosting got hacked, my sites are now back to normal, all downloads should be available again.

This has been so annoying to get fixed I'm unable to find words to describe the experience.

In the meantime I've moved some stuff into two new sites: The pictures that used to be here are now in corvera.eu and any blog posts which are not status updates / release announcements will go into w.corvera.eu.

Old code: CSS rules on the fly from JavaScript (2006)

Again, some old code I'm not using anymore since I switched to jQuery but that might be useful for someone:

/*
 * Public Domain
 * Created by Toni Corvera <outlyer@outlyer.net> in September, 2006
 *
 * Creates a new CSS ruleset, should work with multiple rules correctly
 * e.g.:
 *    loadCssRules('body{font-family:sans-serif;}a:link{color:red;}');
 */
// void function loadCssRules(String rules)
function loadCssRules(r) {
	if (!document.createElement) return;
	var newStyle=document.createElement('STYLE');
	newStyle.setAttribute('type', 'text/css');
	newStyle.appendChild(document.createTextNode(r));
	document.getElementsByTagName('HEAD')[0].appendChild(newStyle);
}

Downloadable file: http://p.outlyer.net/graveyard/net_outlyer_dyn_css.js

Old code: DOM extensions (2004-2006)

Nowadays I'm using something more powerful like jQuery or base2.DOM, but if you don't, these might prove useful.

/*
 * Copyright 2004-2006 Toni Corvera <outlyer@outlyer.net>
 *
 * License: http://www.gnu.org/copyleft/lgpl.html LGPL
 *
 * Extra DOM-like methods (Note that at the time of writing they can't be
 * bound to the Document prototype, so they are global functions)
 *
 *    getFirstChildByTagName(HTMLElement parent, String tagName)
 *       First child of parent with tag tagName, NOT-RECUSIVE
 *    getFirstSiblingByTagName(HTMLElement node, String tagName)
 *       See above
 *    getChildrenByClassName(Node parent, String className)
 *       Obtains an array with the children of parent that have
 *       the class className (supports multi-class elements), NOT-RECURSIVE
 *    getChildrenByTagName(Node parent, String tagName)
 *       Obtains an array with the children of parent that have
 *       the tag tagName, NOT-RECURSIVE
 *
 *    hasClass(HTMLElement element, String className)
 *       Checks if element has class className, supports multi-class elements
 *    removeClass(HTMLElement element, String className)
 *       Remove class className from element's classes if present, supports
 *       multi-class elements
 */
// boolean hasClass(HTMLElement e, String className)
function hasClass(e, c) {
	if (!document.getElementById) return false;
	if (!e.className) return false;
	return null!=e.className.match(new RegExp('^(w*|.* )'+c+'(w*| .*)$'));
}
// void removeClass(HTMLElement e, String className)
function removeClass(e, c) {
	if (!hasClass(e, c)) return;
	e.className = e.className.replace(new RegExp(c,'g'),'');
}
// HTMLElement getFirstChildByTagName(HTMLElement parent, String tagName)
function getFirstChildByTagName(e,tag){
	if (!document.getElementById) return null;
	var f=null;
	for (var i=0;i<e.childNodes.length;++i) {
		if (e.childNodes[i].tagName == tag) {
			f = e.childNodes[i];
			break;
		}
	}
	return f;
}
// HTMLElement getFirstSiblingByTagName(HTMLElement node, String tagName)
function getFirstSiblingByTagName(e,t) {
	if (!document.getElementById) return null;
	var f=null;
	if (null==e.nextSibling || e.nextSibling.tagName==t) return e.nextSibling;
	return getFirstSiblingByTagName(e.nextSibling,t);
}
// Array getChildrenByClassName(Node parent, String className)
function getChildrenByClassName(n,c) {
if (!document.getElementById) return null;
	var a=new Array();
	for (var i=0; i<n.childNodes.length; ++i) {
		var x=n.childNodes[i]
		if(hasClass(x,c)){a.push(x);}
		a.concat(getChildrenByClassName(x,c));
	}
	return a;
}
// Array getChildrenByTagName(Node parent, String tagName)
function getChildrenByTagName(n,t) {
	if (!document.getElementById) return null;
	var a=new Array();
	for(var i=0; i<n.childNodes.length;++i){
		var x=n.childNodes[i];
		if(x.tagName==t){a.push(x);}
		a.concat(getChildrenByTagName(x,t));
	}
}

Downloadable file: http://p.outlyer.net/graveyard/net_outlyer_dom_exts.js

Old code: JavaScript x-browser arrays (2005, 2010)

Last update: 2010-12-09

This block of code is deprecated, I'm only keeping it for archival purposes, see below for a more up-to-date equivalent

/*
 * Public Domain
 *
 * Created by Toni Corvera <outlyer@outlyer.net>, 2005
 *
 * Defines Array.find, and Array.merge
 */
// int Array.find(Object)
if (!Array.indexOf) {/*IE has no indexOf*/
	Array.prototype.find = function(what) {
		for (var i=0; i<this.length; ++i) {
			if (this[i]==what) {
				return i;
			}
		}
		return -1;
	}
}
else {
	Array.prototype.find=Array.prototype.indexOf;
}
// void Array.merge(Array)
Array.prototype.merge = function(a) {
	for (var i=0;i<a.length;++i) {
		this.push(a[i]);
	}
}

Old location: http://p.outlyer.net/graveyard/net_outlyer_arrays.js.

Array.find and Array.merge are equivalent to the standard methods Array.indexOf and Array.concat.

  • Array.concat was added to IE in version 4.0
  • Array.push was added on version 5.5.
  • Array.indexOf is not so widely supported (IE6 doesn't support it -I'm yet to try higher versions-, Chrome does)

Updated:

// int Array.indexOf(Object)
if (!Array.indexOf) { /*IE has no indexOf*/
	//This prototype is provided by the Mozilla foundation and
	//is distributed under the MIT license.
	//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
	Array.prototype.indexOf = function(elt /*, from*/) {
		var len = this.length;
	    var from = Number(arguments[1]) || 0;
		from = (from < 0) ? Math.ceil(from) : Math.floor(from);
	    if (from < 0)
			from += len;
		for (; from < len; from++) {
			if (from in this && this[from] === elt)
		        return from;
		}
		return -1;
	};
}
if (!Array.push) {
	Array.prototype.push = function(e) {
		this[this.length] = e;
		return this.length;
	};
}

References:

VCS 1.12.2 released

Another minor update, although the last few versions have contained a really stupid bug that prevented the temporary files from being removed (leading to a lot of stale, possibly big, files), so upgrading is highly recommended. Thanks to Jason Tackaberry for pointing the bug.

Note though I'm still on holidays so this is a quick and dirty release (with little testing).

Changes:


vcs 1.12.2
http://p.outlyer.net/vcs/files/vcs-1.12.2.gz (script only)

or
http://p.outlyer.net/vcs/files/vcs-1.12.2.tar.gz (script, sample configuration, manpage and profiles)

deb, rpm, PKGBUILD & bz2
as usual at http://p.outlyer.net/vcs/

VCS 1.12.1 released

A very small update this time. It's only been delayed by real life stuff.

Only worth mentioning:

  • Workaround for cases in which GAWK uses comma as decimal separator. Many European languages use commas but only a few versions of GAWK do actually print them (and newer versions don't anymore). People encountering this bug will have certainly noticed since it results in all kinds of errors.

vcs 1.12.1
http://p.outlyer.net/vcs/files/vcs-1.12.1.gz (script only)
or
http://p.outlyer.net/vcs/files/vcs-1.12.1.tar.gz (script, sample configuration and profiles)
deb, rpm, PKGBUILD & bz2
as usual at http://p.outlyer.net/vcs/

VCS 1.12 released

VCS 1.12 is ready to download

As with 1.11 many of the changes are pretty radical and might break but it's been working fine for me so far.

The changes are quite a few so I'll try to explain as best as I can. Documentation for the new stuff is on the way.

New in this version:

  • Profiles
  • On-demand loading of custom configuration files
  • Heading, footer and title based on actual font size
  • Configuration generation from the command-line
  • Relative end-offset
  • More reasonable command-line arguments to capture from DVD
  • Configuration syntax enhancements and more sensible names for settings

→ Profiles

Command-line: --profile <NAME> and -p <NAME>

Profiles allow saving a group of settings and then reusing them by using their name.
They can be saved to ~/.vcs/profiles/ or /usr/share/vcs/profiles/ as name.conf, and then invoked with a command-line like:
$ vcs -p name video.avi

They can also be combined, e.g.
$ vcs -p black -p mosaic video.avi

A list of available profiles can be displayed with
$ vcs -p :list

The deb, rpm, arch package and tarball include some sample profiles.

→ Configuration file loading

Command-line: --config <FILE> and -C <FILE>

A lot like profiles but settings can be loaded from any file on any directory. The only extra condition is the file should contain "vcs:conf:" inside comments towards the beginning or the end of the file.

$ vcs -C /tmp/mysettings.txt video.avi

→ Configuration (and profile) generation

Command-line: --generate config

By adding --generate config to the command-line, the effective settings are printed in a format that can be saved to a configuration or profile file.

All active settings with an appropriate config setting will be printed, no matter if they come from the command-line, profiles or configurations.

Examples

$ vcs -n4 --generate config
Will produce a configuration for 4 captures and fixed number of captures:

 numcaps=4
 timecode_from=$TC_NUMCAPS

$ vcs -p myprofile -C myconfig.cfg -E0 --generate config

Will merge profile "myprofile" and file myconfig.cfg, disable end-offset and print the combined settings.

Big warning

In case you aren't familiar with shell redirections, DON'T try to overwrite an existing configuration like:
$ vcs [...] --generate config > myconfig.cfg
This WILL WIPE your configuration BEFORE reading it.

Side-effect

Pre-existing configurations can be "upgraded" to the new names by running without extra arguments:
$ vcs --generate config

→ Relative end-offset

The end offset now accepts percentages and is 5.5% by default. It is now applied always unless disabled.

With the length detection workarounds in 1.11 and relative end offsets, the whole MIN_LENGTH_FOR_END_OFFSET nonsense is gone for good. Good riddance.

→ DVD capture

Handling of DVDs is now like that of normal files. --dvd (or -V) enable the DVD mode and take no arguments anymore:

$ vcs --dvd /dev/dvd

$ vcs --dvd --dvd-title 1 /dev/dvd

Multi-input is also accepted now:

$ vcs --dvd --dvd-title 1 --dvd-title 2 /dev/dvd /dev/dvd somedvd.iso
Will capture titles 1 and 2 from /dev/dvd, and the longest title from somedvd.iso.

DVDs and video files can't be mixed though (it's either DVD mode or no DVD mode for all input files).

→ Configuration syntax enhancements

Finally, configuration files are now easier to read and write:
 — Settings are case insensitive now
 — Names are easier on the brain (e.g. "height" instead of "th_height")
 — Comments no longer need their own line

Also a sample configuration file is provided with all available settings for easier writing of your own if needed.

→ Dynamic heading/footer/title

In previous versions heading and title size based on font pointsize. This lead to a few rare fonts displaying cropped. Footer was a fixed size so it was even worse at that. 1.12 probes the font size and (hopefully) sizes sections accordingly. Example:

Before: 1.11.2
After: 1.12

The font displayed is akaFrivolity in case you're wondering


vcs 1.12
http://p.outlyer.net/vcs/files/vcs-1.12.gz (script only)
or
http://p.outlyer.net/vcs/files/vcs-1.12.tar.gz (script, sample configuration and profiles)
deb, rpm, PKGBUILD & bz2
as usual at http://p.outlyer.net/vcs/

VCS 1.11.2 released

A new small update to vcs is available to download. This should be the last update before 1.12 (which will take a while to be ready) but the massive changes in 1.11.x still need more testing so who knows.

Changes in 1.11.2:

  • Some Real Audio codec names (v4, v5 and v6)
  • Bugfix/Feature: Fallback for default font on systems that don't register fonts with ImageMagick
  • Bugfixes: Clean up correctly extra temporary dirs, fix for non-GNU awk (e.g. mawk)

vcs 1.11.2
http://p.outlyer.net/vcs/files/vcs-1.11.2.gz
deb, rpm, PKGBUILD & bz2
as usual at http://p.outlyer.net/vcs/
Scroll to Top