Friday, 17 July 2009

debian policy for init scripts

It could be useful to add your /etc/init.d/ script to debian/conffiles to avoid overwriting local changes.
Sometimes sysadmins change the init scripts and with this little tip you can help them in case of package upgrades.

From the Debian Policy Manual:
"The /etc/init.d scripts must be treated as configuration files, either (if they are present in the package, that is, in the .deb file) by marking them as conffiles, or, (if they do not exist in the .deb) by managing them correctly in the maintainer scripts (see Configuration files, Section 10.7). This is important since we want to give the local system administrator the chance to adapt the scripts to the local system, e.g., to disable a service without de-installing the package, or to specify some special command line options when starting a service, while making sure their changes aren't lost during the next package upgrade. "


Using externals with SVN

UPDATE: You need to specify the directory you want to create when setting the external property. No need to create the dir before propset: it'll be done automatically when you 'svn up'.


- Create somewhere in the SVN repo the directory you want to use as external (let's call it SVNEXTURL)
- Go in the working copy where you want to have an external reference and:

svn propset svn:externals 'newlocaldir SVNEXTYURL' .

where newlocaldir is the name of the directory being created by SVN during this operation.
Quotes are needed.
Note the '.'

- and then
svn up

Enjoy!

Problem: if you're using a version of svn-buildpackage older than 0.6.24 (debian), it won't work with external references. You can upgrade to >= 0.6.24 or apply locally the patch described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363003

Monday, 18 May 2009

Lessons learnt #1

Not a real surprise, but useful to write it down...

- If you have data that varies depending on the platform or environment you're using, be sure to have it in a separate file, marked as config file (for example using debian/conffiles if you build debian packages)

- Be sure to have a clear way to handle dependencies - Write them down and whenever possible use automated tools, as debian/control if applicable)

Friday, 15 May 2009

I'm cellphone only

Now that I think about it, it's since 2000 that I don't have a fixed telephone line in the house where I live. Cell phone and ADSL or 3G data connection meant to replace it (with some limitations in terms of service availability and emergency calling).

It's probably a known trend: in the US 20% of people have made the same choice.

And look how many families are adopting wireless phone services only! I'll write on this topic and on interesting solutions.

VOIPBLOG.IT reported it in Italian.

Thursday, 14 May 2009

2700 blogs available on the Kindle Store (and a digression)

Quite amazing to see how many blogs you can subscribe to from the Kindle Store.
Prices go from 0 to $1.99.

By the way, digging a little bit in the past (March 2008), I've found an interesting rumor from Apple about a tablet from Mac:
A little birdy tells me that Apple will announce a 12 or 13-inch tablet in the fall of this year. Most likely in the September or October time frame.


That was rumored one year earlier as well (January 2007).

I could go even further in the past, but the good news seems to be that this time, eventually, we'll get the mega tablet from Mac on the next Fall... maybe.

Wednesday, 13 May 2009

curl for HTTPS (and Twitter)

curl is a powerful library available on different platforms - I use it on Linux debian.

You can use it just to get http pages, or to post data and get a response from a server.
HTTPS is available too.

An example:

curl -k --data @request.xml https://127.0.0.1/service

posts the XML data contained by request.xml using a HTTPS connection (and ignoring invalid certificates, option '-k' - just for testing purposes).

This is a more interesting usage: it's nice to get info from Twitter or even send messages ("update your status") with just a command line:

Get status:
curl http://twitter.com/users/show.xml?screen_name=giavac

Send a message:
curl -u user:password -d "status=describing how to use the Twitter API" http://twitter.com/statuses/update.xml

To install curl on debian:

apt-get install libcurl3

(install dependencies too, and I suggest to include libcurl3-gnutls-dev)

Tuesday, 12 May 2009

How many different tea times do you have?

Just realized that in UK you can refer to the "last or almost last meal of the day" as "Tea".

This just makes sense, considering that while driving you have to keep the left, but on the escalator you have to keep the right if you're standing, and the left if you're walking.

Not mentioning that your weight can be measured in stones, but in the gym weights are in pounds OR kilos, while when you buy food they use ounces.

I'll have a twentieth of gallon of tea before going home for the tea...

Decrypt SDES SRTP from pcap

If you have a pcap file with encrypted RTP (SDES SRTP) and have access to the SIP signalling to see the keys, these instructions will help y...