How to: Copy and Paste highlighted and intented source code in Open Office

Maybe you have some repport due, where few lines of code are needed, but Open Office Writer doesn’t handle .c source file, neither .py, .m
The solution:

sudo apt-get install highlight

gedit “~/.gnome2/nautilus-scripts/Highlight and open with OOO”

#!/bin/bash
#
highlight -o /tmp/highlight_temp_file.html $*
openoffice /tmp/highlight_temp_file.html
rm /tmp/highlight_temp_file.html

chmod +c “~/.gnome2/nautilus-scripts/Highlight and open with OOO”

And now, any right clic on a file, and it’s opened in OOO with nice colors.

Hercules Deluxe Webcam :compiling drivers for Ubuntu 8.10

Here again we are facing a crappy hardware with homebrewed drivers, not integrated: sunday morning, let’s compile something.
That’s a translated how to from here

Unplug the webcam

lsmod | grep ov

to check if any module is loaded, and remove it

sudo rmmod gspca_ov519sudo rm -r/lib/modules/`uname -r`/kernel/ubuntu/misc/media/ov511

sudo rm /lib/modules/`uname -r`/kernel/drivers/media/video/gspca

So let’s download the drivers’ sources:

wget http://www.rastageeks.org/downloads/ov51x-jpeg/ov51x-jpeg-1.5.9.tar.gztar -zxwf ov51x-jpeg-1.5.9.tar.gz

cd ov51x-jpeg-1.5.9/

sudo apt-get install build-essential linux-headers-`uname -r`

make

sudo make install

sudo modprobe ov51x-jpeg

echo “options ov51x-jpeg forceblock=1” | sudo tee -a /etc/modprobe.d/options

echo “options ov51x-jpeg force_palette=13” | sudo tee -a /etc/modprobe.d/options

tail -f /var/log/syslog | grep “ov51x”

and plug the webcam, something close to this should appears:

kernel: [324189.288878] ov51x_jpeg: USB OV519 video device found
kernel: [324189.656291] ov51x_jpeg: Sensor is an OV7648
kernel: [324189.758541] ov51x_jpeg: Device at usb-0000:00:1d.1-2 registered to minor 1

(control+c to quit)

gstreamer-properties

and the webcam shoud show up

If not, check the rights:

ls -l /dev/video*
crwxrwxrwx+ 1 root video 81, 0 2009-01-14 20:03 /dev/video0
crw-rw—-  1 root video 81, 1 2009-01-18 14:10 /dev/video1

The first one is good, but not the second webcam, only video access, so to correct it: create a simlink at the module initialisation:

sudo gedit /etc/udev/rules.d/80-programs.rules

And add this line:

KERNEL==”video[0-1]”, NAME=”video%k”, SYMLINK+=”%k”, MODE=”0666″

Restart the service

sudo /etc/init.d/udev restart

now check it works fine:

mplayer tv:// -tv driver=v4l:width=640:height=480:device=/dev/video0

Now you end up with a perfectly working webcam, it’s time to check out the new cross plateform opensource webcam instant messaging:a
http://www.qutecom.org/

(And to drop Skype)

Ubuntu 8.10 avec impots.gouv.fr: Télédéclaration 0.0.1AlphaRC

Bonjour, comme beaucoup d’entre vous, il faut payer nos taxe.

Internet est la pour nous aider, rendre les chose plus faciles (ou pas)

J’assume que comme moi, vous avez Ubuntu 8.10 avec Firefox 3.x

En bon contribuable que vous etes, vous vous rendez sur cette page:

http://www.impots.gouv.fr 

Puis tranquilement, abonnez vous:

screenshot-1.png

On rentre notre N° fiscal (5 min pour le trouver sur la feuille)
screenshot-2.png

Au passage, j’ai aussi mis 5 min à trouver sur cette meme feuille la date limite de payment: ces année de surf ayant surdéveloppé mon sens à filtrer :

CE QUI EST ECRIT EN ROUGE ET EN CAPITALE EN PLEIN MILIEU (VOUS AVEZ GAGNE!!!!!!!!!!!!) bref un manque d’érgonomie totale.

Revenons donc à notre télédéclaration 0.0.1AlphaRC.

Vous rentrez votre numéro, et un test de votre systeme est effectué avec un résultat proche de celui ci:

screenshot-3.png

Donc, dans les option, on va bien activer le Javascript, en enlevant les exeption (redimensionnement etc….)

Mais toujours la meme chose, leur site web disent: Linux (mandriva) avec FF 2 ou supp:

screenshot-4.png

Pendant un moment, j’ai osé espéré que mandriva était juste pour bien faire comprendre que c’etait bien de linux dont on parlait. MAIS NON, IL FAUT mandriva ou FF 2 mais pas 3
Bref, on installe  Agent Switcher histoire de lui faire croire ce qu’il veut.

Et on rajoute l’identification de mandriva avec ff de la bonne version:

screenshot-5.png

User agent :
Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.7.8) Gecko/00000000 Firefox/1.0.4

Puis séléctionnez le dans Outils>User Agent>Mandriva. et effectuez un nouveau test. Au fait, à chaque test, le site store le résultat sur un cookie, donc, il faut les supprimer pour voir un changement:

screenshot-6.png

En cliquant sur l’icone à gauche de l’URL, on accede au parametre du site web, et supprimez les cookies stored.

Normalement, ca marche toujours, pas, il faut java5 et non le 6 donc:

sudo apt-get install sun-java5-plugin

Et la encore, ca marche toujours pas, il faut etre en langue francaise, si votre systeme utilise une autre langue:

sudo apt-get install language-support-fr
export LANG=fr_FR.UTF-8
sudo dpkg-reconfigure locales

On reessaye, toujours en supprimant les cookies:

screenshot-7.png

Et HO MAGIE, ca marche, merci france télécom, sncf, laposte, et maintenant gouv.fr pour vos site web fonctionnels, sans pub, sans popup et test javascript à tour de bras.

Choose your laptop: Fn and Ctrl keys

Be carreful when choosing your new laptop, it can end in a real nightmare just for 2 keys:

Regular Ctrl (strong) and Fn

ctrl-fn.jpg
List of vendors:

– Hp/Compaq

– Acer

– Asus
– Sony

– Toshiba

Very annoying non conventional layout Fn THEN Ctrl:

fn-key.jpg
List of vendors:
– BenQ

– Asus

– Lenovo

– Fujitsu

Since it’s alternate key, managed by the keyboard controller, you cannot remap or swap it with a software.
Alternatively you can pop it up and use a conductive paint to remap it:

FN / CTRL-Key Switch Mod

(Hardcore mod inside)

Wireless (Vlan or Wifi) problem solved on Eee PC 701 running Ubuntu 8.10

From now ( 1/11/2008) wireless doesnt work out of the box.

To solve this issue:

First, disable closed source drivers:

System > Administration > Hardware Drivers: Desactivate Support for Atheros 802.11 wireless Lan cards

Then in terminal

sudo apt-get install linux-backports-modules-2.6.27-7-generic
(complete with tab with smth ending with generic to select the good kernel if the package doesnt exist)

Reboot, and voilà!

You can also get a better experience with Hotkey, webcam and sound working by installing the custom kernel, especially deseigned for Epc:

http://www.array.org/ubuntu/