mercoledì 30 gennaio 2008

Problema e soluzione installazione squidGuard su fedora e CentOS - lex.yy.c

Nel caso in cui, durante l'installazione di squidguard si riceve il
seguente errore:

[root@proxy squidGuard-1.3]# make
making all in squidGuard-1.3
make[1]: Entering directory `/root/sw/squidGuard-1.3/src'
making all in src
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c main.c
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c sgLog.c
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c sgDb.c
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c sgDiv.c
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c sgFree.c
yacc -d sg.y || (cp y.tab.c.bison y.tab.c && cp y.tab.h.bison y.tab.h)
/bin/sh: yacc: command not found
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c y.tab.c
: sg.l || cp lex.yy.c.flex lex.yy.c
gcc -I.. -I. -I. -I/usr/local/BerkeleyDB/include -DHAVE_CONFIG_H -g -O2
-I/usr/local/BerkeleyDB/include -c lex.yy.c
gcc: lex.yy.c: No such file or directory
gcc: no input files
make[1]: *** [lex.yy.o] Error 1
make[1]: Leaving directory `/root/sw/squidGuard-1.3/src'
make: *** [all] Error 1

La soluzione è semplice:
[root@proxy squidGuard-1.3]# yum install flex
[root@proxy squidGuard-1.3]# make clean
[root@proxy squidGuard-1.3]# ./configure
[root@proxy squidGuard-1.3]# make
[root@proxy squidGuard-1.3]# make install

Problema risolto!!!

venerdì 25 gennaio 2008

Inserire codice html o xml su blogspot

PEr inserire del codice che non venga interpretato dal browser possiamo seguire uno dei tanti esempi descritti qui:
http://www.learningmovabletype.com/a/000235display_code/

Un metodo che ho testato è quello di sostituire i codici ascii dei caratteri che compongono i tag.

Quindi al posto di < usare &lt;
e al posto di > usare &gt;

Voip su windows mobile 6 e configurazione di ipdialplan.xml

Oggi ho configurato il mio PDA (Hermes con windows mobile 6) per connettersi a mytcom.it e sfruttare il loro servizio voip per telefonare a tariffe vantaggiose.
Dopo aver configurato il mio pda ed aver stabilito la connessione correttamente
come mostrato nei seguenti screenshot:

Ho fatto le classiche chiamate di prova ai numeri 690 e 695 e tutto funzionava correttamente.
Ho quindi aggiunto del credito al mio account e ho provato a chiamare numeri fissi o cellulari.
Ottenevo sempre un errore come il seguente:
"cannot complete the call phone number may not be valid"

Mi sono un po' scervellato per capire cosa potesse essere, ho chiesto aiuto al supporto di mytcom.it ma per loro tutto era ok (infatti funzionava tutto con i loro numeri di test)
fino a quando non ho capito...
il problema era la COMPOSIZIONE del numero, era impostato male il file
ipdialplan.xml

Presente nell directory \windows sul mio pda

Dopo aver cercato un po' su internet ed aver trovato le seguenti informazioni:
http://forum.xda-developers.com/showthread.php?p=1846002
http://msdn2.microsoft.com/en-us/library/bb202934.aspx
http://msdn2.microsoft.com/en-us/library/aa921921.aspx
http://msdn2.microsoft.com/en-us/library/aa921954.aspx

mi sono deciso a modificarmi il file
ipdialplan.xml

che allego di seguito:
io l'ho provato con molti numeri che ho in rubrica, sia con il +39 che senza, sia fissi che cellulari e tutto sembra funzionare correttamente.



<dialplan xmlns='http://schemas.microsoft.com/embedded/VoIP'>
<dialplan-header>
<host>#use_sipsrv_host_name#</host>
</dialplan-header>
<!-- Dial Plan rules -->
<!-- IP address rules -->
<rule pattern='\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
restrict='Cell,SMS'
/>
<rule pattern='(\d{1,3})\*(\d{1,3})\*(\d{1,3})\*(\d{1,3})'
dial='\1.\2.\3.\4'
display='\1.\2.\3.\4'
transfer='\1.\2.\3.\4'
restrict='Cell,SMS'
/>
<!-- 11-digits rules -->
<rule pattern='1\s*-?\s*(\d{3})\s*-?\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:91\1\2\3@$host$'
display='1 (\1) \2-\3'
transfer='sip:1\1\2\3@$host$'
/>
<rule pattern='1\s*-?\s*\((\d{3})\)\s*-?\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:91\1\2\3@$host$'
display='1 (\1) \2-\3'
transfer='sip:1\1\2\3@$host$'
/>
<rule pattern='\+\s*1\s*-?\s*(\d{3})\s*-?\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:91\1\2\3@$host$'
display='+1 (\1) \2-\3'
transfer='sip:1\1\2\3@$host$'
/>
<rule pattern='\+\s*1\s*-?\s*\((\d{3})\)\s*-?\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:91\1\2\3@$host$'
display='+1 (\1) \2-\3'
transfer='sip:1\1\2\3@$host$'
/>
<!-- 11-cifre-by-maox-x-italy +39 33344455566-->
<rule pattern='\+\s*(\d{2})\s*(\d{11})'
dial='sip:\2@$host$'
display='+\1\2'
transfer='sip:\2@$host$'
/>
<!-- 10-cifre-by-maox-x-italy +39 3334445556-->
<rule pattern='\+\s*(\d{2})\s*(\d{10})'
dial='sip:\2@$host$'
display='+\1\2'
transfer='sip:\2@$host$'
/>
<!-- 9-cifre-by-maox-x-italy +39 3334445556-->
<rule pattern='\+\s*(\d{2})\s*(\d{9})'
dial='sip:\2@$host$'
display='+\1\2'
transfer='sip:\2@$host$'
/>
<!-- 8-cifre-by-maox-x-italy +39 333444555-->
<rule pattern='\+\s*(\d{2})\s*(\d{8})'
dial='sip:\2@$host$'
display='+\1\2'
transfer='sip:\2@$host$'
/>
<!-- qualsiasi-cifre-by-maox-x-italy 4916 oppure 695 oppure qualsiasi numero senza +39-->
<rule pattern='(\d+)'
dial='sip:\1@$host$'
display='\1'
transfer='sip:\1@$host$'
/>
<!-- 10-digits rules -->
<rule pattern='(\d{3})\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:9\1\2\3@$host$'
display='(\1) \2-\3'
transfer='sip:\1\2\3@$host$'
/>
<rule pattern='\((\d{3})\)\s*(\d{3})\s*-?\s*(\d{4})(\s*[Xx]\s*\d+)?'
dial='sip:9\1\2\3@$host$'
display='(\1) \2-\3'
transfer='sip:\1\2\3@$host$'
/>
<!-- 7-digits rules -->
<rule pattern='(\d{3})\s*-?\s*(\d{4})'
dial='sip:9425\1\2@$host$'
display='\1-\2'
transfer='sip:425\1\2@$host$'
/>
<!-- SIP URI rules -->
<rule pattern='[Ss][Ii][Pp][Ss]?:\s*(\d{3})(\d{3})(\d{4})@(.+)'
display='(\1) \2-\3'
restrict='Cell,SMS'
/>
<rule pattern='([Ss][Ii][Pp][Ss]?:)?\s*([a-zA-Z0-9_-]+)@(.+)'
display='\2'
restrict='Cell,SMS'
/>
<rule pattern='[Ss][Ii][Pp][Ss]?:\s*([^@]+)'
display='\1'
restrict='Cell,SMS'
/>
<!-- 5-digits rules -->
<rule pattern='(\d{3})-?(\d{2})'
dial='sip:\1\2@$host$'
display='\1\2'
transfer='sip:\1\2@$host$'
/>
<rule pattern='1\s*\((\d{3})\)\s*(\d)'
dial='sip:1\1\2@$host$'
display='1\1\2'
transfer='sip:1\1\2@$host$'
/>
<!-- Only digits -->
<rule pattern='(\d+)'
dial='sip:\1@$host$'
display='\1'
transfer='sip:\1@$host$'
/>
</dialplan>

http://blog.maurizio.proietti.name

mercoledì 23 gennaio 2008

Creare o Revocare certificato openvpn

Questi sono i passaggi necessari:

#################################
CREARE UN CERTIFICATO:
cd /etc/openvpn/easy-rsa/
. ./vars
./build-key NOMEUTENTE

vi /etc/openvpn/ipp.txt


#################################
REVOCARE UN CERTIFICATO
cd /etc/openvpn/easy-rsa/
. ./vars
./revoke-full NOMEUTENTE


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Dalla guida:
http://openvpn.net/easyrsa.html

BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A
LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this
script generates and signs a certificate in one step,
but it requires that the generated certificate and
private key files be copied to the destination host
over a secure channel.
1. ./build-key mycert (no password protection)
2. OR ./build-key-pass mycert (with password protection)
3. OR ./build-key-pkcs12 mycert (PKCS #12 format)
4. OR ./build-key-server mycert (with nsCertType=server)
5. mycert.crt and mycert.key will be built in your
KEY_DIR directory, and mycert.crt will be signed
by your root CA. If ./build-key-pkcs12 was used a
mycert.p12 file will also be created including the
private key, certificate and the ca certificate.



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Dalla guida:
http://openvpn.net/howto.html#pki

Generate certificates & keys for 3 clients

Generating client certificates is very similar to the previous step. On Linux/BSD/Unix:

./build-key client1 ./build-key client2 ./build-key client3

On Windows:

build-key client1 build-key client2 build-key client3

If you would like to password-protect your client keys, substitute the build-key-pass script.

Remember that for each client, make sure to type the appropriate Common Name when prompted, i.e. "client1", "client2", or "client3". Always use a unique common name for each client.