domenica 19 aprile 2015

Client Telegram

Aggiornare il sistema
sudo apt-get update
Dipendenze
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make  
mkdir telegram
cd telegram/
git clone --recursive https://github.com/vysheng/tg.git && cd tg
./configure
make
nella directory telegram creare lo script:  send_message.sh contenente:

#!/bin/bash
  to=$1
  msg=$2
  tgpath=*****DIRECTORY*****/telegram/tg
  cd ${tgpath}
  (sleep 5; echo "msg $to $msg"; sleep 2; echo "safe_quit") | ${tgpath}/bin/telegram-cli -k tg-server.pub -W

Per configurare il numero di cellulare:

******DIR******/telegram/tg/bin/telegram-cli -k tg-server.pub -W

dopo aver ottenuto il prompt:

Telegram-cli version 1.2.0, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 1.2.0
I: config dir=[/home/alfredo/.telegram-cli]
>
mandare un messaggio ad un utente (anche a te stesso):

msg Alfredo_Salzillo test
attendere che venga chiesto il numero di cellulare: inserirlo anteponendo +39xxxxxxxxx
e prendere il codice che viene mandato sul cellulare e inserirlo alla richiesta successiva. Poi si può anche uscire con quit.

Fatto questo si può anche usare lo script per mandare i messaggi usando:

./send_message.sh Alfredo_Salzillo Test123




lunedì 13 aprile 2015

Aggiornare libreria wkhtmltopdf 0.12.0 ODOO

Se in fase di stampa PDF  (fattura o altro) dovesse venir fuori un errore che dici di aggiornare la libreria  wkhtmltopdf alla versione 0.12.0  seguire questi step:


  • scaricare dal sito  la libreria aggiornata in base al sistema operativo: Es. Ubuntu 14.04
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

  •  Installarla con dpkg
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

  • Durante l'installazione mi ha dato una dipendenza mancante per un font: xfonts-75dpi per cui ho dovuto prima installare tale font:
sudo apt-get install xfonts-75dpi

  • Copiare la libreria in:   usr/bin
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/


  • Riavviare il servizio ODOO