21/04/2013 à 14:04:08 - Aucun commentaire
Comment extraire la piste audio d'un DVD ?
Paquet: transcode
Description : Text console video-stream processing tool
transcode -i /dev/dvd1 -x dvd -T 1,1,1 -a 1 -y wav -m sortie.wav
07/11/2012 à 12:18:13 - Aucun commentaire
Comment afficher simplement un nœud Drupal avec drush ? Avec drush php-script !
On créée un fichier nodedump.php, qui contient:
<?php
$id = drush_get_option('id');
$node = node_load($id);
print_r($node);
?>
Et on affiche le dump avec:
drush php-script nodedump --id=1
02/10/2012 à 17:45:39 - Aucun commentaire
This Supybot/Limnoria plugin allows to display informations about Redmine issues and direct links to them.
How to install:
The informations are fetched from Redmine through it's Rest API, so you will need to install Restkit (package python-restkit on Debian).
How to configure:
It is based on the Mantis/Bugzilla plugins, so it uses the same command and more or less the same configuration variables:
* urlbase: The base URL for the Redmine instance this plugin will retrieve bug informations from.
* apikey: Your Redmine API key. The Rest API must be enabled in Redmine in Administration -> Settings -> Authentication. You can then get your API Key on your account page ( /my/account ) when logged in, on the right-hand pane of the default layout.
* bugMsgFormat: Change the message format for bug details, following tokens will be replaced before being printed: _ID_, _URL_, _AUTHOR_, _CATEGORY_, _SUBJECT_, _STATUS_ . _CRLF_ will split the response in two (or more) lines.
* bugSnarfer: Determines whether the bug snarfer will be enabled, such that any bug ### seen in the channel will have its information reported into the channel. Channel Specific variable.
* bugSnarferTimeout: Users often say "RM XXX" several times in a row, in a channel. If "RM XXX" has been said in the last (this many) seconds, don't fetch its data again. If you change the value of this variable, you must reload this plugin for the change to take effect.
How to use:
Once the plugin is loaded and (at least) urlbase and apikey are set, you can display informations about a Redmine issue with the "bug #" command, where # is the issue number.
If you enable the bugSnarfer variable for a given channel, you won't need using the "bug" command anymore, just write "RM #", and the bot will automatically display informations about the issue.
Available on github: https://github.com/veggiematts/supybot-redmine
30/09/2012 à 22:26:20 - Aucun commentaire
Problématique: quand j'écoute de la musique chez moi, je n'entends pas toujours la sonnette. Contexte: j'ai acheté un Raspberry Pi sans trop savoir ce que j'allais en faire. Résultat: une sonnette améliorée !
Le matériel
Un Raspberry Pi avec Raspbian comme système d'exploitation.
Une Webcam qui trainaît dans un tiroir (en l'occurence un EyeToy de Playstation 2, qui fonctionne directement sous Raspbian).
Le résultat
La webcam est branchée sur le Raspberry Pi, et est pointée en direction de la porte d'entrée, au travers d'une fenêtre adjacente à celle-ci. Quand quelqu'un se présente devant ma porte d'entrée, l'évènement est détecté, et une notification s'affiche directement sur mon bureau KDE.
La mise en place
Motion est utilisé pour détecter les mouvements.
Il se configure dans /etc/motion/motion.conf. Pour éviter les faux-positifs, j'ai modifié les paramètres suivants:
threshold 3000
lightswitch 70
Pour pouvoir me connecter au flux vidéo depuis mon portable:
webcam_localhost off
Pour lancer la notification quand un évènement est détecté:
on_event_start /home/motion/bin/motionnotify.sh
Une fois l'évènement détecté, la commande notify-send (du paquet libnotify-bin) permet d'afficher la notification.
Notify-send ne fonctionnant qu'en local, les scripts python suivants permettent de l'utiliser en réseau:
http://ubuntuforums.org/showthread.php?t=1222502
Le client (/home/motion/bin/notifyclient.sh):
#!/usr/bin/env python
#network notify-send
import socket
import sys
host = '192.168.1.10' #server IP
port = 50000
size = 1024
title = sys.argv[1]
message = sys.argv[2]
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
s.send('\"' + title + '\" \"' +message+'"')
data = s.recv(size)
s.close()
Le serveur (/home/utilisateur/bin/notifyserver.sh):
#!/usr/bin/env python
# Network Listener for notify-send
import socket
import os
host = ''
port = 50000
backlog = 5
size = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host,port))
s.listen(backlog)
while 1:
client, address = s.accept()
data = client.recv(size)
if data:
client.send(data)
cmd = 'notify-send ' + data
os.system(cmd)
client.close()
Un petit script qui va appeler le client, avec un lien vers le flux vidéo, pour voir qui se trouve devant la porte (/home/motion/bin/motionnotify.sh):
#!/bin/sh
logger "Motion detected"
/home/motion/bin/notifyclient.sh "Porte" "Il y a quelqu'un à la porte.\<br /\>\<br /\>\<a href=\"http://raspberry.local:8081\"\>Voir le flux\</a\>"
Motion crée un utilisateur "motion", le script doit donc être exécutable par cet utilisateur.
Et voilà, je peux écouter de la musique très fort :)
24/08/2012 à 08:07:13 - Aucun commentaire
A DuckHunt game for supybot. Shoot allllllllllllllllllllllllll the ducks!
How to play
* Use the "start" command to start a game.
* The bot will randomly launch ducks. Whenever a duck is launched, the first person to use the "bang" command wins a point.
* Using the "bang" command when there is no duck launched costs a point.
* If a player shoots all the ducks during a hunt, it's a perfect! This player gets extra bonus points.
* The best scores for a channel are recorded and can be displayed with the "listscores" command.
* The quickest and longest shoots are also recorded and can be displayed with the "listtimes" command.
* The "launched" command tells if there is currently a duck to shoot.
How to install
Just place the DuckHunt plugin in the plugins directory of your supybot installation and load the module.
How to configure
Several per-channel configuration variables are available (look at the "channel" command to learn more on how to configure per-channel configuration variables):
* autoRestart: Does a new hunt automatically start when the previous one is over?
* ducks: Number of ducks during a hunt?
* frequency: Determines how often a duck will be launched. 0 means that no duck will ever be launched. 1 means that a ducks will be launched one after another.
* minthrottle: The minimum amount of time before a new duck may be launched (in seconds)
* maxthrottle: The maximum amount of time before a new duck may be launched (in seconds)
Available on github: https://github.com/veggiematts/supybot-duckhunt
04/07/2012 à 22:29:16 - Aucun commentaire
Je suis un peu surpris qu'en 2012 il n'existe pas de moyen simple d'exporter un compte Thunderbird d'une ancienne version de Windows vers une plus récente.
Dans mon cas, il s'agit de transférer un compte de XP vers Seven. Pour ceux qui cherchent comment faire:
1. Install Thunderbird.
2. Go to C:/Users/[user name]/AppData/Roaming/Thunderbird/[delete all files and directories].
3. Go to C:/Users/[user name]/AppData/Local/Thunderbird/[delete all files and directories].
4. From the XP Thunderbird folder that you saved from Windows XP; Copy [Profiles directory, Profiles.ini and registry.dat] to Go to C:/Users/[user name]/AppData/Roaming/Thunderbird/.
5. Start up Thunderbird. It will ask you some questions, say OK and you are good to go.
Source:
http://www.sevenforums.com/software/28883-transfer-thunderbird-profile-xp-7-a-2.html
25/05/2012 à 17:20:50 - Aucun commentaire
Dans l'interface de configuration de Tiny Tiny RSS, onglet flux, il y a une rubrique "Intégration à Firefox" qui permet d'ajouter automatiquement Tiny Tiny RSS à la liste des gestionnaires de flux de Firefox. Ainsi, Tiny Tiny RSS sera proposé lorsqu'on souhaitera s'abonner à un flux RSS. Or, il n'existe pas d'option équivalente pour Chrome/Chromium.
Mais alors, comment faire ?
Déjà, Chrome/Chromium ne détecte pas les flux RSS présents dans une page, et ne propose donc pas à l'utilisateur de s'y abonner. Pour remédier à cela, on peut installer l'extension Abonnement RSS.
Ensuite, dans les options de cette extension, on peut ajouter un gestionnaire de flux.
L'URL à renseigner pour Tiny Tiny RSS est de la forme :
http://your.site.dom/tt-rss/backend.php?op=pref-feeds&subop=add&feed_url=%s
Où your.site.dom/tt-rss/ est à remplacer par l'URL et répertoire de votre serveur Tiny Tiny RSS.
26/04/2012 à 11:30:45 - Aucun commentaire
Le thème utilisé par ce blog : SimpleBlack
Ce thème est placé sous licence Creative Commons Paternité - Partage à l'identique (BY - SA) : http://creativecommons.org/licenses/by-sa/2.0/fr/
Réalisé pour la version 34 de Blogotext.
25/04/2012 à 11:52:46 - Aucun commentaire
Si votre appareil photo numérique ou votre téléphone portable disposent d'un capteur de gravité, ils sont capables d'enregistrer cette information dans les méta-données de la photo au moment de la prise de vue.
Il est donc possible, en utilisant cette information, d'appliquer automatiquement une rotation aux photos qui le nécessitent, afin que celles-ci s'affichent correctement en toutes circonstances.
En effet, certains logiciels prennent en compte les méta-données exif d'orientation, et appliquent donc la rotation adéquate à la volée pour l'affichage, alors que d'autres non.
En effectuant la rotation "en dur" une bonne fois pour toutes, on est sûr que la photo s'affichera correctement, quel que soit le type de logiciel utilisé.
Commençons par vérifier que l'appareil photo utilisé inscrit bien les méta-données relatives à l'orientation de la prise de vue. On peut utiliser pour ça le paquet exif, qui permet d'afficher les meta-données exif d'une ou plusieurs photos:
Pour une photo prise en paysage, on a normalement:
Orientation |Top-left
Pour une photo prise en portrait, on doit avoir une valeur différente:
Orientation |Right-top
À noter que sur un de mes appareils n'ayant pas de capteur de gravité, le tag Orientation n'est pas vide, il contient toujours la valeur "Top-left", quel que soit le mode de prise de vue.
Une fois que l'on s'est assuré que l'orientation est bien supportée par l'appareil, on peut utiliser exiftran (du paquet exiftran) ou exifautotran (du paquet libjpeg-progs) pour effectuer la modification automatiquement :
exiftran -ai *.jpg
ou
exifautotran *.jpg
On se rend compte ensuite que la rotation adéquate a été appliquée et que tous les tags Orientation ont été resettés à la valeur Top-left. Ceci est voulu, afin d'éviter qu'un logiciel prenant en compte les méta-données d'orientation ne réapplique une rotation superflue et indésirable à l'affichage.
Plus d'informations sur le tag exif orientation (en anglais):
Exif Orientation Page
JPEG Rotation and EXIF Orientation
19/04/2012 à 13:09:16 - Aucun commentaire
J'ai longtemps cherché un outil en ligne de commande pour supprimer l'image éventuellement incluse dans un fichier mp3 (le plus souvent la pochette de l'album).
Paquet : eyed3
Description : Affiche et permet la manipulation des marqueurs id3-tags depuis la ligne de commande
eyeD3 --remove-images *.mp3
site web: http://eyed3.nicfit.net/