how to build multiple cordova applications with different cordova version

instead of installing the cordova client with

 npm install -g cordova   # DON'T USE THIS

You should just install the cordova client locally, the best way is to put the cordova dependency in the file package.json so when you run the npm install in the root folder of your application, it will install the appropriate cordova version related to this application.

 # if you have a well configured package.json
 npm install


 # without a package json
 # if you want the cordova version 5.2.0
 npm install cordova@5.2.0

But it is not enough because your path is not up to date so when you run cordova, it is still pointing to the global one. The trick is to run the following command (or add it to your .bashrc) :

 export PATH=./node_modules/cordova/bin:$PATH

then type again

 cordova -version

That’s it ! You are running cordova with local cordova client defined by the developer of the app.

How to remove the dialog window that asks the user to allow bluetooth visibility on Android ?

This dialog contains the following message : « An app wants to make your device visible to other Bluetooth devices… »

if you look in the code you’ll see that this dialog is related to the Settings application, particularly You’ll see also that a boolean can automatically click on the yes button, exactly what we need:

   if (getResources().getBoolean(R.bool.auto_confirm_bluetooth_activation_dialog) == true) {
           // dismiss dialog immediately if settings say so
           onClick(null, DialogInterface.BUTTON_POSITIVE);

So the trick is to find where is this boolean. It is quite obvious and it must be in the res folder in the bools file. So looking in packages/apps/Settings/res/values/bools.xml we find what we need:

 <!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed.
        Can be overridden for specific product builds. -->
 <bool name="auto_confirm_bluetooth_activation_dialog">false</bool>

switching the value to true and the trick is done.

Enjoy !

Notes en vrac sur le build d’une ROM Android sur une base Rockchip

construire une rom android.


Docs officielles android pour le build d’une ROM:

Configurer l’environnement pour avoir les actions dans l’environnement.

$ . ./build/
S’assurer que le device est vu par le port USB


voir les usb:

$ lsusb 

$ dmesg

Faire un udev pour avoir un nom potable dans le /dev et avoir l’adb qui le detecte vi /etc/udev/conf.d/50-custom_device.conf

ajouter la ligne suivante en faisant matcher le vendor et le product avec la sortie de lsusb (ici 04e8:6860) le group est le group (systeme) authorisé a utiliser le device, le symlink est le nom affiché SUBSYSTEM== »usb », ATTRS{idVendor}== »04e8″, ATTRS{idProduct}== »6860″, MODE= »0666″ GROUP= »my_group », SYMLINK+= »i9305″

recharger la config udev

udevadm control --reload-rules

optionnel : update adb list

$ android update adb

ajouter le product id dans la liste adbf Edit $HOME/.android/adb_usb.ini, add 0x2207 at the end of the file Restart adb server

$ adb kill-server && adb start-server

List android device

$ adb devices

lien pour la doc sur udev:

monter l’ensemble du systeme de fichier d’un android:


doc sur :

adbfs /chemin_de_mount

Suivre le readme Attention il faut avoir les droit pour lancer l’outil car il lance fuse qui accede a bas niveau:

recuperer l’IMEI:


taper sur le tel *#06#

faire un backup


backup dans le repertoire courant (cree le fichier backup.ab)

adb backup -apk -shared -all

restaurer depuis le fichier backup.ab

adb restore backup.ab

arreter le server proprement

adb kill-server
installer un recovery correct:


Telecharger recovery clockwork puis installer heimdall lancer l’installation de la recovery:

$ heimdall flash --RECOVERY /home/ow-cve/dev/RCW/recovery-clockwork-
Extraire les données d’une img rockchip:


You’ll first need to build rk-tools:

git clone cd rk-tools sudo apt-get install libssl-dev libcrypto++-dev make

Then use img_unpack tools to unpack the firmware to another format:

./img_unpack update_mk908_106j2107_04.img update_mk908_106j2107_04_unpack.img rom header code: 1060000 rom version: 4.1.1 build time: 2013-09-07 10:39:22 chip: 70 checking md5sum....OK

Finally, run afptool to extract the files from the resulting file into “firmware” directory:

./afptool -unpack update_mk908_106j2107_04_unpack.img firmware Check file...OK - UNPACK - package-file 0x00000800 0x00000242 RK3188Loader(L)_V1.20.bin 0x00001000 0x0002F8AE parameter 0x00031000 0x00000264 Image/misc.img 0x00031800 0x0000C000 Image/boot.img 0x0003D800 0x00A2C000 Image/recovery.img 0x00A69800 0x00BFC000 Image/system.img 0x01665800 0x1A630000 backupimage/backup.img 0x1BC95800 0x01665004 update-script 0x1D2FB000 0x000003A5 recover-script 0x1D2FB800 0x0000010A UnPack OK!
Ajouter une app dans le framework:


copier l’app dans /packages/apps/<mon_app_dir> copier un d’une autre app et mettre a jour les parametres de celui-ci.

Lancer la compilation d’une app:


Configurer l’environnement pour avoir les actions dans l’environnement.

$ . build/

$ mmm /packages/apps/<mon_app_dir>
Faire un package d’update rockchip:


afptool et img_pack ne gere pas bien les chemin absolu donc : – faire un lien sym « tmp » dans le repertoire d’afptool qui pointe vers les img du build android

– puis creer le script suivant dans le repertoire afptool:


set -e

cd `dirname $0`

rm -f tmp.img
rm -f update.img

# put all img in one single img
./afptool -pack tmp tmp.img

# add RockChip specific param and bootloader
./img_maker -rk31 tmp/RK3188Loader_2.16.bin 1 0 0 tmp.img update.img

rm -f tmp.img

echo "update.img is at `pwd`/update.img"

ca genere un fichier update.img dans le repertoire d’afptool.

How to disable location or telephony on android box : use the system properties

If you have the sources of your box and you want to disable permanently some services you can use system properties.

first look at there, you’ll see how services are started :


then you’ll see that most of the services have a boolean related to a system property, for instance location :

 boolean disableLocation = SystemProperties.getBoolean("config.disable_location", false);

and deeper in the file, you’ll see that this boolean is used to disable the service :

 if (!disableLocation) {
               try {
                   Slog.i(TAG, "Location Manager");
                   location = new LocationManagerService(context);
                   ServiceManager.addService(Context.LOCATION_SERVICE, location);

so basically you just have to find your system property file in your device tree, and force the value to true. Use a « find » to get it.

On rockchip device it is easy : the file name is system.prop. This file is used to generate the build.prop in the out folder.

Another way to force system properties is to use the and force value with this specific token:

    config.disable_location = true


Enregistrer la sortie audio sur debian


Installer pulseaudio et sox,

Lancer pulseaudio :

 pulseaudio start

Récupérer la liste des entrée/sortie disponibles

 pactl list


Enregistrer l’entrée monitor qui est une copie de la sortie audio dans un fichier wav 44kHz, 16 bit (entier signé) sur 2 canaux

 parec -d alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor |sox -t raw -r 44k -b 16 -e signed-integer -c 2 - music.wav

Pour cibler le maximum de qualité en sortie, on peut passer sur du 64bit a virgule flotante:

 parec -d alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor |sox -t raw -r 44k -b 64 -e float -c 2 - music.wav

Enregister le flux audio et vidéo de son bureau

!!! Pré-requis

* installer pulseaudio
* installer’ libav

!!! How to

Enregistrer le son et la video dans un fichier mkv :

avconv -f x11grab -video_size 1600×900 -i :0.0 -f alsa -i pulse -c:v’ libx264 -rc-lookahead 1 -threads 4 test.mkv

{{ adapter a la taille de l’ecran et le nombre de threads }}

Pour plus d’info sur libav : [Libav||en]

Lancer pavucontrol pour dirigier le flux audio sur avconv. La sortie monitor » permet d’avoir une copie du flux audio de sortie dans une entrée d’enregistrement.

!!! Annexe

Vous pouvez tenter aussi recordmydesktop avec pulseaudio

recordmydesktop –device pulse

La qualité video est meilleure’

How to remove an IP from Microsoft Blacklist

Some information related to Microsoft blacklisting:

A form to declare valid IP from your domain:

Look at your logs

Look at the message in your mail log. You should see the email address of a contact. You can also directly send an email to

Check with a tool

A good tool to check if you are blacklisted:

Check you DNS zone file

Once blacklisted, make sure you are correctly setup on your side and check your DNS zone file: – SPF record – PTR

Send an email to or yahoo and check the email header, it contains details regarding SPAM detection and SPF check.

Exim4 on ubuntu : startup options and queue timing

On ubuntu, xim4′ ‘configuration is based on template stored in /etc/exim4 (splitted or one block configuration template depending on your choice).
The real configuration file s’ ‘generated on the fly in /var/lib/exim4/config.autogenerated

Instead of using generated configuration, you can copy paste the configuration file from /usr/hare’/’doc/exim4-base in /etc/exim4, or use the generated one.

More over the /etc/init.d/exim4 load additional setting that control the option used to launch xim4 that’ ‘are as important as the configuration file.

So you should have a look to /etc/default/exim4, there you can find the queue start frequency for’ instance.

How to setup 2 virtual hosts with different wildcard SSL certificates on the same apache

  • you need one dedicated IP per wildcard certificate in order to let apache route the request to the correct certificate.
  • use the NameVirtualHost option to indicate that two IPs will resolve the nameVirtualHost instead of using the classic *:443 value.: A.A.A.A:443 and B.B.B.B:443
  • setup each virtual host with the dedicated IP instead of *:443. and define the SSL certificate as usual.
  • all virtuals hosts that are under certificate A must use the IP A.A.A.A:443 and the others virtual host must use the IP B.B.B.B:443

How to setup 2 public IPs on AWS instance

In instances

Select instance and add private IP on the existing ethernet card.

In network :
  • buy 2 elastic IPs
  • attach first EIP to the existing ethernet’ card of the instance
  • attach the second EIP to the existing ethernet but select the second private IP.
Setup VIP

ssh to the instance and setup a static VIP on’ the ethernet card with the second private IP

ifup the VIP, and that’s it.


Using two ethernet cards is feasible but it implies to setup routing’ table. Using VIP avoids playing with routing tables and managing two cards.