Téléchargez le fichier de langue :
https://github.com/titoBouzout/Dictionaries/blob/master/French.dic
Dans les préférences :
"dictionary": "Packages/Dictionaries/French.dic",
Accessible avec la touche F6
Aller au contenu | Aller au menu | Aller à la recherche
vendredi 7 septembre 2018
Par Erwan le vendredi 7 septembre 2018, 16:33 - Dev
Téléchargez le fichier de langue :
https://github.com/titoBouzout/Dictionaries/blob/master/French.dic
Dans les préférences :
"dictionary": "Packages/Dictionaries/French.dic",
Accessible avec la touche F6
mardi 1 août 2017
Par Erwan le mardi 1 août 2017, 11:42 - Humeur
"There's no point using science and logic to convince someone who has
already intentionally avoided both to come to their conclusions"
BadgerSims
mardi 18 octobre 2016
Par Erwan le mardi 18 octobre 2016, 11:44 - Raspberry Π
Après la clef 3G TP-Link MA260 et la Huawei E303, je vous propose une autre Huawei : E3131.
Après le branchement de la clef, on obtient un pseudo lecteur CD-ROM contenant le driver Windows Ⓒ :
lsusb Bus 001 Device 024: ID 12d1:15ca Huawei Technologies Co.
On va la passer en mode Modem :
sudo usb_modeswitch -v 12d1 -p 15CA -M '55534243123456780000000000000011062000000100000000000000000000' lsusb [...] Bus 001 Device 024: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard ifconfig [...] wwan0 Link encap:Ethernet HWaddr 00:X:X:X:X UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Pour automatiser le changement de mode et le rendre persistant, on va utiliser comme à chaque fois usb_modeswitch :
sudo nano /etc/usb_modeswitch.d/12d1\:15ca #Huawei E3131 (Variant) TargetVendor= 0x12d1 TargetProductList="1506" MessageContent="55534243123456780000000000000011062000000100000000000000000000"
Avec la règle udev qui va bien :
sudo nano /lib/udev/rules.d/40-usb_modeswitch.rules [...] LABEL="modeswitch_rules_begin" [...] # Huawei E3131 (Variant) ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15ca", RUN+="usb_modeswitch '%b/%k'" [...] LABEL="modeswitch_rules_end"
Pour prendre en compte de cette nouvelle règle sans redémarrage :
sudo udevadm control --reload-rules
Vient ensuite la configuration du dialer. En ligne de commande j'utilise wvdial (disponible dans les dépôts) :
sudo nano /etc/wvdial.conf [Dialer Defaults] Modem = /dev/ttyUSB0 Modem Type = Analog Modem Baud = 460800 ISDN = 0 Stupid Mode = 1 New PPPD = yes Dial Command = ATD Phone = *99# Username = { } Password = { } Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 Init3 = AT+CFUN=1,0 Init4 = AT+CGDCONT=1,"IP","apn.de.votre.fournisseur"
Pour tester :
sudo wvdial CYM --> WvDial: Internet dialer version 1.61 --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 ATQ0 V1 E1 S0=0 OK --> Sending: AT+CFUN=1,0 AT+CFUN=1,0 OK --> Sending: AT+CGDCONT=1,"IP","apn.de.votre.fournisseur" AT+CGDCONT=1,"IP","apn.de.votre.fournisseur" OK --> Modem initialized. --> Sending: ATD*99# --> Waiting for carrier. ATD*99# CONNECT --> Carrier detected. Starting PPP immediately. --> Starting pppd at Tue Oct 18 11:28:09 2016 --> Pid of pppd: 3959 --> Using interface ppp0 --> pppd: ���vx[1b]�[01]�[1c]�[01][05] [...] --> local IP address 10.X.X.X --> remote IP address 10.X.X.X --> primary DNS address 194.X.X.X --> secondary DNS address 194.X.X.X [...]
On termine par la configuration réseau persistante :
sudo nano /etc/network/interfaces [...] # Huawei E3131 (modem mode) allow-hotplug wwan0 iface wwan0 inet wvdial # Generic PPP 3G Modem auto ppp0 iface ppp0 inet wvdial [...]
And voilà
mardi 5 avril 2016
Par Erwan le mardi 5 avril 2016, 10:38 - Dev
Pour activer la correction orthographique française dans Android Studio :
Sources :
lundi 15 février 2016
Par Erwan le lundi 15 février 2016, 15:43 - Ubuntu
Certains casques audio sous Ubuntu 14.04 ne fonctionne pas correctement : l'appareil est bien détecté, la connexion se fait mais impossible de sélectionner le périphérique en sortie sonore. Pour corriger cela :
gksudo pactl load-module module-bluetooth-discover
Sources :
Mise à jour pour Ubuntu 16.04 :
Si le son ne fonctionne pas : dans le menu "Paramètres sonore", il faut passer en mode "Casque HSP/HFP", déconnecter, reconnecter et remettre le mode "A2DP". Source :
jeudi 4 février 2016
Par Erwan le jeudi 4 février 2016, 10:52 - Gecko
Pour redémarrer une clef USB Huawei Hilink HSPDA E303 en ligne de commande :
wget --quiet -O - http://192.168.8.1/api/webserver/token | grep -oPm1 "(?<=<token>)[^<]+"
wget --quiet --post-data "<?xml version='1.0' encoding='UTF-8'?><request><Control>1</Control></request>" --header="__RequestVerificationToken:798334363" -O - http://192.168.8.1/api/device/control
Remplacez 798334363 par la token reçue
Vous devriez avoir une confirmation :
<?xml version="1.0" encoding="UTF-8"?> <response>OK</response>
Pour information, voici un message d'erreur (probablement une erreur de token) :
<?xml version="1.0" encoding="UTF-8"?> <error> <code>125001</code> <message></message> </error>
On peut en faire une petite fonction :
function reboot_huawei_hikink_303() { TOKEN=$(wget --quiet -O - http://192.168.8.1/api/webserver/token | grep -oPm1 "(?<=<token>)[^<]+") wget --quiet --post-data "<?xml version='1.0' encoding='UTF-8'?><request><Control>1</Control></request>" --header="__RequestVerificationToken:$TOKEN" -O - http://192.168.8.1/api/device/control > /dev/null 2>&1 }
Informations complémentaires :
mardi 27 octobre 2015
Par Erwan le mardi 27 octobre 2015, 16:10 - Gnu/Linux
Sur certains serveurs, j'ai énormément de processus tués :
cat /var/log/syslog |grep "OOM killed" Oct 27 13:31:37 cli2 kernel: [33918.292623] OOM killed process apache2 (pid=25927, ve=162) exited, free=8895850 gen=165. Oct 27 13:31:37 cli2 kernel: [33918.299598] OOM killed process apache2 (pid=29878, ve=162) exited, free=8900690 gen=166. Oct 27 13:31:37 cli2 kernel: [33918.303564] OOM killed process apache2 (pid=1310, ve=162) exited, free=8905696 gen=167. Oct 27 13:31:37 cli2 kernel: [33918.305936] OOM killed process apache2 (pid=7352, ve=134) exited, free=8906995 gen=168. Oct 27 13:31:47 cli2 kernel: [33928.420456] OOM killed process apache2 (pid=12134, ve=134) exited, free=8912178 gen=169
Pourtant, j'ai encore plein de mémoire disponible :
free -m total used free shared buffers cached Mem: 64406 31985 32421 0 2939 14485
Une solution éventuelle est de modifier le comportement de la gestion du OOM Killer :
echo 1 > /proc/sys/vm/oom_kill_allocating_task echo 2 > /proc/sys/vm/overcommit_memory
Pour un effet permanent, rajouter dans le fichier `/etc/sysctl.conf` :
vm.oom_kill_allocating_task = 1 vm.overcommit_memory = 2
sysctl -p
Un peu d'explication sur ces paramètres potentiellement dangereux :
man proc /proc/sys/vm/oom_kill_allocating_task (since Linux 2.6.24) This enables or disables killing the OOM-triggering task in out-of-memory situations. If this is set to zero, the OOM-killer will scan through the entire tasklist and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to nonzero, the OOM-killer simply kills the task that triggered the out-of-memory condition. This avoids a possibly expensive tasklist scan. If /proc/sys/vm/panic_on_oom is nonzero, it takes precedence over whatever value is used in /proc/sys/vm/oom_kill_allocating_task. The default value is 0. /proc/sys/vm/overcommit_memory This file contains the kernel virtual memory accounting mode. Values are: 0: heuristic overcommit (this is the default) 1: always overcommit, never check 2: always check, never overcommit In mode 0, calls of mmap(2) with MAP_NORESERVE are not checked, and the default check is very weak, leading to the risk of getting a process "OOM-killed". Under Linux 2.4 any nonzero value implies mode 1. In mode 2 (available since Linux 2.6), the total virtual address space on the system is limited to (SS + RAM*(r/100)), where SS is the size of the swap space, and RAM is the size of the physical memory, and r is the contents of the file /proc/sys/vm/overcommit_ratio.
lundi 14 septembre 2015
Par Erwan le lundi 14 septembre 2015, 19:54 - Gnu/Linux
S'il vous arrive souvent d'être banni par fail2ban via votre connexion Free, c'est à cause du reverse DNS de Free. Par défaut, ce reverse DNS ne pointe pas vers votre adresse IP.
tail -f /var/log/auth.log |grep sshd Address X.X.X.X maps to sau64-1-X-X-X-X-fbx.proxad.net, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
Solution possibles :
/etc/fail2ban/filter.d/sshd.conf
vendredi 15 mai 2015
Par Erwan le vendredi 15 mai 2015, 11:28 - Ubuntu
Ce bug est très gênant sur Ubuntu 14.04. Voici comment y remédier :
gsettings set org.gtk.Settings.FileChooser show-hidden false
Avec un éditeur graphique de configuration dconf-editor
:
Pour les anciennes version d'Ubuntu / Nautilus :
gsettings set org.gnome.nautilus.preferences show-hidden-files false gsettings set org.gtk.settings.file-chooser show-hidden false
Source :
mercredi 6 mai 2015
Par Erwan le mercredi 6 mai 2015, 22:43 - Dev
Pour faire suite à mon précédent billet sur la synthèse vocale, voici un exemple d'intégration de pico dans Asterisk :
Création des fichiers temporaires :
exten => _X.,n(mktemp),NoOp("Création des fichiers temporaires") exten => _X.,n,Set(TEMP_FILE=${SHELL(/bin/mktemp |tr -d '\n')})
TTS :
exten => _X.,n,System(/usr/bin/pico2wave -l fr-FR -w ${TEMP_FILE}.wav "${tts}")
Conversion GSM avec sox :
exten => _X.,n,System(/usr/bin/sox ${TEMP_FILE}.wav -r 8000 -c1 -e gsm ${TEMP_FILE}.gsm)
On doit supprimer le wav avant la lecture car il n'a pas la bonne fréquence :
exten => _X.,n,System(/bin/rm ${TEMP_FILE}.wav)
Lecture :
exten => _X.,n,Playback(${TEMP_FILE})
Suppression des fichiers temporaires (extension hang
up
) :
exten => h,n(rm),NoOp("Suppression des fichiers temporaires") exten => h,n,System(/bin/rm ${TEMP_FILE}) exten => h,n,System(/bin/rm ${TEMP_FILE}.wav) exten => h,n,System(/bin/rm ${TEMP_FILE}.gsm)
« billets précédents - page 1 de 32