A base64 story

So as some of you may be aware, I have been messing around with encryption in javascript the past few weeks. Anyway, I decided it was high time to update the 5 year old libraries I was using, and elected to start with the base64 functions used for armoring the PGP keys.

I ended up enjoying this so much that I decided I wanted to see the encryption before my eyes, and here are the results:

You can download the file I used to do this: base64.js

WikiLeaks en profondeur : Le soulevement des hackers

J'imagine qu'il y a peu de gens qui ne sont pas conscients de ce site et de son dernier grand coup dans les médias. Dans les grandes médias, il y a de la controverse mais il manque de critiques radicaux. C'est dans cette optique que nous avons fait une édition spéciale de En Profondeur (émission hebdomadaire d'actualités chez CKUT), et que j'ai par la suite réalisé ce capsule.

You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.

drush_make('Business Models Based on Ægir Ubercart Integration');
First slide in the presentation

I gave this presentation this weekend at Drupal Camp Montreal.

We presented our work on implementing Koumbit's AlternD service using all our nifty tools.

More on this to come soon. For now, you can check out the slides.

The slides were made with reST & S5, which made for fast and easy presentation creation.

DrupalCon Copenhagen: Growth & Mass
Your money is worth shit to us!

In the free & open source software world there are a lot of reasons for getting involved. Principles of mutual aid, profit, community building, and identity politics co-occur. My impression is that Drupal is drifting towards the business end of the spectrum.

Burned in my mind, is the businessman who, talking about a major contributor to Drupal, says that he is thankful for the long-haired bearded guys because without their work, he would make no money.

In his opening keynote, Dries defined goals for 2020 - lets grow by an order of magnitude. He addressed quality and accessibility as a means to the end of growth. Implicit in his speech was the assumption that the primary vector for Drupal's growth would be economic.

More eloquent words than mine have addressed what happens to institutions and movements that rely on accumulating and mobilizing mass. I don't think the concept of size is worth throwing out altogether, but I am not convinced by the benefits of growth.

I also noticed that many of my co-attendees had difficulty using words that folks in social movements have used for decades: workshop, outreach, mobilization, even worker. Instead they have invented or re-purposed words that mean fundamentally the same things: 'communities of practice' and 'gardening' being the ones that spring immediately to mind. To me this suggests that these concepts are not really at their mental fingertips.

Ultimately many of the folks at DrupalCon, even those who are most interested and committed to taking care of the community, seem more at ease with business language. In a business culture, the goal is to make money, and collaboration and consultation are just means to that end. They do not have value in and of themselves. Unless we are able to sustain taking these values seriously as ends in and of themselves, when they are in conflict with the primary goal of making money, they will fall to the wayside.

That said, the Drupal community is still very strong, collaborative and open-minded. Speaking to this are both the concerns around sexism at this con and all the effort going into adopting a shared code of conduct. Just the fact that we are discussing outreach and mobilization at these events, in whatever form, is a silver lining as far as I'm concerned.

I chronicled my experiences in more detail on membres.koumbit.org:

Towards the Abolition of Privacy in Canada

I did this translation for my buddy Anarcat - to see the French original, go to his blog.

The conservative government, supported by the liberal "opposition", is presently working hard to establish a legal basis for greatly expanded telephone and electronic surveillance. In short, you can be spied on by your municipal, provincial and federal police without a warrant or any kind of warning. As a systems administrator for Koumbit.org I am tasked with ensuring the security and confidentitality of your data, and am deeply troubled by this possibility. Canada, recognised internationally as a beacon of freedom on the internet, would align itself with the current international trends, as represented by the United States, China, and the European Union.

A Global Project of Arbitrary Surveillance

The Canadian plan is to force internet service providers (ISPs such as Koumbit, Bell Canada, Videotron and Google) to spy on you without warning you or obtaining a warrant. These ISPs will be forced to keep logs of your activities, and supply them to any police officer or other "authorized person", on demand. This information includes your:

Again, all this information would be provided to an authorised person without their ever having obtained a warrant from a judge. With their badge number and organisational affiliation, a cop can freely access all this information. The law is phrased in such a way that the ultimate authority to determine the legitimacy of such a request belongs to the "authorized person" making the request. The networks operators are simple intermediaries to the process of accessing your personal information.

Not only will ISPs need to conserve their logs, they will also need to conserve the content of communications passing over their network (Bill C47, article 6), which would impose an enormous additional cost to already fragile networks. Unlike the logs, the disclosure of this information would require a warrant, but in either case the ISP can be subject to a gag-order that would prevent it from informing you that your private information has been disclosed to the government.

The law provides for payment for these new espionnage services provided by ISPs. This will insure the complicity of the larger networks for whom providing such services would otherwise impose important new costs that they could not easily extort from their subscribers. In France and the UK such laws have been opposed by the ISPs on the grounds of their cost. This provision in the proposed Canadian law effectively undermines this basis for resistance.

Finally, the law indicates that encrypted communications (for instance, with your bank) must be conserved unencrypted by your ISP. This could make certain communications encryption services, such as Hushmail, inoperable, by forcing these services to conserve and share readable versions of the messages with the authorities (Bill C47, article 3.6). Presently, a judge can already order you to reveal your password in order to access your confidential information (as has been the case since 1993).

As a network operator, becoming a government spy in the context of my work for a private organisation goes against my code of ethics. This puts into question my work, which consists of enabling people to communicate and publish their ideas, and not imposing global state surveillance. Koumbit has already dealt with the authorities in similar circumstances, and we collaborated to the extent provided by the law. These new laws, as written, would in no way have aided that investigation; they simply allow an abusive and unnecessary level of surveillance.

The Political Excuse

The cynical justification of this intrusion on our privacy is to enforce copyright and protect children from pedophilia. "We must protect our children from being lured over the internet", according to the conservatives, as if the internet was intrinsically a menace to the physical and psychological health of children. Television already constantly assaults us with scenes of unbridled violence and images of an abusive juvenile sexuality, and existing laws suffice to allow the police to do their work freely, but nonetheless the internet as a whole and its users are the target of increased control and surveillance. The objectives of these laws are much more pernicious and dishonest than they appear to be in the offical discourse, and MPs are collaborating in ignorance of the technical issues, or, if they understand them, maliciously.

The first objective is to allow the film and music industry lobby (meaning the CRIA, namely the Canadian branches of Warner Music, Sony BMG Music, EMI Music, and Universal Music)) to continue to make record profits while pursueing users who are presently freely and legally downloading music and television online. We have been talking for years about how to adjust copyright to this reality and the response is toadying up to international lobbies.

The second objective is to control the population and easily identify political agitators, wherever they are and whatever they are saying. Presently to do this, you need to get a judges approval and wade through some boring legal procedures. These procedures are fundamental protections in a state that respects human rights, and have worked well in the past. The state now wants direct access to this information without having to undertake these procedures and with the least possible constraints. This threatens radical political discourse or anyone who desires their privacy and wishes to preserve the confidentiality of their personal information. This constitutes a clear menace to social movements and to the security of the remnants of our democracy and must be fought at all levels.

For more information:

La version originale de cet article, en français, se trouve sur le le blogue d'Anarcat.

Custom implementation of ffmpeg on an Ubuntu 8.10 server

Update (20 october 2009) - This is now two Ubuntu releases out of date, so please check some more recent sources before trying this.

I've been working for a while on a problem at the NFB where we are moving a Drupal site to a new server running Ubuntu Intrepid. The site depends on transcoding handled by the outdated Drupal video module. Because the video module did only a single-pass encode, NFB staff created a shell script to fool the video module and replace the single-pass encode with a double-pass encode that normalized the film audio.

The result was a generally better quality product. Now the problem is that this shell script uses ffmpeg for multiplexing at the end of the two-pass encoding process, and that the Ubuntu Intrepid ffmpeg package crashed gloriously on every multiplex.

So, I decided to compile a new ffmpeg package from source. But my problems with multiplexing didn't end there. Many of the blog posts I found made mention of source patches for the ubuntu x264 package. Anyway, I finally found my answer in the ubuntu forums:

http://ubuntuforums.org/showthread.php?t=786095

I followed these steps in a local virtual machine I created just for this purpose. After doing this, I had two deb packages ready (or so I thought) to be installed on our transcoding server. I fired off an e-mail to the supervisor of our IT department and transferred the files over to my home account on the server.

My supervisor, having lost custom packages to ubuntu updates in the past, insisted on a more comprehensive install, and sent me this link:

http://linux.togaware.com/survivor/Local_Debian.html

We followed these instructions to create a local repository. Then we popped into aptitude and tried to install our packages. BANG! Dependency errors.

After a couple of hours of combined troubleshooting we hit on a recipe that worked, so with no further ado, I present you with a complete recipe for building Debian packages of ffmpeg and x264 from source, transferring them to another machine, creating a local repository, and successfully installing them to your machine.

Compiling the custom packages

First we purged the existing packages:

 apt-get purge apt-get purge ffmpeg x264 libx264-dev 

Then we installed the following:

 apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libtheora-dev libxvidcore4-dev 

The build-essential package contains compilation tools, subversion and git-core are to fetch the required sources, the libs are for configuring ffmpeg, and checkinstall is the program we will use to install the programs and generate .debs.

Next we fetched, configured and compiled x264:

 git clone git://git.videolan.org/x264.git 
 cd x264 
 ./configure --enable-shared 
 make 
 checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" 
 ldconfig 

And we did the same for ffmpeg:

 svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg 
 cd ffmpeg 
 ./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid 
 make 
 checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" 

Modifying the control files on the transcoding server

Checkinstall does not add dependancies to the packages, so we did that manually.

First we uncompressed the .deb packages and their control file:

 dpkg-deb -x x264_1:0.svn20090206-0.0ubuntu1-1_i386.deb x264 
 dpkg-deb -x ffmpeg_3:0.svn20090206-12ubuntu3-1_i386.deb ffmpeg 
 dpkg-deb --control x264_1:0.svn20090206-0.0ubuntu1-1_i386.deb x264/DEBIAN 
 dpkg-deb --control ffmpeg_3:0.svn20090206-12ubuntu3-1_i386.deb ffmpeg/DEBIAN 

Then we edited the control files:

vim x264/DEBIAN/control
vim ffmpeg/DEBIAN/control

We copied and pasted the dependancies from

 /var/lib/apt/lists/ubuntu.nfb.ca_ubuntu_dists_intrepid_main_binary-i386_Packages 

for ffmpeg, and

 /var/lib/apt/lists/ubuntu.nfb.ca_ubuntu_dists_intrepid_multiverse_binary-i386_Packages 

for x264. We found these files by grepping for "Package: ffmpeg" or "Package: x264", and used those search terms again within the files to locate the package information.

Here's what our control files looked like, more or less, after this process:

Package: ffmpeg
Version: 3:0.svn20090206-12ubuntu3-1
Architecture: i386
Maintainer: root@localhost
Installed-Size: 48192
Depends: libavcodec51 (>= 3:0.svn20080206-8) | libavcodec-unstripped-51 (>= 3:0.svn20080206-8), libavdevice52 (>= 3:0.svn20080206-8) | libavdevice-unstripped-52 (>= 3:0.svn20080206-8), libavformat52 (>= 3:0.svn20080206-8) | libavformat-unstripped-52 (>= 3:0.svn20080206-8), libavutil49 (>= 3:0.svn20080206-8) | libavutil-unstripped-49 (>= 3:0.svn20080206-8), libc6 (>= 2.7), libfreetype6 (>= 2.3.5), libimlib2, libsdl1.2debian (>= 1.2.10-1), libswscale0 (>= 3:0.svn20080206-8) | libswscale-unstripped-0 (>= 3:0.svn20080206-8)
Provides: ffmpeg
Filename: dists/local/local/binary-i386/ffmpeg_3:0.svn20090206-12ubuntu3-1_i386.deb
Size: 19122026
MD5sum: 06847640d947b33b697c03182e2c593f
Section: checkinstall
Priority: extra
Description: Package created with checkinstall 1.6.1

Package: x264
Version: 1:0.svn20090206-0.0ubuntu1-1
Architecture: i386
Maintainer: root@localhost
Installed-Size: 2508
Depends: libatk1.0-0 (>= 1.20.0), libc6 (>= 2.7), libcairo2 (>= 1.6.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.12.0), libpango1.0-0 (>= 1.20.2), libx11-6, libx264-59 (>= 1:0.svn20080408)
Provides: x264
Filename: dists/local/local/binary-i386/x264_1:0.svn20090206-0.0ubuntu1-1_i386.deb
Size: 892740
MD5sum: bfb45ec75936b3acdc4fc0d6be7fe5b6
Section: checkinstall
Priority: extra
Description: Package created with checkinstall 1.6.1

While we were in the control files, we also took the time to modify the maintainer and description strings. Once we were satisfied, we rebuilt our packages:

dpkg -b ffmpeg ffmpeg_3:0.svn20090206-12ubuntu3-1_i386.deb
dpkg -b x264 x264_1:0.svn20090206-0.0ubuntu1-1_i386.deb

You will be overwriting your old packages - if you want to use a different name for the rebuilt packages, then make sure to modify the "Version:" line in your control files so that the new package name and version string while match up.

Creating the local repository

We chose to create our local repository in opt:

mkdir /opt/my_repository/dists/local/local/binary-i386

And set permissions.

chmod -R g+w /opt/my_repository
chown -R root:admin /opt/my_repository

We copied both packages to inside /opt/my_repository/dists/local/local/binary-i386 and ran a command to create package information:

dpkg-scanpackages dists/local/local/binary-i386 /dev/null > dists/local/local/binary-i386/Packages

This command MUST be run from inside /opt/my_repository. Otherwise when you use apt or one of its friends to try to install the packages, they won't be able to find them.

We added these lines to /etc/apt/sources.list:

#Repository of local packages
deb file:/opt/my_repository local local

At this point we were able to start aptitude, update ("u") the package lists, find our custom packages and add them ("+") and finally install them ("g").

The final step was to create a symbolic link to ffmpeg in /usr/bin, because our shell script and drupal were looking for /usr/bin/ffmpeg.

ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg