<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Latest snippets tagged debian</title>
  <link rel="alternate" href="http://snippets.prendreuncafe.com/snippets/tagged/debian/order_by/date"></link>
  <id>http://snippets.prendreuncafe.com/snippets/tagged/debian/order_by/date</id>
  <updated>2007-02-17T12:13:33Z</updated>
  <author>
    <name>Symfony</name>
    <author_email>noreply@symfony-project.com</author_email>
  </author>
<entry>
  <title>Vérifier l'empreinte md5 d'une image ISO</title>
  <link href="http://snippets.prendreuncafe.com/snippet/58"></link>
  <updated>2007-02-17T12:13:33Z</updated>
  <id>58</id>
  <summary type="html">Avec md5sum :

[code]
$ md5sum feisty-desktop-i386.iso
[/code]

Comparer l'empreinte de l'image ISO avec celle du CD gravé :

Trouver le périphérique à vérifier :

[code]
$ cat /etc/fstab | grep cdrom
[/code]

Vérification :

[code]
$ md5sum /dev/hdb
[/code]</summary>
</entry>
<entry>
  <title>Mailer un backup mysql comme attachement en ligne de commande</title>
  <link href="http://snippets.prendreuncafe.com/snippet/55"></link>
  <updated>2007-02-09T15:50:53Z</updated>
  <id>55</id>
  <summary type="html">On va utiliser mutt :

[code]
$ sudo apt-get install mutt
[/code]

La commande (cronable) :

[code]
$ mysqldump -uroot -p --all-databases --opt \
  | bzip2 &gt; /path/to/backup/export.sql.bz2 \
  &amp;&amp; echo &quot;En date du &quot; `date` \
  | mutt -s &quot;[Nikobox] Backup MySQL total du `date | awk '{ print $2,$3,$4}'`&quot; \
  -a /path/to/backup/export.sql.bz2 you@fai.com
[/code]</summary>
</entry>
<entry>
  <title>Exclure un paquet d'un dist-upgrade</title>
  <link href="http://snippets.prendreuncafe.com/snippet/47"></link>
  <updated>2007-01-24T15:23:56Z</updated>
  <id>47</id>
  <summary type="html">Wajig permet de bloquer un paquet via sa sous-commande hold :

[code]
$ sudo apt-get install wajig
$ sudo wajig hold &lt;package_name&gt;
$ sudo apt-get update
$ sudo apt-get dist-upgrade
[/code]

Ici le paquet &lt;package_name&gt; ne sera pas mis à jour.

Avec aptitude, vous pouvez conserver un paquet en faisant :

[code]
$ aptitude hold package_name
[/code]

et enlever le drapeau « hold » avec

[code]
$ aptitude unhold package_name
[/code]
</summary>
</entry>
<entry>
  <title>Turn on Bash Smart Completion</title>
  <link href="http://snippets.prendreuncafe.com/snippet/37"></link>
  <updated>2007-01-11T13:07:14Z</updated>
  <id>37</id>
  <summary type="html">Just edit /etc/bash.bashrc

Uncomment the following lines, by removing the # in the beginning of the lines:

[code]
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
[/code]

Now, resource the modified file : 
[code]
$ source /etc/bash.bashrc
[/code]

Then try to tape apt-cache [TAB][TAB]

You will have this result in replacement of the habitual list of files and directories of your current path : 
[code]
$ apt-cache
add        dotty      dumpavail  pkgnames   rdepends   show       showsrc    unmet
depends    dump       gencaches  policy     search     showpkg    stats      xvcg
[/code]

It works with a lot of functions like cd (it will provide only directories), apt-get,...

It also enable code completion when using the sudo command.

Isn't it useful ?

Nota : The tip I give here is to activate Smart Completion for all users. If you want to activate it for only one user (or if you want to activate it but doesn't have write rights to /etc/bash.bashrc) you can modify your ~/.bashrc file and uncomment the same lines as described upper and resource it with 
[code]
$ source ~/.bashrc
[/code]</summary>
</entry>
<entry>
  <title>Downgrader un package sous Ubuntu</title>
  <link href="http://snippets.prendreuncafe.com/snippet/28"></link>
  <updated>2006-12-21T18:28:07Z</updated>
  <id>28</id>
  <summary type="html">On peut forcer la version d'un paquet à installer :

[code]
$ sudo aptitude install nomdupaquet=1.2.3-version2
[/code]</summary>
</entry>
<entry>
  <title>Changer l'éditeur par défaut sous Ubuntu</title>
  <link href="http://snippets.prendreuncafe.com/snippet/25"></link>
  <updated>2006-12-12T18:58:34Z</updated>
  <id>25</id>
  <summary type="html">[code]
$ sudo update-alternatives --config editor
[/code]

Et là, choisir vi :-)</summary>
</entry>
<entry>
  <title>Exporter et réimporter la liste des paquets installés</title>
  <link href="http://snippets.prendreuncafe.com/snippet/8"></link>
  <updated>2006-11-01T17:11:44Z</updated>
  <id>8</id>
  <summary type="html">Genre pour reproduire la config d'un ancien serveur vers un nouveau serveur.

Export :

[code]
$ sudo dpkg --get-selections &gt; selections.txt
[/code]

Réimportation :

[code]
$ sudo dpkg --set-selections &lt; selections.txt
[/code]

Réinstallation des paquets :

[code]
$ sudo apt-get dselect-upgrade
[/code]
</summary>
</entry>
</feed>