Properly uploading files to Amazon S3

Here is a little script I wrote and I though ought to be shared. I use it to upload static files like images, css and javascript so that they can be served by Amazon S3 instead of the main application server (like Google App Engine).

It’s written in Python and does interesting things like compressing and minifying what needs to be. It takes 3 arguments and as 2 options:

Usage: s3uploader.py [-xm] src_folder destination_bucket_name prefix
src_folder
path to the local folder containing the static files to upload
destination_bucket_name
name of the S3 bucket to upload to (e.g. static.example.com)
prefix
a prefix to use for the destination key (kind of a folder on the destination bucket, I use it to specify a release version to defeat browser caching)
x
if set, the script will set a far future expiry for all files, otherwise the S3 default will be used (one day if I remember well)
m
if set, the script will minify css and javascript files

First you will have to install some dependencies, namely boto, jsmin and cssmin. Installation procedure will depend on your OS but on my Mac I do the following:

sudo easy_install boto
sudo easy_install jsmin
sudo easy_install cssmin

And here is the script itself:

#! /usr/bin/env python
import os, sys, boto, mimetypes, zipfile, gzip
from io import StringIO, BytesIO
from optparse import OptionParser
from jsmin import *
from cssmin import *

# Boto picks up configuration from the env.
os.environ['AWS_ACCESS_KEY_ID'] = 'Your AWS access key id goes here'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'Your AWS secret access key goes here'

# The list of content types to gzip, add more if needed
COMPRESSIBLE = [ 'text/plain', 'text/csv', 'application/xml',
                'application/javascript', 'text/css' ]

def main():
    parser = OptionParser(usage='usage: {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}prog [options] src_folder destination_bucket_name prefix')
    parser.add_option('-x', '--expires', action='store_true', help='set far future expiry for all files')
    parser.add_option('-m', '--minify', action='store_true', help='minify javascript files')
    (options, args) = parser.parse_args()
    if len(args) != 3:
        parser.error("incorrect number of arguments")
    src_folder = os.path.normpath(args[0])
    bucket_name = args[1]
    prefix = args[2]

    conn = boto.connect_s3()
    bucket = conn.get_bucket(bucket_name)

    namelist = []
    for root, dirs, files in os.walk(src_folder):
        if files and not '.svn' in root:
            path = os.path.relpath(root, src_folder)
            namelist += [os.path.normpath(os.path.join(path, f)) for f in files]

    print 'Uploading {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}d files to bucket {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}s' {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2} (len(namelist), bucket.name)
    for name in namelist:
        content = open(os.path.join(src_folder, name))
        key = bucket.new_key(os.path.join(prefix, name))
        type, encoding = mimetypes.guess_type(name)
        type = type or 'application/octet-stream'
        headers = { 'Content-Type': type, 'x-amz-acl': 'public-read' }
        states = [type]

        if options.expires:
            # We only use HTTP 1.1 headers because they are relative to the time of download
            # instead of being hardcoded.
            headers['Cache-Control'] = 'max-age {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}d' {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2} (3600 * 24 * 365)

        if options.minify and type == 'application/javascript':
            outs = StringIO()
            JavascriptMinify().minify(content, outs)
            content.close()
            content = outs.getvalue()
            if len(content) > 0 and content[0] == '\n':
                content = content[1:]
            content = BytesIO(content)
            states.append('minified')

        if options.minify and type == 'text/css':
            outs = cssmin(content.read())
            content.close()
            content = outs
            if len(content) > 0 and content[0] == '\n':
                content = content[1:]
            content = BytesIO(content)
            states.append('minified')

        if type in COMPRESSIBLE:
            headers['Content-Encoding'] = 'gzip'
            compressed = StringIO()
            gz = gzip.GzipFile(filename=name, fileobj=compressed, mode='w')
            gz.writelines(content)
            gz.close()
            content.close
            content = BytesIO(compressed.getvalue())
            states.append('gzipped')

        states = ', '.join(states)
        print '- {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}s => {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}s ({5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}s)' {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2} (name, key.name, states)
        key.set_contents_from_file(content, headers)
        content.close();

if __name__ == '__main__':
    main()

Thanks to Nico for the expiry trick :)

PRIVACY: @chassyofcricket by Michell Zappa

Spare me the talk about privacy, they’re all clueless anyway…

With all the talks and posts and whatnot about privacy on the Internet it’s easy for anyone to turn into a privacy control freak.

And I really was starting to freak out myself. After all, a good bunch of my own life is on the Net: Facebook, Twitter, Flickr, LinkedIn, this blog, all the Google applications and all the other services I use, or I test… But this morning I received a letter, not an e-mail, a paper letter. From Google AdWords. Sent from France. In German!

I guess they just assumed that since I was living in Switzerland I was talking German, like when ebay.com redirects me to ebay.de, but I don’t speak nor read German.

And it reminded me something I learned a long time ago, when I was working for Singularis – a now defunct start-up that was collecting users preferences about TV programs: You can collect as many data as you want, if you don’t know how to use it it’s only worth the cost of the storage.

And the more you have the harder it is.

Image Credits: Michell Zappa

Sévices Après Vente

Dans un monde chaque jour un peu plus numérisé n’oublions pas que ce sont toujours les même vieux trucs qui fonctionnent: si vis pacem, para bellum!

!!Attention!! Ce billet est long et ennuyeux…

Ceux qui me suivent sur Twitter ou Facebook se souviendront qu’en novembre dernier (le vendredi 13 exactement) mon appartement avait été cambriolé pendant que j’étais chez le dentiste (ça fais beaucoup pour un vendredi 13). Parmi les objets qui m’avaient été volés se trouvait mon MacBook Pro, qui est mon seul et unique outil de travail.

J’avais donc rapidement besoin d’une nouvelle machine. Après avoir fait le tour des revendeurs Apple de la région pour découvrir que seules des configurations de base étaient en stock, je me rend, sans grand espoir, à la FNAC de Lausanne.

Je n’achète jamais de matériel électronique de ce prix à la FNAC – en dessous de 200,-CHF le rapport prix/rapidité de l’achat est assez favorable pour que je ne cherche pas plus loin mais au-delà j’ai toujours pu trouver moins cher ailleurs. Mais, ce samedi 14, je découvre avec bonheur que la FNAC possède en stock un MacBook Pro dont la configuration approche de très prés la configuration que je recherche: 15″, 3.06GHZ, 4Go de RAM et un disque dur de 500Go à 7200 tr/mn. Je l’achète donc, pour le prix de 3299,-CHF (moins le rabais adhérents).

Le 29 décembre dernier (un mois et demi plus tard), en allant me coucher, je décide de laisser mon MacBook allumé sur la table du salon afin qu’il puisse participer au réseau BOINC et dédier quelques cycles à la recherche extra-terrestre. Je n’ai pas d’animaux, pas d’enfants et la machine est posée sur un endroit dégagé où la ventilation n’est pas obstruée.

Le lendemain matin, ayant pris mon petit déjeuner, je m’en vais consulter mes e-mails. Étrangement, alors qu’une simple caresse suffit d’habitude, mon Mac ne veut pas se réveiller. Étonné, je vérifie que je ne l’ai pas laissé sans alimentation: non, le cordon est bien là, branché et alimenté, il ne s’agit donc pas d’un épuisement des batteries. De plus, un ronron très léger m’indique que la machine semble toujours être en marche. Je force donc un shutdown en maintenant la touche on/off enfoncée et j’entends distinctement ce petit bruit caractéristique qui signale l’arrêt d’un moteur électrique quelque part dans la machine. Je l’allume de nouveau et là un bruit de moteur se fait également entendre mais à par cela rien, l’écran reste désespérément aveugle. Après une ou deux autres tentatives aussi infructueuses je décide d’amener la machine au SAV de la FNAC.

Continue reading

Experiencing viral growth

This is something to hear and talk about it but this is something totally different to experience it, it’s thrilling, even on modest scales.

Since my LibraryThing application for Facebook is out it has clearly had a viral growth curve. So far there are only 435 users and every week I am looking for an inflection of this tendency. I know there will be one because there is a limited number of LibraryThing users on Facebook. My goal, right now, is to attract as many of them as possible on this application.

The next step will be to attract Facebook users to LibraryThing. But I know that for this I will need help from Tim Spalding and the LibraryThing team. I have always been grateful for their work but I must admit that I have been quite disappointed recently as I was trying to contact them and they constantly ignored me.

I am also thinking about open-sourcing the application, because I think it is both a good use case for people who are developing Python/Django applications on Google AppEngine and those who are developing for the Facebook platform. I still have to choose a license but the GNU Affero General Public License seems like a good match.

Anyway, if you love books, got plenty of them and want to share your readings, do not forget to give LibraryThing a try and once your are convinced, join the Facebook application, with this application you can:

  • Add a tab and a box to your profile, listing your most recent books
  • Choose the number of books to display in your profile tab
  • Choose whether you want to display them with covers only or as a list which will include your ratings and reviews
  • If you grant the application the right to publish to your stream it will publish books you add to LibraryThing on your wall
  • It will also publish reviews as you write them on LibraryThing

You can also:

  • Browse your Facebook friend’s books
  • Find books on the search page
  • Share a book you like or comment on it (those are Facebook only features and will not appear in LibraryThing)
  • Add a book to your LibraryThing collection with a single click

Enjoy :)

A year in review

As this year in coming to an end I though I should do a post-mortem, like at the end of a project, to see what went well and what did not.

  • I left the office I was renting downtown and started working from home: It was a good move from work perspective, being alone at home allows me to be really productive. However, as the second part of the year was getting busier it became difficult to put limits and my work/life balance suffered.
  • I worked the map editor of the DITA-OP but did not finish it: Not good at all, I have not been able to do a release this year. The other problem with the DITA-OP is that I don’t know my users. I know they are here, somewhere and I really need to find a way to gather the community.
  • I started two toys projects, SidewikiRSS.com and a Facebook application for LibraryThing: SidewikiRSS.com is rolling on its own, it does not cost me anything beside the domain name (thanks Google App Engine), it’s used regularly and bring some traffic here. fbLibraryThing is slowly but steadily growing but I am wondering if I will be able to add new features – I am completely dependent on the LibraryThing API and I will need help from the LibraryThing team if I want to go farther.
  • I completely put aside my super-secret Babelizr project: That’s not a good thing, for sure, but at least it was because of too much paid work. A positive thing is that I greatly improved my Python and Django skills with other projects and it will payoff for Babelizr.
  • I can now consider myself an Amazon Web Services and Google App Engine expert: And that’s a tremendous addition to my curriculum. I need now to dedicate more time to their respective communities.
  • I accepted too many projects in the second part of the year: The beginning of the year had been slow and I though I needed as many contacts as possible to build a sustainable business. Overall this is a good thing – especially since I exceeded my financial goals. The other positive side is that I only accepted interesting projects and that I met really nice people. But I really had a lot of pressure in the last quarter and this was definitely not the purpose of being a freelancer – “Working more to earn more” is not my moto.
  • I did not blogged enough: Especially since I gained a lot of experience in many fields and with many tools, I should have definitely written more about these.

And last, but not least:

  • I swam with sharks: Biggest thrill ever! I swam with two Oceanic Whitetip (Carcharhinus longimanus) in the Red Sea. My only regret is that I have been totally unable to take a descent picture or make a video of this event.
  • I skied almost every week-end of the winter season and hiked almost every week-end of the summer season: This prepared me really well for our 2 weeks vacation in Peru.
  • I have been more than 80 times to the movie theater: Thanks to the Pathé Pass Yang offered me last Christmas. It allowed me to see movies (good and bad) that I would not have seen otherwise.

I think I can say it was a good year, tiring, a bit stressful near the end but a good year. However, I must say it did not bring me any closer to my biggest goal that is to find ways to automate my revenue stream, so I really need to work that out next year.

The other planned features of next year are:

  • Releasing the latest version of the DITA-OP and finding a way to build and animate the community.
  • More blogging (like everyblogger else) and tweeting. Find a better organization of my Facebook presence.
  • Connecting with the LibraryThing team, although this proved to be difficult so far.
  • Coming back to Babelizr, may be starting with building external interest around the project first in order to force commitment.
  • Dedicating more time to online communities: Google App Engine, AWS, Drupal, Django, etc. May be through Stack Overflow.
  • Planning of a 4 weeks vacation dedicated to hiking or diving.
  • Watch as many movies as possible with my renewed Pathé Pass.

And, of course, keeping my clients happy :)

I only worked for two public projects this year (others are either private or still in stealth mode, so I cannot talk about them):

  • Fontself, a startup company which provides a revolutionary new experience of text, through digital text personalization. It provides digital fonts that preserves the gestures of a given handwriting and the original look of the drawing appliance (ball-point pen, pencil, ink, paper, etc.). I participated in the design of the font distribution system and its implementation on the Amazon’s cloud infrastructure using Python and Django.
  • nouvo.ch, the multimedia magazine from the Swiss Romand Television channel asked me to redevelop their website using the Drupal CMS and various media management modules.

My Fontself is better than your font

FontselfFor those of you who were at the Lift conference 2008 you might remember of Fontself. Franz Hoffman and Marc Escher, the two founders of the company, were there to offer everyone the opportunity to fill in a grid with their own hand writing, scan it, and use it on the Lift website.

Today, the Fontself team has grown and is celebrating their first release of a product. Together with Netlog, the european online social portal, they are now giving the opportunity to the Netlog community members to send messages, post blog entries or post comments using personalized character fonts.

Congratulation to them, they have been working long and hard for their ideas to come out and I am proud I helped them make their dream come true.

[fontself font=”_9905c72628cf93321a6ce43c146071af09cb7d2339b3b1cfc8eb764ccf6d87ff” size=”30″]And this also gives me some advantages, like being able to use a Fontself font on my own blog and give you a glimpse at what the future of web fonts might be![/fontself]
[fontself font=”_b72139c4df1037c8971033917d5bf684f05f9e33f8b990b9f3fef046823e596a” size=”20″]Among other things, you will appreciate the ability to select, copy and paste the text :P[/fontself]
For now, the feature is only available to the french version of the platform but there is no doubt that it will rapidly extend to the rest of the 35 million Netlog members throughout Europe and that the Fontself team will continue to develop their technology and enhance the web.

If you want to stay informed about Fontself and their technology you can either subscribe to their newsletter, become a friend of their Netlog page, follow them on twitter or keep following this blog…

Image Credits: Fontself

Sidewiki RSS

Sidewiki RSSLast week Google announced Google Sidewiki, a new service that enables anyone to comment on any page.

There has been a lot of comments already about Sidewiki but the thing that instantly stroke me is the fact that there’s no easy way to keep up with what others are saying about your own pages. So I took a look at the Sidewiki API and built the Sidewiki RSS service.

This free service (hope you won’t mind the Google Ads) enables webmasters to get the URL to the recent Sidewiki entries for their pages. There’s even a bookmarklet that you can drop in your browser’s toolbar and use to get the feed of the page you are browsing.

Hope you will like it ;)

JMeter distributed testing with Amazon EC2

Recently I had to setup a performance testing infrastructure for one of my client. The goal was to put their web application under heavy load to prove it was able to scale properly and do some capacity planning.

I chose Apache JMeter to generate the load, created a few test plans and started to nudge the application. Of course I quickly understood that my MacBook won’t be enough have the server sweat.

To serve this application we are using Amazon EC2 instances managed with the Sclar.net service. One day I should write something about Scalr, but for now, enough is to say that a Scalr farm defines the configuration of a cluster of EC2 instances. Each instance in a farm belongs to a role (an EC2 AMI) and the farm defines how many instances of each role should be launched.

Since JMeter can be used in a master/slave mode (see details here) I decided to use Scalr to create a farm of JMeter slaves that would put the application under pressure.

The first problem I faced is that the JMeter master and its slaves must be in the same sub-network to be able to communicate, so my JMeter farm had to define two different roles, one for the master (jmeter-master) with only one instance and one for the slaves (jmeter-slave) with as many instances as necessary.

The second problem was concerning the IP addresses of the slaves, I did not want to write down the slaves’ IPs and manually enter them in the JMeter command line. By chance, with Scalr, each instance in a farm is informed of its peers’ IP addresses, so I wrote a small Python script that would get those IPs and launch the JMeter master with a given test plan.

#! /usr/bin/python
import os, sys, subprocess, datetime

JMETER_CMD = '/usr/share/jmeter/bin/jmeter'
SCRIPTS_ROOT = '/var/testing/'
# Instance IPs for a given role are filenames in the '/etc/aws/hosts' folder
SLAVES = os.listdir('/etc/aws/hosts/jmeter-slave')

def jmeter(script):
    logname = datetime.datetime.now().strftime('{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}Y{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}m{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}d{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}H{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}M{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}S') + '.log'
    script = os.path.join(SCRIPTS_ROOT, script)
    cmd = [ JMETER_CMD, '-n' ]
    cmd += [ '-t', script ]
    cmd += [ '-R', ','.join(SLAVES) ]
    cwd = SCRIPTS_ROOT
    subprocess.check_call(cmd, cwd=cwd, stderr=sys.stderr, stdout=sys.stdout)

if __name__ == '__main__':
    jmeter(sys.argv[1])

This was working pretty nicely for my simpler test plans (like the one that only GETs the home page) but as soon as I tried to POST (like during the login process) this was not enough. The thing is that the POST data that JMeter is using are not stored in the test plan itself but in companion .binary files, and those files are not sent by the master to the slaves like the test plans are.

I thus had to find a way to send those files by myself before the launch of the test plans. Rsync seemed the easiest thing to do, so I wrote another Python script to synchronize the slaves.

#! /usr/bin/python
import os, sys, subprocess

SCRIPTS_ROOT = '/var/testing/'
# Instance IPs for a given role are filenames in the '/etc/aws/hosts' folder
SLAVES = os.listdir('/etc/aws/hosts/jmeter-slave')

def sync():
    for slave in SLAVES:
        dest = '{5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2}s:/var/testing' {5f676304cfd4ae2259631a2f5a3ea815e87ae216a7b910a3d060a7b08502a4b2} slave
        cmd = ( 'rsync', '-r', '-e', 'ssh -q -i /var/testing/farm.key', SCRIPT_ROOT, dest)
        subprocess.check_call(cmd, stderr=sys.stderr, stdout=sys.stdout)

if __name__ == '__main__':
    sync()

The above script requires only three things:

  • a valid RSA private key (here /var/testing/farm.key), which you can download using the Scalr.net farm’s menu
  • the /var/testing folder must already exist on the slaves
  • and, of course, you need to initially get the files on the master. I use svn up.

Once you have prepared and tested everything, using one master and one slave, you can rebundle the instances you used and then start to spawn tens of slaves to stress your application.

If you have already done something similar or have ideas for improving my setup do not hesitate in letting me know in the comments :)

UPDATE: With the release of the Amazon Virtual Private Cloud it should be possible now to have slaves running in the cloud and a master running on your workstation, they would all be in your own sub-network. However, you will need to find another way to synchronize the POST data with the slaves.

Posting multipart form data using PHP

@shvi asked me for this code over Twitter, I though it would a good idea to share it here.

The following code is used to post two different fields, a simple text data named “somedata” and a file named “somefile”.
Hope it helps :)

echo adrotate_group(4);
$destination = "http://yourdomain.com/yoururl";

$eol = "\r\n";
$data = '';

$mime_boundary=md5(time());

$data .= '--' . $mime_boundary . $eol;
$data .= 'Content-Disposition: form-data; name="somedata"' . $eol . $eol;
$data .= "Some Data" . $eol;
$data .= '--' . $mime_boundary . $eol;
$data .= 'Content-Disposition: form-data; name="somefile"; filename="filename.ext"' . $eol;
$data .= 'Content-Type: text/plain' . $eol;
$data .= 'Content-Transfer-Encoding: base64' . $eol . $eol;
$data .= chunk_split(base64_encode("Some file content")) . $eol;
$data .= "--" . $mime_boundary . "--" . $eol . $eol; // finish with two eol's!!

$params = array('http' => array(
                  'method' => 'POST',
                  'header' => 'Content-Type: multipart/form-data; boundary=' . $mime_boundary . $eol,
                  'content' => $data
               ));

$ctx = stream_context_create($params);
$response = @file_get_contents($destination, FILE_TEXT, $ctx);

Pirater n’est pas voler, mais…

A copyright will protect you from PIRATES.

A copyright will protect you from PIRATES.

Samedi dernier, ma camarade Stephanie Booth a publié un nouvel article sur son blog, climbtothestars.org, intitulé “Pirater n’est pas voler, en sept mythes”. Le principal déclencheur de l’écriture de ce billet semble avoir été son agacement concernant les campagnes de criminalisation des personnes téléchargeant illégalement des oeuvres protégées, Hadopi et l’affaire Logistep en étant les dernières incarnations.

Cet article, intéressant en soi et particulièrement bien documenté, suscite quelques commentaires tout aussi intéressants. Je vous encourage à lire le tout si ce n’est pas déjà fait.

Quant à moi, si je m’exprime c’est parce que, comme Stephanie, je suis un auteur (de logiciels) et un pirate! Que je partage en partie son point de vue mais que je pense que le débat n’est pas là où elle le porte.

Mais d’abord, voyons les choses avec lesquelles je suis d’accord:

  1. Assimiler le piratage au vol est une tentative de manipulation du public et des institutions afin de criminaliser ceux qui mettent à disposition ou téléchargent de la musique ou des films. Et c’est énervant!
  2. Cette manipulation est orchestrée par des groupes de pression à la solde des “majors” de l’industrie du disque et de Hollywood qui s’accrochent à un modèle de distribution qui est maintenant révolu.
  3. Chaque téléchargement illégal n’est pas une vente perdue et cela ne devrait pas être la base pour des calculs en dommages et intérêts.
  4. Le but d’un artiste n’est pas de vendre des CDs.
  5. La propriété intellectuelle est là pour protéger l’expression d’une idée, pas sa diffusion. Une fois qu’elle est exprimée on ne peut pas empêcher une idée de se diffuser.

Maintenant, voyons où ça coince.

Pirater = voler

C’est un débat sémantique et répondre aux “majors” sur ce terrain c’est leur donner du grain à moudre. Sans compter qu’une fois reconnu que la mise à disposition et le téléchargement de musique sans l’accord de son créateur est, au minimum, moralement discutable alors le reste est juste une perte de temps.

La personne qui achète un CD ou un mp3 puis le rend disponible sur Internet (quelque soit le moyen technique) se rend coupable dans pas mal de pays de violation du contrat de licence qui le lie au producteurs de l’oeuvre et qu’il a tacitement accepté en l’achetant. D’ailleurs, on n’achète jamais un morceau de musique, au mieux on achète le droit de l’écouter et de le diffuser dans le cadre familial.

Celui qui, ensuite, le télécharge, se rend coupable de recèle. Et ça c’est une chose que tous les avocats du p2p savent.

La majorité des personnes qui téléchargent ne le savent peut-être pas à priori mais tant qu’ils n’en sont pas conscient ils n’entrent pas dans le débat, une fois qu’ils ont compris alors ils tentent de défendre ce qu’ils pensaient être un droit, mais ils reconnaissent également qu’il y a un problème.

Un modèle révolu

Si c’est un modèle révolu (ce que je pense) alors il disparaîtra au profit d’un autre, mieux adapté.

Les tentatives des “majors” n’y feront rien, d’autant que pour l’instant ils se contentent de jouer sur le même terrain (distribution de supports physiques). Ce sont les artistes qui vont faire changer le système (et cela a déjà commencé), ce ne sont ni les “majors” ni les utilisateurs. Ils ont ce pouvoir tout simplement parce qu’ils possèdent la propriété intellectuelle de leur oeuvre. Jusqu’à présent ils n’avaient pas le choix: il fallait passer par un support physique pour faire circuler leur musique, maintenant ils sont affranchi de celui-ci, mais cela ne règle pas pour autant le problème de la copie.

Et cela reste un problème car quel modèle économique adopter? Même si aujourd’hui les artistes touchent peu sur la vente d’un CD est-ce que l’alternative doit être de ne plus rien toucher du tout?

Il y a plusieurs idées dans l’article de Stephanie et dans les commentaires, toutes tournent autour des concerts (publiques ou privés) et du “merchandising” mais cela ne résout pas non plus le problème de la diffusion illégale de copies pirates. En admettant qu’à l’avenir les artistes choisissent de mettre gratuitement en ligne certains morceaux afin d’inciter les gens à acheter des places de concert, rien n’empêchera le reste de leur répertoire d’être diffusé largement et illégalement. Une petit caméra numérique HD ($200) et hop, le concert est en ligne.

De plus, l’organisation de concerts est une chose coûteuse et difficile, le résultat net pourrait être une réorientation de l’industrie du disque vers l’organisation d’évènement, les artistes continueraient à être dépendant de “majors”. Sans compter que c’est une activité qui ne “scale” pas et donc on verra sûrement l’augmentation du prix des place des concerts, qui finiront peut-être par être réservés à une audience de nantis. Retour donc aux concerts du roi et au mécénat avec à la fin des artistes épuisés, incapables, passé 30 ans, de pouvoir donner assez de concerts pour pouvoir vivre correctement (sans parler d’avoir une famille).

J’avoue, le paragraphe précèdent fait scénario catastrophe, mais cela exprime juste mes doutes quant à ce qui est proposé pour l’instant. Le fait est qu’aujourd’hui, bien que certaines personnes coulent des jours paisibles (comme Marc Fleury, créateur de jBoss), d’autres se remettent mal d’avoir adopté le logiciel libre comme manière de vivre (comme Zed Shaw, créateur de Mongrel).

Le ou les modèles restent à découvrir et seuls les artistes, à force d’essais et d’échecs, seront à même de le faire. Après tout on parle de gagner leur vie avec leur travail. Mais rien de tout cela ne peut se faire sans le respect de la nature unique de l’oeuvre et cela passe par la reconnaissance de celle-ci en temps que propriété de l’auteur.

On ne possède pas une idée

En effet, on ne possède pas les idées, pas au sens strict. Mais c’est encore de la sémantique.

Personne ne s’intéresse à une idée, ce qui fait d’une idée qu’elle a de la valeur c’est son application. On peut disserter des heures sur la nature d’une idée et s’émerveiller de la façon incontrôlable qu’elle a de se répandre et de muter (quand elle est bonne), mais cela n’a rien à voir avec le fond du problème. Dans le cas qui nous occupe (on pourra parler de philosophie une autre fois) ce qui nous intéresse c’est comment la diffusion incontrôlée d’une oeuvre va pouvoir faire vivre celui qui la créé, mais pas seulement…

Une oeuvre artistique n’est pas une idée comme une autre, elle contient quelque chose que n’aura pas la prochaine idée sur les méthodes de fabrication des roues de 90mm pour Roller Blades.

Dans son article Stephanie dit, au sujet de la propriété intellectuelle:

Si diffuser une oeuvre ne nécessite plus d’investissement significatif, s’il n’y a plus de prise de risque, a-t-elle encore besoin d’une pareille protection?

Appliquée à la musique, la propriété intellectuelle accorde à son auteur le contrôle sur l’usage qui est fait de son oeuvre. Supprimer la propriété intellectuelle c’est nier la valeur intrinsèque de l’oeuvre (notons quand même que si la diffusion ne nécessite plus “d’investissement significatif”, la création elle-même reste un processus long, compliqué et souvent pénible) et du message que l’artiste tente de véhiculer (quand il y en a un). Un des risque c’est de voir son travail détourné et utilisé dans un cadre qui ne lui convient pas.

Si j’étais musicien, je n’apprécierais pas que l’UDC passe ma musique pendant ses réunions politiques. C’est encore pire si cela peut se faire sans mon accord et que mon nom est cité par souci de “reconnaissance” (merci, mais, non merci!).

C’est pour cela que même si la diffusion d’une oeuvre devient de plus en plus incontrôlable (en fait surtout à cause de cela) la propriété intellectuelle, le droit d’auteur et le droit à l’image doivent rester des recours possible.

Néanmoins, comme toute arme, elle est a double tranchant. L’emploi abusif de ce recours dans un modèle économique qui favoriserais la libre circulation des oeuvres aurait tendance à pénaliser celui qui l’utilise (voir Metallica).

Conclusion?

J’ai principalement parler de musique mais toute forme de création “numérisable” est concernée: jeux vidéos, journalisme, roman, cinéma, photographie, peinture (arts visuels en général) et bien sûr logiciel.

Le problème se pose de manière aiguë aujourd’hui parce que les industries du disques et du cinéma sont des acteurs puissant de l’économie et engagent des sommes importantes dans le débat, mais cette révolution à déjà eu lieu (ou est en cours) dans les autres domaines. On commence a voir apparaître les limites de certains modèles alternatifs et a maîtriser ceux qui fonctionnent.

Il y a quelques décennies l’industrie du logiciel à pris un virage similaire, c’est ce qui a en partie permis à Internet de se développer et a permis de réduire les coûts de développement des logiciels d’entreprise. A l’époque, les grands comme Microsoft ou IBM lutaient également contre le piratage et les logiciels libres. Aujourd’hui, l’industrie a embrassé le modèle et ne pourrait fonctionner sans cela.

Au final s’énerver ne sers pas à grand chose. Les “majors” peuvent jeter autant d’argent qu’elles veulent dans des campagnes de “sensibilisation” le changement est en marche. Les politiques sont mal informés mais suffisamment malin pour faire semblant de prendre des décisions tout en laissant le marché se réguler tout seul (Hadopi est inapplicable et collecter des adresses IP ne permettra pas grand chose de plus). Les gens savent reconnaître la valeur de l’art et sont prêt à payer s’ils le peuvent et pour peu qu’on n’essaye pas de les arnaquer. Les artistes aussi sont des gens malins, ils savent qui a de l’argent, qui n’en a pas et ce qui est bon pour eux.

Les artistes qui n’adopteront pas un nouveau modèle sombreront dans l’oubli et d’autres seront découverts. Les “majors”, si elles réussissent dans la voie actuelle, s’enterreront elles-mêmes, les gens préférant des musiques “libres” plutôt que de payer des CDs ou de risquer le tribunal. Mais pour cela il faudra prendre bien soin de protéger la propriété intellectuelle!

Et après? Eh bien, moi j’attends avec impatience la mise sur le marché d’imprimantes 3D économiques et performantes afin de voir les sculpteurs et les designers se prendre, à leur tour, les pieds dans ce tapis.

Image Credits: Ioan Sameli