mardi 21 août 2007

Primary screen with twinview

Avec un portable, c'est partique que l'écran principal soit celui du portable :-)
j'ai trouvé ici : http://gentoo-wiki.com/Twinview_Example#Twinview_device_order
comment spécifier cela dans le fichier de configuration xorg.conf
et cela donne ça :
Option "TwinViewXineramaInfoOrder" "DFP-0"



Par contre gnome a toujours du mal avec le desktop et il y a toujours une "zone morte" inaccessible où il range malgré tout des icones :-/

mercredi 11 juillet 2007

gmail hacks

Better Gmail
https://addons.mozilla.org/en-US/firefox/addon/4866

Sound off // Mute speakers

http://ubuntuforums.org/showthread.php?t=126746




  • xset b off
    xset b 0 0 0




  • Dans "~/.inputrc" :

    set bell-style visible



  • (autre méthode dans un fichier du /etc/ mais plus sous la main.

mercredi 20 juin 2007

Convertir des pages en jpeg vers du pdf

(Utile en particulier pour les annales)


Voici comment passer d'un ensemble de fichiers en JPG a un unique fichier pdf avec convert (l'outil a tout faire de la lib 'imagemagick' )

$ for i in P116080*.JPG ; do convert "$i" `basename $i JPG`pdf; done
$ for i in P116080*.pdf ; do convert "$i" `basename $i pdf`ps; done


Puis :

  • soit :
    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -f *.ps


  • soit

    $ psmerge P116080*.ps > test.ps
    $ ps2pdf test.ps


Evidement, il faut adapter les noms de fichiers. Par contre il ne faut pas passer directement du JPG au PS, cela ne passe pas (sans msg d'erreur, mais cela ne convertira qu'un morceau de la page).


Par exemple :

for i in exam_* ; do convert "$i" `basename $i jpeg`pdf; done ; for i in *.pdf ; do convert "$i" `basename $i pdf`ps; done ; gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -f *.ps

lundi 21 mai 2007

Truander les citations...

Truander les citations

c'est a dire faire apparaître toutes les citations presentes dans votre bib file, qu'elles soient utilisées ou non.

grep -e @[A-Za-z]*{ biblio.bib | awk -F '{' '{print $2}' \
| awk -F ',' '{print "\\nocite{" $1"}" }'
Il est possible qu'il faille enlever la première référence. Un conseil : ne pas utiliser l'option "backpageref" du package hyperref si l'on ne souhaite pas indiquer que certains papiers référencés ne sont en fait pas cités.

dimanche 20 mai 2007

gThumb web album theme

Since I couldn't find it anywhere on the web, I had a look at the source package of gThumb, and I found some documentation about how to customize a "web album theme", a very useful feature within gThumb.


So, this is from /gthumb-2.10.1/doc/ :


EXPR:
EXPR + EXPR
EXPR - EXPR
EXPR * EXPR
EXPR / EXPR
EXPR && EXPR
EXPR || EXPR
- EXPR
+ EXPR
! EXPR
( EXPR )
EXPR == EXPR
EXPR != EXPR
EXPR <= EXPR
EXPR >= EXPR
EXPR < EXPR
EXPR > EXPR
NUMBER
RVAR

NUMBER:
unsigned integer number

RVAR (Readable Variables):
images (integer) Total number of images being exported
image_idx (integer) Index of current image
pages (integer) Total number of index pages being generated
page_idx (integer) Index number of current index page
display_file_name_thumbnail
display_file_name_image
image_width
image_height
preview_width
preview_height
thumb_width
thumb_height
copy_originals (boolean) Original images are being copied to the web
album output directory
comment_visibility_image (bool) Show comments on preview pages
comment_visibility_index (bool) Show comments on index pages
place_visibility_image (bool) Show place on preview pages
place_visibility_index (bool) Show place on index pages
date_time_visibility_image (bool) Show date and time on preview pages
date_time_visibility_index (bool) Show date and time on index pages
file_name_visibility_image (bool) Show file name on image pages
file_name_visibility_index (bool) Show file name on index pages
image_dim_visibility_image (bool) Show image dimensions on image pages
image_dim_visibility_index (bool) Show image dimensions on index pages
file_size_visibility_image (bool) Show file size on image pages
file_size_visibility_index (bool) Show file size on index pages
exif_date_time_visibility_image (bool) Show date and time (from exif
data) on image pages
exif_date_time_visibility_index (bool) Show date and time (from exif
data) on index pages
exif_exposure_time_visibility_image (bool) Show exposure time on image pages
exif_exposure_time_visibility_index (bool) Show exposure time on index pages
exif_exposure_mode_visibility_image (bool) Show exposure mode on image pages
exif_exposure_mode_visibility_index (bool) Show exposure mode on index pages
exif_flash_visibility_image (bool) Show flash mode on image pages
exif_flash_visibility_index (bool) Show flash mode on index pages
exif_shutter_speed_visibility_image (bool) Show shutter speed on image pages
exif_shutter_speed_visibility_index (bool) Show shutter speed on index pages
exif_aperture_value_visibility_image (bool) Show aperture value on image pages
exif_aperture_value_visibility_index (bool) Show aperture value on index pages
exif_focal_length_visibility_image (bool) Show focal length on image pages
exif_focal_length_visibility_index (bool) Show focal length on index pages
exif_camera_model_visibility_image (bool) Show camera model on image pages
exif_camera_model_visibility_index (bool) Show camera model on index pages

WVAR (Writable Variables):
thumbnail_width (integer) Output thumbnails of this width
thumbnail_height (integer) Output thumbnails of this height
preview_width (integer) Output preview images of this width
preview_height (integer) Output preview images of this height

---

<gthumb:title/> Display the album title.

<gthumb:image/> Display the image.
idx="EXPR"
idx_relative="EXPR"
thumbnail="0/1" Display the image thumbnail (the
image used in the index.html file).
preview="0/1" Display the image preview (the
image in the image.html file).
max_size="EXPR"
class="NAME" Assign CSS class NAME to image element
id="NAME" Assign CSS id NAME to image element
alt="TEXT" Assign alt text TEXT to image element

<gthumb:image_link/> Display the image link
idx="EXPR"
idx_relative="EXPR"
thumbnail="0/1" Display the image thumbnail link
preview="0/1" Display the image preview link

<gthumb:image_idx/>
idx_relative="EXPR"

<gthumb:image_dim/>
idx="EXPR"
idx_relative="EXPR"

<gthumb:images/> This tag gets substituted by the total
number of images.

<gthumb:file_name/>
idx="EXPR" Display the filename of the image with
index 'idx'.

idx_relative="EXPR" Display the filename of the image with
index 'current_index + idx_relative'.
For example if idx_relative is -1 the
filename of the previous image will be
displayed.

with_path="0/1" Display the full image path instead of the
filename only.
For example '/home/joe/images/foo.jpg'
instead of 'foo.jpg'

with_relative_path="0/1" If with_path == 0 display the path relative
to the destination path.
For example if the image path is
'/home/joe/images/foo.jpg' and the index is
saved as '/home/joe/public_html/index.html'
then this tag will be substituted by
'../images/foo.jpg'

visibility="index/image/always" Choose when to display this information:
index: Display this tag if the user
chosen to display the filename
in the index caption.
image: Display this tag if the user
chosen to display the filename
in the image caption.
always: Always display this tag
regardless of what the user
chosen to display.

utf8="0/1" Write in utf-8 format

<gthumb:file_path/>
idx="EXPR"
idx_relative="EXPR"
relative_path="0/1"
visibility="index/image/always"
utf8="0/1"

<gthumb:file_size/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:comment/> Display the comment for an image
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:place/> Display the place where an image was taken
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:date_time/> Display the time when an image was taken
idx="EXPR"
idx_relative="EXPR"
max_size="EXPR"
visibility="index/image/always"

<gthumb:exif:exposure_time/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:exposure_mode/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:flash/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:shutter_speed/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:aperture_value/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:focal_length/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:date_time/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:exif:camera_model/>
idx="EXPR"
idx_relative="EXPR"
visibility="index/image/always"

<gthumb:page_link/>
idx="EXPR"
idx_relative="EXPR"
image_idx="0/1"

<gthumb:page_idx/>
idx_relative="EXPR"

<gthumb:pages/>

<gthumb:table/> Output thumbnail blocks (thumbnail.gthtml)
inside an HTML table

<gthumb:thumbs/> Output thumbnail blocks (thumbnail.gthtml)
without a surrounding table structure

<gthumb:date/>

<gthumb:set_var WVAR="EXPR" WVAR="EXPR" [..] />


---

<gthumb:text> Localized text. You need to add the same
[TEXT] text in the data/albumthemes/text.h file.
</gthumb:text>

---

<gthumb:if EXPR/>
[HTML]
<gthumb:else_if EXPR/>
[HTML]
<gthumb:else_if EXPR/>
[HTML]
.
.
.
<gthumb:else_if EXPR/>
[HTML]
<gthumb:else/>
[HTML]
<gthumb:end/>

---

<gthumb:eval/>
idx=EXPR
idx_relative=EXPR
expr=EXPR Insert result of expression, maybe applied
against given image info

vendredi 18 mai 2007

man 2

Sous feisty fawn (ubuntu) les man pages de la section 2 ("system calls") sont dans le paquet
manpages-dev
ca peux servir... ;-)

Find file encoding

Trouver l'encodage d'un fichier :

file --mime filename
Par exemple :
$ file filename.tex
filename.tex: LaTeX 2e document text
cm$ file --mime filename.tex
filename.tex: text/plain; charset=iso-8859-1

lundi 14 mai 2007

flv to avi

Convert .flv to .avi
mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4 -o output.avi input.flv

jeudi 10 mai 2007

Phone issue wammu bluetooth synchro

Bon... je vais maintenant passer à une phase de test "autre", mais j'ai enfin réussi a faire communiquer wammu et mon téléphone mobile en bluetooth. 
 Je pense qu'il est nécessaire de lancer un service que je n'ai pas identifié encore, mais qui est lancé au démérrage, automatiquement. 

 Une hypothèse envisagée sur ce problème de "pairing" est la synchro de plusieurs services, dont le bluetooth. 
Et peut-être dbus (?). 

En tout cas, le problème se situait du côté de l'échange de clef, et du lancement du passkey-agent et de l'applet bluetooth-applet permettant d'indiquer la clef qui doit être échangée entre les deux devices connectés en bluetooth (le laptop et le mobile en l'occurence).