Search this blog

lundi 14 novembre 2011

Windows 7 & Lenovo Ultranav TrackPoint middle click / bouton du milieu

EN: The default behaviour of the middle button of the Ultranav TrackPoint on a Lenovo ThinkPad laptop is the Scrolling feature. People like me using Firefox and Linux in a Virtual machine use very often the normal middle click. This scrolling feature is anyway available using the standard middle click in web browsers, and using one or two fingers on the TouchPad. To set the middle button to perform a normal middle click, go to Control Panel / Mouse properties / UltraNav. Click on the TrackPoint Settings. In the "Choose Scrolling or Magnifying Glass Function area" chosse "Neither" and apply the changes.

FR: Le comportement par défaut du bouton du milieu de l'Ultranav TrackPoint sur un ordinateur portable Lenovo ThinkPad est le défilement. Les personnes comme moi utilisant Firefox et Linux utilisent souvent la fonction normale de ce bouton (ex. ouvrir dans un nouvel onglet ou coller du text). Cette fonction de défilement est de toute façon disponible en utilisant le bouton du milieu standard dans un navigateur internet, et aussi en glissant 1 ou 2 doigts sur le TouchPad. Pour rétablir la fonction standard de ce bouton, ouvrir le Panneau de Configuration / Souris / UltraNav*. Cliquer sur Paramètres TrackPoint*. Dans la zone "Choisir défilement ou ...*" choisir Aucun* et appliquer les changements.


* traduit de la version anglaise ci-dessus, le texte affiché a de grandes chances d'être légèrement différent.

samedi 13 août 2011

Ubuntu 11.04 & 11.10 64bits: install and configure drivers for Canon MP540 printer

Install drivers:
sudo add-apt-repository ppa:michael-gruz/canon
sudo apt-get update
sudo apt-get install cnijfilter-mp540series

Edit configuration file:
sudo emacs /usr/share/cups/model/cnmp540.ppd

REPLACE:
*OpenUI *CNQuality/Quality: PickOne
*OrderDependency: 0 AnySetup *CNQuality
*DefaultCNQuality: 3
*CNQuality 2/High: "2"
*CNQuality 3/Standard: "3"
*CNQuality 4/Fast: "4"
*CloseUI: *CNQuality

BY:
*OpenUI *CNQuality/Quality: PickOne
*OrderDependency: 0 AnySetup *CNQuality
*DefaultCNQuality: 3
*CNQuality 2/High: "2"
*CNQuality 3/Standard: "3"
*CNQuality 4/Fast: "4"
*CNQuality 5/Economy: "5"
*CloseUI: *CNQuality

REPLACE:
*OpenUI *CNGrayscale/Grayscale: Boolean
*OrderDependency: 0 AnySetup *CNGrayscale
*DefaultCNGrayscale: False
*CNGrayscale False/No: " "
*CNGrayscale True/Yes: " "
*CloseUI: *CNGrayscale

BY:
*OpenUI *CNGrayscale/Grayscale: PickOne
*DefaultCNGrayscale: false
*CNGrayscale false/Off: "false"
*CNGrayscale true/On: "true"
*CloseUI: *CNGrayscale

Add a printer:
use the printer configuration tool and provide the path to the PPD file when required.

mercredi 27 juillet 2011

Drupal 6.22: updating modules

To update the Google Analytics 6.x-3.3 module, download the last version, decompress and replace the current directory in /var/www/drupal-sites/all/modules. This location must have only one version of the module. For example, if you rename the directory of the previous version (ex. google_analytics_old) and keep it in the same place, Drupal may not use the updated version.

jeudi 21 juillet 2011

mardi 19 juillet 2011

Ubuntu 10.10: Masquer les icônes des disques amovibles du Bureau

Pour masquer les icônes des disques amovibles du Bureau il faut utiliser GConf editor:
Tapez Alt + F2
Tapez gconf-editor et valider
Aller dans apps, nautilus, desktop
Décocher l'option volumes_visible
Les volumes sont accessibles dans le menu Raccourcis de Gnome. Un effet indésirable est que les icônes du menu Raccourcis n'acceptent pas les clics droit de la souris pour choisir "Retirer le volume sans risques". Il faut donc ouvrir le poste de travail dont les icônes acceptent les clics droit.

Source: http://www.pcastuces.com/newsletter/adj/3000.htm

mardi 5 juillet 2011

Linux: copy file without ownership

If you are user A and want to copy a file owned by user B. Using the cp command will create a new file that you may not be able to modify because ownership remain to user B. Normally, you need to be the root user to change ownership using the command chown. An easier way is to use the cp command with the  --no-preserve=ownership option that will create a destination file owned by your user. Example:
cp --no-preserve=ownership path_to_file_from_other_user path_to_destination_file

dimanche 3 juillet 2011

Thunderbird IMAP: change default folders

I was really annoyed by the default folder names used by Thunderbird (Sent, Junk, etc...) because they are different from default folders already in use in my remote webmail account (Sent Items, Spam, etc..). As I was using both Thunderbird (from work) and the webmail interface (from home), my messages were split into two sets of folders. It was really confusing. For example, emptying the trash using Thunderbird to make free space was only working on one folder and not the other, and I was not able to find sent messages because I was looking into only one folder from Thunderbird.
I previously found a way to change the default remote trash folder by changing a configuration file (see related post). It is also possible to change all default directories using a couple of clicks.

  1. Right click on the IMAP account name in the left pane and select "Suscribe..."
  2. Select default folders of the webmail account and deselect default folders created by Thunderbird.
  3. You can now associate these folders to some events in the Account Settings for the IMAP account. For example:
    1. Server Settings / When I delete a message / Move it to this folder
    2. Copies & Folders / When sending a message, automatically / Place a copy in / Other
    3. Junk Settings / Move new junk message to / Other

Windows 7 add folder to Favorites

It should be as simple as an option in a folder context menu (right-click on it) but it is not.

Method 1:
You can drag-and-drop a folder or a library to the Favorites. This is also simple but I missed it the first times I was trying.

Method 2:
1. Browse to the folder using Explorer. The full path must be fully visible and correct on the Address Bar.
3. Right-click on Favorites in the side pane.
4. Select "Add current location to Favorites" in the menu.

From: http://www.webtlk.com/2009/02/23/how-to-add-items-to-favorites-windows-7-explorer-folder/

lundi 20 juin 2011

Clean Ubuntu cache

Packages cache:
sudo aptitude autoclean 
sudo aptitude clean
User's trash folder:
rm -r -f ~/.local/share/Trash/files/*
7 days-old user's thumbnails:
find ~/.thumbnails -type f -atime +7 -exec rm {} \;
Multiple Linux kernels:
  • Identify installed kernels:
sudo dpkg -l | grep linux
  • Delete kernels not used anymore but keep installed the 2 latests. Ex. to delete kernel 2.6.32-25:
sudo aptitude purge linux-headers-2.6.32-25 linux-headers-2.6.32-25-generic linux-image-2.6.32-25-generic
Configuration files (may not work):
sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
Internet programs:

Internet browsers and email clients could use lot of disk space to store browsing history, offline data or emails. Check your programs preferences to clear automatically or manually the cache. Additionally, set a limit to the amount of space that could be used for storage. For example in Firefox 5.0 see:
  • Preferences/Privacy/Clear your recent history
  • Preferences/Advanced/Network/Offline storage/
    • Clear now
    • or Limit cache to ...

Partly from: http://www.commentcamarche.net/faq/7214-faire-le-menage-dans-ubuntu-residus-de-configuration-paquets

Disable Windows 7 automatic restart after updates

  1. Click the Start menu and type "gpedit.msc" (without quotes) in the search line and press the enter key. This will launch the Local Group Policy Editor.
  2. On the left side of Local Group Policy Editor, expand to Computer Configuration > Administrative Templates > Windows Components. Then scroll down and select Windows Update.
  3. Double click "No auto-restart with logged on users for scheduled automatic updates installations" option. In the properties window that appears, change the option from "Not Configured" to "Enabled". Click "OK" and close Local Group Policy Editor. Windows will no longer prompt you to restart after automatically installing updates.
From: http://www.ehow.com/how_5573302_disable-windows-auto-update-restart.html

samedi 7 mai 2011

Installing Unity 2D

Open the terminal and type this PPA to get unity 2d working on your desktop with Ubuntu 10.10 or Ubuntu 11.04.

sudo add-apt-repository ppa:unity-2d-team/unity-2d-daily
sudo apt-get update
sudo apt-get install unity-2d

 After the installation, all you need to do is logout/reboot and when you reach ‘Login screen’, select to boot into ‘Unity 2D’ session rather than ‘Ubuntu Desktop’ session which is by-default selection. And thats it. You are now in Unity 2D without losing anything in your Gnome 2.32 desktop or Gnome 3.

vendredi 6 mai 2011

Getting the Firefox button back in Ubuntu 11.04 with Unity

sudo apt-get remove firefox-globalmenu

vendredi 11 février 2011

Configuring CPAN.pm for installation in user directory

Installation using local::lib
  • Go to http://search.cpan.org/dist/local-lib to check the URL of the last version of local::lib
  • execute the following commands for a new CPAN installation (e.g. delete before .cpan directory if you don't care about already installed modules):
cd
wget http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
gunzip local-lib-1.008004.tar.gz
tar -xf local-lib-1.008004.tar
cd local-lib-1.008004
perl Makefile.PL --bootstrap
make test
make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
source ~/.bashrc
perl -MCPAN -eshell
o conf prerequisites_policy follow
o conf build_requires_install_policy yes
o conf commit
exit
 Then, try to install a module such as:
perl -MCPAN -e 'install XML::XQL'
perl -MCPAN -e 'install CGI::Ajax'
perl -MCPAN -e 'install Text::NSP::Measures::2D::Fisher'
See for more details: http://perl.jonallen.info/writing/articles/install-perl-modules-without-root

lundi 7 février 2011

Emacs: commenter plusieurs lignes / comment several lines

FR: M-x correspond à appuyer sur echap puis sur x et ensuite on tappe la suite...pour aller plus vite ou voir les autres commandes possible, on peut tapper M-x puis c puis sur tab (mécanisme de complétion qui élimine tout ce qui ne correspond pas à "c" et affiche le reste). Pour info, pour "décommenter", il faut utiliser "uncomment-region"
M-x comment-region
M-x uncomment-region

EN: M-x means press the ESC key then x key. Type the commands below to comment or uncomment a region of code:
M-x comment-region
M-x uncomment-region


Source: http://www.developpez.net/forums/d11811/autres-langages/perl/langage/langage-mettre-plusieurs-lignes-commentaire/


vendredi 4 février 2011

Linux: GREP recursif / recursive GREP

Combiner grep et find pour chercher une chaine de caractère dans les fichiers texte d'un dossier de façon récursive:
find . -type f -name \*.html -print | xargs grep "Texte à chercher"

Combine grep and find to search recursively text files in a folder for a text string:
find . -type f -name \*.html -print | xargs grep "Text to search"

vendredi 28 janvier 2011

EML => HTML => EPUB

EN: Rename .eml file to .mht, open it with Internet Explorer, Save as complete html web page (see type) instead of mht web archive. Finally, open the file with Calibre and convert to EPUB.

FR: Renommer le fichier .eml en .mht, ouvrir avec Internet Explorer, Enregistrer sous "Page Web Complète html" (voir  "Type") au lieu de "Archive Web mht". Importer le fichier dans Calibre et convertir en EPUB.

mercredi 19 janvier 2011

Perl, CGI and UTF-8 encoding character set

To allow UTF-8 characters on web pages created by the Perl CGI module use for example the following code:
my $q = new CGI;
print $q->header(-charset=>'utf-8');

dimanche 2 janvier 2011

Xine et Ubuntu: volume nul au démarrage

Problème: volume toujours à zéro au démarrage d'une nouvelle lecture
Solution:
  • Aller dans la configuration de Xine
  • Passer en niveau "advanced"
  • Dans l'onglet "Audio", définir "pulseaudio" comme le plug-in à utiliser
  • Juste en dessous, saisir "pulseaudio" dans le nom du moteur
  • Tout en bas, définir le volume à 100
  • Cocher la case "Se souvenir du volume"
Source: http://forum.ubuntu-fr.org/viewtopic.php?id=357466