Skip to content

vim instead of nano (Ubuntu / Debian)

apt-get install vim
update-alternatives --config editor

  • Twitter
  • Bookmark vim instead of nano (Ubuntu / Debian) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg vim instead of nano (Ubuntu / Debian)
  • Mixx vim instead of nano (Ubuntu / Debian)
  • Bloglines vim instead of nano (Ubuntu / Debian)
  • Technorati vim instead of nano (Ubuntu / Debian)
  • Fark this: vim instead of nano (Ubuntu / Debian)
  • Bookmark vim instead of nano (Ubuntu / Debian) at YahooMyWeb
  • Bookmark vim instead of nano (Ubuntu / Debian) at Furl.net
  • Bookmark vim instead of nano (Ubuntu / Debian) at reddit.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at blinklist.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at Spurl.net
  • Bookmark vim instead of nano (Ubuntu / Debian) at NewsVine
  • Bookmark vim instead of nano (Ubuntu / Debian) at Simpy.com
  • Bookmark vim instead of nano (Ubuntu / Debian) at blogmarks
  • Bookmark vim instead of nano (Ubuntu / Debian) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux

This is how I got a Bluetooth low energy (BLE) adapter to work on a Linux laptop running Ubuntu 12.04.

First, as suggested by several websites, I created the file /etc/modprobe.d/trust-btusb.conf with the following contents:
install usb:v0A5Cp21E8d*dc*dsc*dp*ic*isc*ip* /sbin/modprobe btusb; echo 0a5c 21e8 > /sys/bus/usb/drivers/btusb/new_id

After having restarted the computer and inserted the adapter, dmesg told me the following:
Bluetooth: can't load firmware, may not work correctly

To get the proper firmware, I downloaded the Windows 8 driver (18187_02.exe) from http://www.trust.com/18187. The driver files can be extracted from the .exe with "unrar x 18187_02.exe".

Then I looked for the vendor id (0x0a5c) and product id (0x21e8) in the various .inf files, and found this in 18187_02/Win32/bcbtums-win7x86-brcm.inf:
%BRCM20702.DeviceDesc%=RAMUSB21E8,      USB\VID_0A5C&PID_21E8                                   ; 20702A1 dongles

Further down in the inf file there is a RAMUSB21E8 section which contains the following line:
HKR,,%RAMPatchFileName%,0x00000, "BCM20702A1_001.002.014.0187.0188.hex"

The .hex "RAM Patch" file can be found in 18187_02/Win32/. Before it can be used with btusb, it needs to be converted to hcd format. This can be done with hex2hcd. Finally, the hcd file needs to be moved/copied to /lib/firmware/fw-0a5c_21e8.hcd. Here are the steps to get and compile hex2hcd:
$ git clone https://github.com/jessesung/hex2hcd.git
$ cd hex2hcd/
$ make

The resulting executable can be used to convert the .hex firmware file to .hcd, which is then copied to the right destination:
$ ./hex2hcd BCM20702A1_001.002.014.0187.0188.hex BCM20702A1_001.002.014.0187.0188.hcd
$ sudo cp -p BCM20702A1_001.002.014.0187.0188.hcd /lib/firmware/fw-0a5c_21e8.hcd
$ sudo chown root:root /lib/firmware/fw-0a5c_21e8.hcd

The adapter can now be used:
$ sudo hcitool -i hci1 lescan


Update, 2014-09-08:
  • The first step is no longer necessary with Ubuntu 14.04, I directly receive the "may not work" message.
  • I was able to extract the firmware from 18187_05.exe (latest W8 driver) using this command: "7z x 18187_05.exe"
  • The correct .hex file is BCM20702A1_001.002.014.0449.0515.hex
  • Twitter
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Mixx Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Bloglines Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Technorati Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Fark this: Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at YahooMyWeb
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Furl.net
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at reddit.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at blinklist.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Spurl.net
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at NewsVine
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at Simpy.com
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux at blogmarks
  • Bookmark Getting the Trust 18187 Bluetooth 4.0 USB adapter (0a5c:21e8) to work with Linux with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

raspbmc - getting rid of iptables

I don't need a firewall on my Raspberry PI which runs XMBC (raspbmc distribution) - it's in a dedicated subnet behind a firewall. Furthermore, there are several reports of iptables having an impact on the performance of network playback, causing buffering issues (although I didn't do any benchmark myself).

I modified /etc/network/if-up.d/secure-rmc by adding "exit 0" right at the beginning like this:
#!/bin/bash

exit 0

dec_to_bin() {
...

And then I ran:
apt-get remove iptables

This was followed by a reboot.

nb: the secure-rmc file appears to be a raspbmc addition, and it could probably just be deleted instead.

  • Twitter
  • Bookmark raspbmc - getting rid of iptables at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg raspbmc - getting rid of iptables
  • Mixx raspbmc - getting rid of iptables
  • Bloglines raspbmc - getting rid of iptables
  • Technorati raspbmc - getting rid of iptables
  • Fark this: raspbmc - getting rid of iptables
  • Bookmark raspbmc - getting rid of iptables at YahooMyWeb
  • Bookmark raspbmc - getting rid of iptables at Furl.net
  • Bookmark raspbmc - getting rid of iptables at reddit.com
  • Bookmark raspbmc - getting rid of iptables at blinklist.com
  • Bookmark raspbmc - getting rid of iptables at Spurl.net
  • Bookmark raspbmc - getting rid of iptables at NewsVine
  • Bookmark raspbmc - getting rid of iptables at Simpy.com
  • Bookmark raspbmc - getting rid of iptables at blogmarks
  • Bookmark raspbmc - getting rid of iptables with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)

According to the Wikipedia IPv6 article, Privacy extensions are, except for the Windows platform and Mac OS X since 10.7 as well as iOS since version 4.3, not enabled by default.

In theory, one can enable the IPv6 Privacy Extensions on all interfaces at once using sysctl like this:
sudo sysctl net.ipv6.conf.all.use_tempaddr=2

However, this currently doesn't work as expected, so I'm using this one-liner in /etc/rc.local:
for IF in `/bin/ls /proc/sys/net/ipv6/conf/*/use_tempaddr` ; do echo 2 > $IF ; done

This also sets "use_tempaddr" for "default", which means it should also apply to interfaces added to the system afterwards.

A simple check to verify that the new configuration is working: ipv6-test.com will print your MAC address when available...

See also: Linux Kernel Bug 11655

  • Twitter
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Mixx Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Bloglines Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Technorati Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Fark this: Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too)
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at YahooMyWeb
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Furl.net
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at reddit.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at blinklist.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Spurl.net
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at NewsVine
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at Simpy.com
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) at blogmarks
  • Bookmark Enabling IPv6 Privacy Extensions on all interfaces (Ubuntu Linux, may work for other distros too) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

VaudTax 2010 avec Ubuntu linux 64-bit

Les instructions pour Linux fournies sur le site officiel ne fonctionnent pas pour moi (Maverick / Ubuntu 10.10 desktop amd64).

Il semble qu'il ne soit toujours pas possible d'importer des fichiers sauvegardés dans une version 32 bit de VaudTax avec la version 64 bits, et vice-versa (crash de VaudTax avec une erreur cryptique [1]). Deux options, soit recommencer sa déclaration sans importer les données de l'année précédente, soit faire tourner VaudTax avec une JVM 32-bits ([2]). Pour l'instant j'ai toujours opté pour la deuxième variante. Jusqu'à l'année passée (VaudTax2009), on pouvait télécharger une version incluant une JVM (32-bits), cette option n'est plus disponible mais il est toujours possible d'arriver au même résultat :

1ère étape, avant de commencer le processus d'installation :
$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/ia32-java-6-sun/jre/bin/java 63 manual mode
2 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
3 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/jvm/ia32-java-6-sun/jre/bin/java to provide /usr/bin/java (java) in manual mode.

(si l'option JVM 32-bits n'apparaît pas, il faut d'abord installer le paquet ia32-sun-java6-bin)

Une fois VaudTax installé, il faut télécharger et décompacter xulrunner :
$ cd $HOME/VaudTax2010
$ wget http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2.16/runtimes/xulrunner-1.9.2.16.en-US.linux-i686.tar.bz2
$ tar -xpf xulrunner-*

Finalement, il faut encore modifier le fichier VaudTax2010 en ajoutant ces deux lignes juste après `VM_SEARCH_PATH="$PATH"' :
export MOZILLA_FIVE_HOME=$HOME/VaudTax2010/xulrunner
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MOZILLA_FIVE_HOME}


Note : une fois VaudTax2010 installé, on peut exécuter à nouveau "sudo update-alternatives --config java" pour rétablir la configuration initiale - les paramètres sont en effet enregistrés dans le fichier VaudTax2010.lax


[1]
The program 'SWT' received an X Window System error.
This probably reflects a bug in the program.
The error was 'RenderBadPicture (invalid Picture parameter)'.
(Details: serial 5455 error_code 161 request_code 149 minor_code 7)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

[2] la troisième variante serait d'étudier le format de fichier produit par chacune des versions pour créer un outil de conversion
  • Twitter
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg VaudTax 2010 avec Ubuntu linux 64-bit
  • Mixx VaudTax 2010 avec Ubuntu linux 64-bit
  • Bloglines VaudTax 2010 avec Ubuntu linux 64-bit
  • Technorati VaudTax 2010 avec Ubuntu linux 64-bit
  • Fark this: VaudTax 2010 avec Ubuntu linux 64-bit
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at YahooMyWeb
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at Furl.net
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at reddit.com
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at blinklist.com
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at Spurl.net
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at NewsVine
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at Simpy.com
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit at blogmarks
  • Bookmark VaudTax 2010 avec Ubuntu linux 64-bit with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca