Pourquoi la crise actuelle n’est que de la pisse de chat

Vous devez voir cette conférence :

http://storage02.brainsonic.com/customers/entrecom/spie_20090702/fr/files/index.html

Le double problème de l’énergie et du réchauffement climatique sont LES problèmes majeurs que nous allons tous devoir affronter. Les problèmes bancaires d’aujourd’hui ne sont rien à l’échelle de la planète. Le challenge que l’humanité va devoir relever est superbement démontré par Jean Marc JANCOVICI, sans tomber dans l’idéologie ou le politique, c’est tout simplement factuel et scientifique.

Maintenant, vous pouvez continuer à faire comme si il y aura toujours du pétrole, toujours du gaz, toujours la même quantité de CO2, toujours le même nombre de terriens, toujours les mêmes ressources non durables et limitées, etc.

Mais ce n’est pas vrai. D’ici quelques années, le système énergétique ne peut que cartonner (nous n’avons aucune alternative valable (cf la vidéo) vu notre niveau de consommation) et le système climatique reste une épée suspendue au dessus de toutes les têtes. Une sorte de double peine, qui, dans tous les cas, aura lieu, que l’on prenne les choses en main ou pas.

La question est : fera-t-on en sorte que ça fasse plutôt moins mal que vraiment très mal ?

Edit : les PDF de présentation sont

SVN Cheat Sheet

An exhaustive SVN cheat sheet found here :

* Create a repository
– use the database backend
svnadmin create ~/svn_repos/Eccos
– use the filesystem backend
svnadmin create –fs-type=fsfs PATH

* Import a revision
svn import -m “Initial import” Eccos file:///home/reichr/svn_repos/Eccos/trunk

* Check out a revision
svn co file:///home/reichr/svn_repos/Eccos/trunk Eccos

* Dump a repository
svnadmin dump /home/reichr/svn_repos/Eccos | gzip -9 > dump.gz
svnadmin dump /home/reichr/svn_repos/Eccos | gzip -9 > `date “+Eccosdump%Y-%m-%d_%H:%M:%S.gz”`

* Load contents of a dump into a repository
gunzip -c dump.gz | svnadmin load /home/reichr/svn_repos/e

* Import from an existing directory, no need to check it out again
It should work, but you could also check it out right into /etc. Something
like this:

$ svnadmin create /var/svnrepos/admin
$ svn mkdir -m “initial setup” file:///var/svnrepos/admin/trunk
c:> svn mkdir -m “initial setup” file:///c:/fhs/svn_repos/trunk
$ cd /etc
$ svn co file:///var/svnrepos/admin/trunk .
$ svn add passwd group
$ svn commit -m “start loading it in”

I tested the ‘svn co’ into ‘.’ just now. Works great.

* svn propset
svn propset svn:keywords “LastChangedDate LastChangedRevision Id Author” weather.txt
svn propset svn:keywords “LastChangedDate LastChangedRevision Id” slides.tex

* Before an update you could use the following to get the log messages of the changes:
svn log -rBASE:HEAD

* Upgrade to a new subversion version
$ mv repos repos.tmp
$ svnadmin create repos
$ svnadmin-old dump repos.tmp | svnadmin load repos
$ # copy over any hook scripts and stuff from repos.tmp to repos

* Upgrade my repositories at work
$ mv Eccos Eccos-old
$ svnadmin create Eccos
$ gunzip -c dumps/Eccosdump2003-11-11_10:08:54.gz | svnadmin load Eccos

* Checkout from a repository over ssh
svn co svn+ssh://felix/home/reichr/svn_repos/XSteveData/trunk data

* Change the path of the repository for a working copy
svn switch –relocate file:///original/path/to/repos file:///new/path

* Put system configuration in a subversion repository
– create the repository /home/reichr/svn_repos/WaldiConfig
svnadmin create WaldiConfig
– Import an empty directory
cd to an empty directory
svn import -m “Initial import” . file:///home/reichr/svn_repos/WaldiConfig/trunk
– Check it out from Waldi (user reichr)
svn co svn+ssh://felix/home/reichr/svn_repos/WaldiConfig/trunk WaldiConfig
– Put files in the repository (as root)
mv /etc/fstab /home/reichr/WaldiConfig/etc
ln -s /home/reichr/WaldiConfig/etc/fstab /etc/fstab

* Network a repository via svn+ssh:
– create the repository on the repository host:
svnadmin create rp1 — this is located at /home/svtest/rp1
– Import data to the repository:
svn import -m”Initial import” svn+ssh://svtest@host/rp1/trunk
– Checkout the project:
svn co svn+ssh://svtest@host/home/svtest/rp1/trunk p1

* Warning:
Putting the repository on a network filesystem my be a bad idea,
because the repository may get corrupted!
It is better to put it on a local filesystem.

* Merge from a branch back to the trunk
SvnMerging

* Generate a patch to undo some local changes and redo them later
> What usually happens to me is that I’ve changed N files in M different
> directories distributed all over the filesystem, and I want to check in
> N-1 of them.

Yeah, I have to do this all the time. But I can eye a potentially
complex command-line pretty well, so if I need to commit all but one
file, I do this:

% svn diff path/to/file_not_committing > /tmp/patch.txt
% svn revert path/to/file_not_committing
% svn ci -m “committing all the stuff i wanted to”
% patch -p0 < /tmp/patch.txt Revert is your friend. Learn it, use it, looooooooooove it. * Revert to a previous version svn co project
svn ci foo.c (commits to r348)

svn merge -r348:347 foo.c
svn ci foo.c (commits 349)

note the ordering of the revision numbers in the merge command. what this
really says is “make a diff between revision 348 and 347, and apply it
immediately to foo.c”

if you are trying to revert a directory tree with moves or deletes in it, and
are getting arcane errors, try the –ignore-ancestry flag.

* Edit the commit/log messages after the commit
Read chapter 7, regarding unversioned properties attached to revisions.
You want to change the svn:log property:
$ svn propedit -r N –revprop svn:log URL

* Svn repository via apache2
– manage the htpasswd file:
http://search.cpan.org/dist/Apache-Htpasswd/Htpasswd.pm
– a sample cgi script to alter users passwords via Apache::Htpasswd:
http://perlmonks.thepen.com/178482.html
– A full featured utility to add/change users via commandline or cgi:
http://stein.cshl.org/~lstein/user_manage/

* Use svn:mime-type for nicer www browsing of a repository
> When browsing your repository, if you click on a filename, you see the
> contents of the file (assuming it’s a text file) formatted as if with a
>

 tag.  So, if the file happens to be an HTML file, you essentially see
> the source HTML code. Which, in most cases, is perfectly correct.
>
> However, there are times when it would be nice to see the _formatted_ HTML
> instead. Is there a way to do this, other than the cumbersome Save Page As
> / Open File process within the browser?

If you set the svn:mime-type property on that file to ‘text/html’ and
commit, your browser should see subsequent revisions of that file as
formatted HTML.

* Versionize symlinks, unix permissions and ownership
svnpropset.pl, svnpropget.pl from Steve Wray
(search on the svn mailing list or in my mail-boxes)

* track svn trunks/branches with all history in arch
– svn-arch-mirror
Category: svn-arch-mirror
Archive: eric@petta-tech.com–2004b-ordinary

Location: http://des.petta-tech.bogomips.org/~eric/MusicPD/eric@petta-tech.com--2004b-ordinary/

Nazis en couleur

Une collection de photos des nazis “in colour”.

On est tellement habitué à voir les documents de l’époque en noir et blanc qu’une impression étrange de proximité se dégage quand on les regarde…  une humanité perdue dans un système militarisé au plus haut niveau.

A voir pour redécouvrir une époque pas si lointaine que ça :

FireWebSSO

A new and really usefull plugin for Firefox : FireWebSSO.

SSO stands for Single Sign On… Imagine a world where you have to type only one password in your day, this is reality with FireWebSSO.

Imagine that all your bookmarks are remote synchronised whatever your computer, at home, at work, … this is also reality with FireWebSSO.

If you are interested (and you are) you can test it in experimental addons section of mozilla here : https://addons.mozilla.org/en-US/firefox/addon/10717

If you want to get more information about this plugin, visit FireWebSSO web site : www.firewebsso.com.

Le problème de l’informatique moderne

Un excellent billet de Sebsauvage qui résume très bien les problèmes de l’informatique et l’information fermées d’aujourd’hui.

http://sebsauvage.net/rhaa/index.php?2009/02/05/10/15/21-les-plaies-informatiques

Peu de gens en sont encore conscients, les politiques s’en branlent complètement (ou n’y comprennent rien) (ou sont d’accords avec ces méthodes) et les changements dans le bon sens sont longs à mettre en place… Mais ça vient, c’est quasiment acquis pour la musique (côté DRM), reste tout le boulot à recommencer pour les vidéos, les ebooks, …

How to migrate / convert MSSQL .bak into Mysql / SQL

Here are the steps to follow in order to convert a MsSql (sql server) .BAK into mysql format:

  1. you need windows
  2. download and install Microsoft SQL Server Express
  3. download and install Microsoft SQL Server Management Studio Express
  4. download and install Mysql Migration Toolkit (included in Mysql Gui Tools only in Windows package, no linux version 🙁 )
  5. configure your MSSql server to listen on TCP connexion
  6. load your .bak in SQL Serveur management studio (right clic on database, restose database, from the unit, go to options tab and set a right path for the files listed in the .bak file, launch the recovery)
  7. in Mysql Migration toolkit, follow the wizard, it should be easy

Bug dans admin sfGuardUser

Un bug semble s’être glissé dans le formulaire d’administration du plugin symfony sfGuardUser.

“The item has not been saved due to some errors.” (when you try to save the form)

The fix :

It would seem the cause of the issue is on line 44 of the sfGuardUserAdmin form class.

Removing that solves the problem.

Mark required field in a Symfony Form (sfForm) with an asterisk

How to mark required / mandatories fields in a form based on sfForm ? (solution based on Dark-IT post, adapted and tested on Symfony 1.2)
Add in your lib/form directory a class name : RegistrationForm.php (you can name it as you want of course)

class RegistrationForm extends sfForm
{
public function configure()
{
// …
}

public function render($attributes = array())
{
$formatterObj = $this->widgetSchema->getFormFormatter();
if(!is_null($formatterObj)) {
$formatterObj->setValidatorSchema($this->getValidatorSchema());
}
return parent::render($attributes);
}

public function __toString()
{
try
{
return $this->renderUsing(‘Registration’);
}
catch (Exception $e)
{
self::setToStringException($e);
// we return a simple Exception message in case the form framework is used out of symfony.
return ‘Exception: ‘.$e->getMessage();
}
}
}

Add another class in your lib/form directory : sfWidgetFormSchemaFormatterRegistration.php

class sfWidgetFormSchemaFormatterRegistration extends sfWidgetFormSchemaFormatter
{
protected
$rowFormat = “\n

%label% %error%%field%%help%%hidden_fields%”,
$requiredTemplate= ‘

*’,
$validatorSchema = null;/**
* Generates the label name for the given field name.
*
* @param  string $name  The field name
* @return string The label name
*/
public function generateLabelName($name)
{
$label = parent::generateLabelName($name);

$fields = $this->validatorSchema->getFields();
if($fields[$name] != null) {
$field = $fields[$name];
if($field->hasOption(‘required’) && $field->getOption(‘required’)) {
$label .= $this->requiredTemplate;
}
}

return $label;

}

public function setValidatorSchema(sfValidatorSchema $validatorSchema)
{
$this->validatorSchema = $validatorSchema;
}
}

Now, you can use this extended form in your form. Simply change the extends directive with :

class MyGreatForm extends RegistrationForm
{
// …
}

Of course, you have to update your css, for example :

.requiredFormField
{
color: red;
}