Using special chars in Python string Templates

Posted on Wed 05 June 2013 in Python • Tagged with coding, python, strings, templatingLeave a comment

PEP-292 introduced a nice Python templating feature.
Templates placehoder names are subject to some restrictions,Documentation says:

$identifier names a substitution placeholder matching a mapping key of "identifier".
By default, "identifier" must spell a Python identifier.
The first non-identifier character after the $ character terminates this placeholder specification.

This means that ...

Continue reading

UAS Authenticating registrar SIPp scenario

Posted on Thu 30 May 2013 in VoIP • Tagged with sip, SIPp, Testing, VoIPLeave a comment

SIPp is a real SIP swiss army knife. You can create various SIP scenario and test your devices and environments.

I never found a SIPp scenario implementing an UAs (User Agent server) registrar with authentication.

Following you can find this scenario:

The SIPp XML scenario file: sipp_register_auth_uas.xml

<?xml version ...
Continue reading

Ability to set codec in MulticastRTP Asterisk channels

Posted on Wed 12 December 2012 in VoIP • Tagged with asterisk, c, code, patch, rtp, VoIPLeave a comment

Here you can find a port for Asterisk trunk (rev. 377802) of this patch: http://lists.digium.com/pipermail/asterisk-dev/2011-September/051262.html.
This patch permits to set the codec of an outgoing multicast RTP stream via the variable MULTICAST_RTP_CODEC:

exten => 999,1,Answer()  
exten => 999,n,Set(MULTICAST_RTP_CODEC=alaw ...
Continue reading

RTP timestamps fix in Asterisk MulticastRTP channels

Posted on Wed 12 December 2012 in VoIP • Tagged with asterisk, c, multicast, patch, rtp, VoIPLeave a comment

Starting from Asterisk 1.8 you can send multicast rtp streams using the MulticastRTP channel driver. There is an open issue that breaks outgoing RTP if the source channel doesn't contains timing informations (Eg. playing an audio file with Dial(MulticastRTP/basic/239.255.255.245:5555,,A(my-announce ...

Continue reading

Encoding and decoding Encapsulated DHCP options (RFC 2132)

Posted on Fri 19 October 2012 in Python • Tagged with decoding, dhcp, encapsulated options, encoding, python, rfc2132Leave a comment

Vendor specific DHCP options may be provided encapsulated in DHCP option 43.
With this little script you can encode and decode vendor encapsulated option according to RFC 2132.

For example with this command you can tunnel options 66 (TFTP Server), 67 (TFTP Path), 132 (VLAN ID) and 133 (VLAN QOS ...

Continue reading

Asterisk callback from a failed blind transfer

Posted on Sun 07 October 2012 in VoIP • Tagged with asterisk, sip, VoIPLeave a comment

This little piece of extensions.conf implements a callback from a failed transfer (attendant and unattendant/bind)

exten => _1XX,1,Dial(SIP/${EXTEN},20,tT)
exten => _1XX,n,GotoIf($[ "a${BLINDTRANSFER}" = "a" ]?TransferFailed)
exten => _1XX,n,Set(CALLER=${CUT(BLINDTRANSFER,-,1)});
exten => _1XX,n,Goto(CallBack)
exten => _1XX,n(TransferFailed ...
Continue reading

vtiger CRM: Howto add products commissions in invoice

Posted on Thu 27 September 2012 in PHP • Tagged with crm, php, vtigerLeave a comment

During last days I played with vtiger: a very customizable and feature rich PHP/MySQL CRM. Sincerely this task has revived my intimate hate for PHP programming language.

This is the idea: add a function hook in vtiger workflow every time that an invoice is created or edited. This function ...

Continue reading

Backup your Dropbox share with bacula

Posted on Fri 27 July 2012 in Systems • Tagged with backup, bacula, bash, dropboxLeave a comment

I don't like cloud storage, especially I don't like Dropbox security history.
Anyway Dropbox and others cloud storage are damn cheap and easy to use, I use it for sharing non-important documents.

This little howto explain how you can backup your Dropbox share with Bacula.

First you must ...

Continue reading

Poor man virtual consolidated backup update

Posted on Sun 01 April 2012 in Systems • Tagged with backup, bacula, bash, scriptLeave a comment

I just received a little patch to my pmvcb from Tilman Schmidt.
This patch add the support for the new ESXi syntax of snapshot.remove.

You can download the last pmvcb from my Github page

Thanks Tilman.

Continue reading

Little file browser with pdmenu

Posted on Sat 10 March 2012 in Hacks • Tagged with coding, pdmenu, perlLeave a comment

Pdmenu is a menu system for Unix. It is designed to be easy to use, and is suitable for a login shell for inexperienced users, or it can just be run at the command line as a handy menu program.

I just modified showdir.pl script in order to implement ...

Continue reading