Macsim's Mind

Commandes en vracs

Lecteur de bande

tar zscf /dev/st0 /home #sauvegarde
tar zxvf /dev/st0 #restauration
mt -f /dev/nst0 rewind #rembobine
mt -t /dev/nst0 fsf 1 #avance d’une sauvegarde
mt -t /dev/nst0 rsf 1 #recule d’une sauvegarde
mt -t /dev/nst0 reten #retend la bande

Convertion d’un txt en .ps

a2ps fichier.txt -o fichier.ps -R –columns 1

Code couleur bash

[01;01mBrillant
[01;05mClignote
[01;07mFondGris
[01;31mRouge
[01;32mVert
[01;33mJaune
[01;34mBleu
[01;35mRose
[01;36mVertClair
[01;41mFondRouge
[01;42mFondVert
[01;43mFondOrange
[01;44mFondBleu
[01;45mFondRose

Ecrire en couleur dans bash

echo -e '33[41;33;1m TEXTE 33[m'

echo -e '33[Couleur de fond];[Couleur du texte];1m TEXTE 33[m’

Recharger les fonts TrueType

ttmkfdir > fonts.dir

Forcer l’utilisateur a taper une touche pour exécuter une commande

stty raw; dd if=$(tty) of=/dev/null bs=1 count=1;stty -raw

Retirer les ^M d’un fichier txt.

  1. cat fichier |tr -d « ^V^M » > fichier2
  2. sed -e « s/^V^M// » fichier > fichier2
  3. Dans vi :%s/^V^M//
  4. Installer dos2unix
  5. Dans vi :set notextmode

Récupérer un /tmp si il est détruit

mkdir /tmp
chmod 1777 /tmp

Bloquer l’accès à su pour le groupe wheel
dans /etc/pam.d/su
on ajoute:

auth sufficient /lib/security/pam_rootok.so debug
auth required /lib/security/pam_wheel.so group=wheel

Recréé un /dev/null

mknod /dev/null c 1 3
chmod 666 /dev/null

VN:F [1.6.2_892]
Rating: 0.0/10 (0 votes cast)

DatabaseError: file is encrypted or is not a database avec trac

tuxAujourd’hui j’ai rencontré cette charmante erreur avec trac j’ai rien trouvé en français pour résoudre le problème alors si ça peut aider les anglophobes.

Traceback (most recent call last):
File « /usr/share/trac/cgi-bin/trac.cgi », line 20, in ?
cgi_frontend.run()
File « /var/lib/python-support/python2.4/trac/web/cgi_frontend.py », line 68, in run
gateway.run(dispatch_request)
File « /var/lib/python-support/python2.4/trac/web/wsgi.py », line 87, in run
response = application(self.environ, self._start_response)
File « /var/lib/python-support/python2.4/trac/web/main.py », line 377, in dispatch_request
env = _open_environment(env_path, run_once=run_once)
File « /var/lib/python-support/python2.4/trac/web/main.py », line 51, in _open_environment
return open_environment(env_path)
File « /var/lib/python-support/python2.4/trac/env.py », line 435, in open_environment
if env.needs_upgrade():
File « /var/lib/python-support/python2.4/trac/env.py », line 315, in needs_upgrade
if participant.environment_needs_upgrade(db):
File « /var/lib/python-support/python2.4/trac/env.py », line 369, in environment_needs_upgrade
dbver = self.env.get_version(db)
File « /var/lib/python-support/python2.4/trac/env.py », line 236, in get_version
cursor.execute( »SELECT value FROM system WHERE name=’database_version’ »)
File « /var/lib/python-support/python2.4/trac/db/util.py », line 51, in execute
return self.cursor.execute(sql)
File « /var/lib/python-support/python2.4/trac/db/sqlite_backend.py », line 56, in execute
args or [])
File « /var/lib/python-support/python2.4/trac/db/sqlite_backend.py », line 48, in _rollback_on_error
return function(self, *args, **kwargs)
DatabaseError: file is encrypted or is not a database

Pour résoudre le problème:

#aptitude install sqlite

#find CHEMIN_VERS_LES_INSTANCES_TRACS -iname « trac.db » | xargs -i bash -c « mv {} {}.2; sqlite {}.2 .dump | sqlite3 {}; »

#chown www-data: CHEMIN_VERS_LES_INSTANCES_TRACS/. -R

Et ça devrait rouler.

VN:F [1.6.2_892]
Rating: 0.0/10 (0 votes cast)