Archive for April, 2008

[shell] créer un répertoire, un sous-répertoire, un sous-sous répertoire, en un coup! (mkdirhier / mkdir -p)

Supposons que vous êtes (sous GNU/Linux ou unix, sous un terminal avec pour shell bash ou un autre similaire) dans le répertoire (ou “dossier”) /current/ , que /current/existant/ existe déjà et que vous voulez créer les répertoires /current/existant/new_dir_0/ , /current/existant/new_dir_0/sub_dir_1/ , /current/existant/new_dir_0/sub_dir_1/sub_sub_dir_2/ en une seule ligne…
Read more »

Ecran noir suite à courte absence… (Plantage de gnome-screensaver)

Je dois avouer que depuis que j’utilise Linux, les gros bugs sont assez rares… Là j’ai eu le droit à un écran restant noir suite à une courte absence. En fait il s’agissait d’un petit plantage de l’économiseur d’écran…

Voilà un peu comment le truc s’est facilement arrangé de façon assez propre, sans toucher au bouton power pour rien:
Read more »

Norvège et OOXML, un exemple parmi tant d’autres?

Votre curiosité vous pousse à vous renseigner sur ce qui s’est réellement passé pour en arriver à de telles aberrations?

Si vous comprenez l’anglais, et que vous souhaitez le récit de quelqu’un plutôt bien placé dans le processus, pourquoi ne pas jeter un coup d’oeil ici?

(Franchement on peut commencer à douter sérieusement de la crédibilité des organismes de normalisation, surtout qu’on peut se demander combien se taisent dans ce genre de situations pour chaque personne qui ose parler…)

En tout cas vrai ou faux standard, je n’utilise pas!

Installation d’un pmwiki sur un 90plan (ou supérieur) d’ovh, avec décompression via tar en ssh

Cet article est plus un exemple du principe général d’utiliser tar dans une session ssh pour extraire un fichier envoyé compressé sur le serveur plutôt qu’un ensemble de fichiers décompressés via FTP.

Le titre ne veut pas dire que je destine ce blog à devenir le support non officiel des mutualisés chez ovh ou à fournir une référence détaillée sur pmwiki. Il indique juste les circonstances dans lesquelles l’exemple a été testé, sachant que dans d’autres cas des manipulations supplémentaires peuvent être à faire.

En bref, pmwiki est un système de wiki à la fois simple et léger, et n’utilisant pas de base de données.

Voici de manière détaillée la méthode que j’ai appliqué dans mon exemple précis, sachant que l’intérêt du post est plus d’illustrer mon post précédent:

  • Bien sûr, on commence par récupérer la dernière version de pmwiki sur le site officiel (cf http://www.pmwiki.org/wiki/PmWiki/Download)
  • Ensuite si on a oublié de le faire, on lit la doc sur le site et on jette un coup d’oeil au fichier README de l’archive…
  • L’archive est au bon format, on l’envoie par son moyen favori (FTP/SCP/SFTP/FTPS) et avec son logiciel favori (kftpgrabber, gftp, filezilla ou en ligne de commande…) sur le serveur. Note: dans certains cas vous aurez affaire à des logiciels dont le format de l’archive distribuée n’est pas forcément facilement extractible sur le serveur, dans ce cas décompresser et recompresser dans un autre format avant d’envoyer au serveur peut être la solution…
  • Dans le cas de l’exemple (pmwiki), on supposera par la suite que l’archive a été envoyée dans le répertoire /chemin-archive/
  • On se connecte en ssh à son serveur. Pour moi cela ressemble à ssh login@ftp.domaine.tld, puis ensuite le mot de passe (ou autre méthode d’authentification)
  • On se rend dans le répertoire de l’archive et on l’extrait: cd /chemin-archive/ ; tar -xvvf ./pmwiki-latest.tgz
  • Si tout se passe bien on peut supprimer l’archive (rm ./pmwiki-latest.tgz), déplacer le répertoire à l’endroit voulu s’il est ailleur avec mv, etc…
  • On oublie pas un logout à la fin, et surtout avant on oublie pas que l’on est sur le serveur… (Ça doit être particulièrement ennuyeux des fois un sudo shutdown -h now quand on a les droits sur une machine distante…)

Notes:

  • Très souvent les pages man seront vos amies (man nom_de_la_commande). Selon les cas il peut être préférable de les consulter en local, sur votre session ssh, ou via le web…
  • Les documentations concernant ce que vous souhaiter installer, ainsi que les docs de votre hébergeur seront aussi peut être vos références (ainsi que peut-être la fonction pour afficher les infos sur votre php)
  • Bien que c’est pas obligatoire pour pmwiki, nombreux sont les cas où vous devrez toucher à un fichier de configuration. Plusieurs options sont offertes suivant les cas: modification en local avant l’envoi de l’archive sur le serveur, nano ou vim en ssh quand c’est installé, modification du fichier et transfert, etc…
  • Pouvoir accéder à votre espace web en ssh, ce n’est pas offert à tous… (Varie suivant les offres et les hébergeurs)

De l’utilité de la commande “tar” malgré les interfaces graphiques

Pour ceux qui ne le savant pas, tar est, de façon simplifiée, le programme de référence pour manipuler quantité d’archives (compressées ou non) sous Linux et Unix en général.

Certains pensent probablement qu’avec toutes les belles applications graphiques qui existent, la manipulation de tar devient un truc superflu réservé aux geeks barbus avec une curiosité (informatique) débordante…

En fait pas tant que ça! Il y a encore des cas où ce programme peut véritablement vous être utile. Par exemple lorsque vous avez un serveur pour votre hébergement offrant FTP et SSH.

En résumer, plutôt que de passer 1 heure à uploader un dossier décompressé, vaut mieux passer 5 minutes à uploader le fichier compressé et 10 de plus pour se connecter en ssh et comprendre la page man de tar. En fait pour beaucoup on peut supprimer les 10 minutes de plus, parce que c’est pas si compliqué que ça…

Ceci dit en local sur mon propre pc, plus d’une fois je les ai utilisés ces belles interfaces graphiques!

UPDATE : exemple d’utilisation sur ce post

A small tip after a migration from blogger to wordpress (redirecting the feed)

After doing any migration from a weblog system to another, one may probably want to avoid loosing visits, right?

It’s quite easy to put messages in your old blog to say that the url of your blog has changed. The problem is that it’s not enough.

Regular viewers may access your blog through feeds. If you just post a note as another regular post and that they hadn’t the time to read it when you had post it, they may just skip it and never read your new articles.

One smart thing to do may be to redirect systematically all people trying to access your old feed to your new feed (not by a simple notice that have to be read, but by using a clean and real web redirection).

Under blogger, it’s just easy to do that: you have a feature to use another source to provide your feeds. Even if the feature was probably created with other ideas in mind (maybe allowing blogger users to use their feedburner feeds), you can use it to provide your new feed to people trying to access your old feed. Below is the exact method :

  1. Connect to blogger with your account and go to your blog main page. This should be quite easy
  2. Click on “customize” in the header and then on “settings” (in the “posts”/”settings”/”layout” menu). Note: you can access the setting page directly from your dashboard too.
  3. Click on “site feed” (in the sub-menu, between “archiving” and “email” on what I’m seeing at the time of writing this post)
  4. Find the “Post Feed Redirect URL” field in the page. There is a comment below like “If you have burned your post feed with FeedBurner, or used another service to process your feed, (…)”. Just forget the original goal and put the address of your new blog’s feed (not the address of your blog web page but the address of the feed).
  5. Valid and save the settings.
  6. It should be ok! Just test!

Free / Open Source Software : The Programmer’s Point Of View

There are many reasons to be interested in Free / Open Source Software (FOSS). Basically there are two kinds of reasons:

  1. Reasons for a user
  2. Reasons for a programmer

Of course, one should not forget that a programmer is also an user. The goal of this article is to explain a little the reasons that could explain that a programmer could be interested in open source, even in a world where a large place is given to money.
First, it is interesting to explain the term “Free / Open Source Software” (FOSS). This term combines two facts into one term about the software being considerate:

  1. It is free, in sense of freedom (and consequently often in sense of price too)
  2. It is Open Source (it meets criteria of the Open Source Definition)

In term of facts, the difference between the terms “free software” and “open source software” is often so subtle that most people wouldn’t be able to give a beginning of an explanation about it : most of the difference in the use of the terms is about philosophy.

However, this difference betweens the two terms does have its importance. Important figures of Free / Open Source Software have written about this and if you’re interested to understand, I would recommend this two links:

If you don’t know very well who are these two key figures, I’d suggest some reading about them two : understanding their philosophy is a key.

In the rest of this article, I’ll simply refer to “Free / Open Source Software” by FOSS without indicating each time subtle (or not) differences between the two way of viewing the things. I’ll rather focus on what makes a big deal: the difference between FOSS and proprietary and closed software. I’ll try to focus on it from a programmer’s point of view (although FOSS is interesting for users too).
There are many reasons for a programmer to be interested in FOSS. These reasons concerns many different aspects about FOSS:

Freedom and Social Aspect:

As Richard Stallman explained it in the GNU Manifesto, it’s natural for humans to share what they can and it should remains natural for programmers (who are users too) to share programs, without any legal barrier. Introducing barriers to prevent humans to share what they can is neither natural nor desirable.

Right for programmers to make money:

Many points about that are covered in the GNU Manifesto too. Although Richard Stallman presented some solutions to solve what may seems first to be an intrinsic problem, he didn’t covered everything (the GNU Manifesto was written some time ago). In the facts, it seems that a lot of companies have found their way to gain money making free software. Here are some facts to consider:

  • If you need to have software to do something and if you agree to pay to get a job done (ie a software to be written), in a lot of cases you don’t need the software to be closed. In fact it’s more interesting if the software is open, because every time you need you are able to choose who you want to work on it. This may be to fix bugs, to add new functionalities… Although you may prefer to use the services of the people who wrote the software (because you may appreciate their knowledge and competence), you are not too dependent of a company which may crash and don’t exist anymore, or who may have something else to do. So it may be interested for specific software buyers, i.e. people who are ready to spend money on software for their specific problems (i.e. not widespread software like office software).
  • The software may be free and support paying : that is an important fact. And a company writing recognized high quality free software is likely to benefit from its recognition to provide support and/or other products.
  • The software itself may not be the major point for people investing in its development. Google helped (and continues to help) developing Mozilla Firefox by providing money for its development. In exchange, the toolbar with search functionalities was a good way for Google to become more popular (which seemed to benefit to the users too). Google plan to make money was not based on the selling of a web browser, but on revenues generated by advertising near to search results. Google is both an example of company successful in the domain of growing fast and a company that helped a lot the development of FOSS.
  • and there are many other points about it…

So companies are able to make money with free software, so it’s easily possible to pay programmers to do the job.

Recognition/Reputation:

Doing major contributions in FOSS is clearly a way of getting recognition. Whether this recognition is a goal in itself or is seen as a way to get new better opportunities to get money, a lot of programmer contributing to FOSS are driven by the hope of getting recognized, and this hope is often realistic: FOSS offers huge opportunities for that. It’s a more open field than some other ones totally unrelated to computers (becoming a recognized artist for example is not as simple…).

By the way I’d recommend another document : Producing Open Source Software (link to appropriate chapter but the whole is interesting) by Karl Fögel.

A way to learn:

The FOSS community being more open for programmers, it’s easier for programmers to get a chance to contribute in a way they will communicate with other people interested and learn a lot. That’s another important point too.

Receiving something and giving something:

That’s a fact: humans are more inclined to give something to other people who bring them something too (whether it is consciously perceived as an exchange or not). Programmers are humans too and are not an exception to this rule. In fact, even if they have no insurance to give a “gift” to people who have “given” them interesting or useful software before, they feel as they received something from the community and then give something back to the community.

Having a real interest in what you do:

That’s a fact: people who are really interested in what they do are likely to try to do their best to improve things in their field. This is not limited to software or computer science. Great mathematicians and physicists work in this way too. FOSS is just a far more appropriate way than closed software to contribute.

“The world is full of fascinating problems waiting to be solved.” and “No problem should ever have to be solved twice.”:

These sentences came from paragraph titles of an interesting document of Eric Raymond : How To Become A Hacker (Warning: if you think that an hacker is someones who breaks other’s computer, you’re totally wrong. Please read Eric’s document before showing any concerns about that).

By reading the two quoted sentences, it’s quite obvious that FOSS is just more appropriate for that. There is just less useless barrier with FOSS to reuse what has already been done when needed to do more, to use it as a way to do what has never been done before.

Is that all?

Clearly not! Above are some important points among what I perceived, there are many others. Reading all linked document may help you to think on the subject and you may enjoy that people may share something that is not code: interesting documents.

Firefox et les onglets: petit tuyau pour ceux qui l’ignoraient encore (bouton central de la souris)

Un petit tuyau qui n’a rien de technique ni de nouveau, que je fournis tant que j’y pense (ça fait depuis pas mal de temps que je l’utilise et beaucoup connaissent déjà le truc), tout simplement parce que beaucoup l’ignorent et que c’est terriblement pratique…

Si vous avez une souris à bouton central (ou molette), sachez que vous pouvez ouvrir dans la plupart des cas un lien dans un nouvel onglet en faisant un clic du bouton central (ou de la molette) sur le lien en question (sous Firefox). C’est un gain de temps considérable par rapport à un clic droit puis à la sélection de “ouvrir dans un nouvel onglet”.

Encore une raison supplémentaire à mon gout de préférer les vraies souris à un touchpad…

Wordpress: how to break w3c’s standards (with the help of blogger)

Wordpress is a high quality software, and seems to produce w3c compliant xhtml… But…. Sometimes things may fail on your blog, in particular after an import of blogger posts!

I had to correct a post in the “edit html” mode to make the home page of the blog correct, and I’ll have to check all in order to be sure to comply with w3c standards. I know, a lot of people doesn’t care at all about standards, but the web wouldn’t be what it is without them. It’s the key to be able to read pages today and tomorrow, with the software of your choice, on the platform of your choice.

EDIT (update, on the same day): if I forgot nothing, all fixes should have been done, so don’t hesitate to tell me in case a page fail to pass the w3c checker!

Choosing a wordpress theme, not a (so) trivial task

Note: at the time you’re reading the post, maybe the theme would not be the same as now… Who knows?

I tried to look quickly for a new theme for my blog, and although there may be lot of themes, it’s not easy to choose… There are some obvious characteristics of a theme and some which aren’t…

Among first visual aspect, here are some of my criteria :

  • I want something that is quite readable, ie the size and the font should be ok.
  • I don’t want lot of pictures (part of the theme), not on this blog.
  • I prefer a two column layout, with the main one taking more than 70% of the width
  • I do have some personal preferences on the colors and shapes, too hard to describe…

Among general quality, I have other ones:

  • Of course all should pass the w3c validator.
  • The aspect should be ok after increasing two or three times the font size ([Ctrl]+[+] under Mozilla).
  • The aspect should be ok at various screen resolution and/or browser windows size.
  • It should be ok with all compliant browser and it should not be horrible under Internet Explorer (I never say IE is not horrible but the fact is that too much people use it).

Well do you think it’s too easy with so little criteria… In fact, after trying I discovered than I do have more criteria:

  • I want all widget on the right column to display correctly.
  • I want all elements on the main column to display correctly too (ie I tried a theme which don’t display tags… Really annoying, the worse is that I don’t see the problem in a few seconds…)

And here the problem comes, it seems that I have to much criteria, at least too much to make the search easy… Maybe I’ll consider writing a theme myself… Who knows?

Next Page »

HADOPI - Le Net en France : black-out