Rechercher dans ce blog

samedi 25 avril 2009

files directory listing to html page with hyperlinks - perl script

Petit script que j'ai écrit pour créer une page htlm qui liste les entrées d'un répertoire et crée les liens vers les fichiers.

C'est un script perl rudimentaire mais qui fait ce dont j'avais besoin. Avant de l'écrire je me suis beaucoup énervé à chercher sur le net un script aussi basique et élémentaire sans rien trouver !

#!/usr/bin/perl # Script pour lister sur une page html les entrees d'un repertoire # avec hyperliens vers les fichiers # Version 0.1 - 2009_04_25 # Le href pointe toujours vers un path relatif au dir qui contient les # fichiers listes. La page html doit donc etre placee dans le meme # dossier que les fichiers sur le serveur. @ARGV or die "Usage : %dir2html somedir > liste.html\n"; $some_dir = shift @ARGV; opendir ( DIR, $some_dir ) || die "can't opendir $some_dir: $!"; # Formatage avec des paragraphes plutot que liste a bulle #@dots = map "<p><a href=\"$_\">$_<\/a><\/p>", grep ! /^\./,   readdir ( DIR ) ; # Formatage en liste # J'exclus de la liste de sortie par un simple grep html|htm la page generee # et donc du meme coup tous les fichiers avec ces extensions @dots = map "<li><a href=\"$_\">$_<\/a><\/li>^M", grep ! /.htm ( l ) ?$/, grep ! /^\./,   readdir ( DIR ) ; closedir DIR; print <<EOF; <html> <head>   <meta content="text/html; charset=UTF-8" http-equiv="content-type">   <title>Liste des fichiers du repertoire $some_dir </title>   <meta name="robots" content="noindex, nofollow, noarchive"> </head> <body> <ul> EOF print @dots; print <<EOF; </ul> </body> </html> EOF

jeudi 16 avril 2009

ffmpegX Tip - Codec type mismatch

extract from 

http://youmakemedia.com/2007/03/26/ffmpegx-tip-codec-type-mismatch/

Thanks to the author : Chris

ffmpegX is one of the most useful tools in a content producer’s arsenal. It’s fast, easy, and powerful beyond belief. Unfortunately, it has the occasional error that may make you scream! When a client needs a video in a certain format and you are getting error messages, it isn’t fun.

One such error that I frequently encounter (especially when converting files to Flash Video) is this one: Codec type mismatch for mapping #0.0 -> #0.0 See, normally video comes before audio in the layout and organization of a multimedia file. Sometimes though (and it’s happening more frequently), codec creators are switching things up for a bit of fun. They’re putting the audio first. I can only assume it’s somehow related to compression - but this switch causes ffmpegX to freak out and cease encoding. Luckily, this is a one check-box fix. Simply open your file and navigate to the audio tab. Then check the box titled “Invert Mapping”. This will let ffmpegX know about the alternate structure of your file, and make the appropriate changes. Below is a screenshot that highlights the audio tab with Invert Mapping selected. Traditional FFmpeg, for *NIX platforms, offers this feature as well, albeit in a more complex manner. From the official documentation: You can encode to several formats at the same time and define a mapping from input stream to output streams: ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0 Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. ‘-map file:index’ specifies which input stream is used for each output stream, in the order of the definition of output streams.

mercredi 15 avril 2009

Gnumeric mac os X installer / désinstaller - macport

#port install gnumeric

########################################################### # A startup item has been generated that will aid in # starting dbus with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo launchctl load -w /Library/LaunchDaemons/org.macports.dbus.plist ########################################################### ############################################################################## # It is absolutely necessary for dbus enabled programs to work to execute # # launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist # # once for every user. Don't use 'sudo', else it will work only for root! # You also have to unload it before deactivating/uninstalling this software! ############################################################################## ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.1.2/catalog.xml". ###################################################################### ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.2/catalog.xml". ###################################################################### ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.3/catalog.xml". ###################################################################### ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.4/catalog.xml". ###################################################################### ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.5/catalog.xml". ###################################################################### ###################################################################### # As MacPorts does not currently have a post-deactivate hook,  # you will need to ensure that you manually remove the catalog  # entry for this port when you uninstall it. To do so, run  # "xmlcatmgr remove nextCatalog /opt/local/share/xsl/docbook-xsl/catalog.xml". ######################################################################

gnumeric most recent diff

version 1.9.0 View the most recent changes for the gnumeric port at: gnumeric.darwinports.com/diff Scroll down toward the bottom of the page to get installation instructions for gnumeric. The raw portfile for gnumeric 1.9.0 is located here: http://gnumeric.darwinports.com/dports/gnome/gnumeric/Portfile Find related portfiles with the unique DarwinPorts.com search feature. Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/gnumeric  PortSystem 1.0 Name: gnumeric Version: 1.9.0 Description: A spreadsheet with gnome support. Long Description: ${description} Maintainers: nomaintainer Category: gnome math Platform: darwin Homepage: http://www.gnome.org/projects/gnumeric/

mercredi 17 décembre 2008

lynx permettre de sauver force_ssl_prompt=yes dans lynx.cfg

UBUNTU linux lynx SSL_PROMPT

vi /etc/lynx.cfg

Modifier

ENABLE_LYNXRC:force_cookie_prompt:ON
ENABLE_LYNXRC:force_ssl_prompt:ON

Chaque user peut alors sauver le réglage via commande O dans lynx
Réglage est conservé dans .lynxrc dans /home de chaque user


-

lundi 15 décembre 2008

mailx et mutt gardent mail lu dans /var/mail/user

Pour ne pas que les mails lus aillent dans mbox

/etc/mail.rc

set hold

/etc/Muttrc.d/ < vi nomove.rc < set no move

linux ubuntu postfix canonical_sender

postfix

/etc/postfix/canonical_sender

# root root admin@host.net # 0tt0 otto 0tt0@host.net

Modifications des fichiers via webmin

Address rewriting

rewrite user to user@domaine NO

setting fetchmail daemon

-rw-r--r-- 1 root root 328 2008-06-06 00:34 fetchmail /etc/default/fetchmail

# Declare here if we want to start fetchmail. 'yes' or 'no' START_DAEMON=yes

chmod 600 /etc/fetchmailrc

-rw------- 1 fetchmail root 2839 2008-10-27 15:31 /etc/fetchmailrc

/etc/fetchmailrc

set daemon 600 set no syslog poll "pop.skynet.be" protocol pop3 uidl timeout 120

#user  username "user" password "password" mimedecode pass8bits forcecr is unixuser # gmail accounts poll "imap.gmail.com" protocol imap timeout 120 username "login@gmail.com" password "password" ssl mimedecode keep pass8bits forcecr is unixuser -