free swedish number portability look up service

When Sweden implemented number portability for mobiles (MNP – Mobile Number Portability) and fixed lines there where some people who stated that this information should be published in DNS or a DNS like system so it would be cheap and available for everyone to use. Naturally the telcos wanted to do it the way they always did things. With a centralized fat solution.

So Sweden ended up with a Oracle based central database (CRDB) solution system implemented by Cap Gemini and Oracle. This system is now run by SNPAC AB (Owned by Swedens large telcos) who charges approx. 19200 Euros to connect and 14400 Euros per year. Which really is out of the reach for small scale actors on the market or hobbyists running an Asterisk pbx that would like to do choose the cheapest route to place a call.

The other day the Swedish PTS (The Swedish Post and Telecom Agency) launched a web page where you could check which operator was terminating which number. So i decided to go ahead and implement a DNS based look up method.

First a little rant about their service. Well it is nice that they offer different interfaces, today they support SOAP 1.1, SOAP 1.2, HTTP GET and HTTP POST. But why should the end user have to care about dividing the into NDC and SN?  (NDC – National Destination Code and SN – Subscriber Number) after all the PTS is authorative of the NDC’s so why couldn’t they split the number for us? And why not a whole MSISDN (Mobile Subscriber Integrated Services Digital Network Number) or why not a whole E.164 number? Or what about actually implementing a ENUM (E.164 NUmber Mapping) look up?

Ok enough rant. I had a couple of hours over so i sat down with a FreeBSD box and pwerdns and started to code. So now i (and the rest of the world) can do the following lookups with their favorite DNS tool:

% dig 733441006.tel.arnold.se TXT

% dig 6.0.0.1.4.4.3.3.7.0.6.4.tel.arnold.se TXT

The result is a string containing the name of the operator handling the number. (I have included a full output below) Not the best reply to do automatic call routing but good enough as a proof of concept implementation of bridging DNS and MNP database. Right now i’m implementing a ENUM type so you could automatically integrate this into your Asterisk PBX and choose the best outgoing line for your calls. Since operators often have “Call free within our network” deals this would be a great tool for low cost routing of your phone calls.

But before starting to implementing stuff using this a couple of notes:

  • This is an experiment.
  • I have not fully tuned caching and performance yet.
  • I currently only support the follwing NDC’s: 8, 31, 40, 70, 72, 73, 76 (Swedens 3 biggest cities and the GSM and 3G networks) More NDC’s will follow when i have found a machine readable list so i don’t have to type them all in…

So a couple questions to you reading this:

  • Would you like this as a permanent service?
  • Any other useful stuff you want to look up over DNS?
  • Which information would you like returned in the  ENUM? (I’m especially interested in the needs of non Asterisk users.)

Please give me some feedback below and i will try to take your ideas into consideration.

A full example of a search using dig:

% dig 733441006.tel.arnold.se. txt
; <<>> DiG 9.6.1-P2 <<>> 733441006.tel.arnold.se. txt

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57824

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;733441006.tel.arnold.se. IN TXT
;; ANSWER SECTION:

733441006.tel.arnold.se. 3600 IN TXT “Telenor Sverige AB”

;; Query time: 39 msec

;; SERVER: 213.136.34.15#53(213.136.34.15)

;; WHEN: Sat Aug 20 13:44:06 2011

;; MSG SIZE  rcvd: 72

 

oracle to buy sun microsystems

Today Oracle and sun announced that they will be buying Sun Microsystems. And this is big!

Imagine the biggest non opensource database company not only owning their biggest rival MySQL but also a lot of other key internet technologies such as: java, solaris,  netbeans, virtualbox  (virtilisation software) , openoffice (A microsoft office “clone”). Not to mention the great technologies SUN has turned out in the last years, amongst them ZFS. (A totally new way of implementing an in theory unlimited journaling filesystem with end to end check summing on all data, and for many considered the best thing since sliced bread.) But also their own CPU architecture the SPARC and will be producing their own hardware to run all this software on.

I still haven’t decided if i should be scared or happy for the effects this will have on a lot of open source software. Interesting times we are living in!

And i’m not the only one thinking that and it is worrying that Oracles website could not cope with the load, but SUN‘s could.

Content server request failed

Content server request failed

But sun's did handle the load.

But sun's did handle the load.

Some quotes from sun:

Press Release Quotes

“The acquisition of Sun transforms the IT industry, combining best-in-class enterprise software and mission-critical computing systems. Oracle will be the only company that can engineer an integrated system – applications to disk – where all the pieces fit and work together so customers do not have to do it themselves. Our customers benefit as their systems integration costs go down while system performance, reliability and security go up.”

Larry Ellison
CEO
Oracle

“Oracle and Sun have been industry pioneers and close partners for more than 20 years. This combination is a natural evolution of our relationship and will be an industry-defining event.”

Scott McNealy
Chairman of the Board of Directors, Chairman of Sun Federal, Inc.
Sun Microsystems

“This is a fantastic day for Sun’s customers, developers and partners across the globe, joining forces with the global leader in enterprise software to drive innovation and value across every aspect of the technology marketplace. From the Java platform touching nearly every business system on earth, powering billions of consumers on mobile handsets and consumer electronics, to the convergence of storage, networking and computing driven by the Solaris operating system and Sun’s SPARC and x64 systems. Together with Oracle, we’ll drive the innovation pipeline to create compelling value to our customer base and the marketplace.”

Jonathan Schwartz
CEO and President
Sun Microsystems

Even Swedish mainstream media have started to cover the story. For example Svenska Dagbladet and Dagens Nyheter .

Antarctic ice is growing not melting away

Antarctic is is growing! Not melting away as is stated today in an Expressen editorial.

I guess this is against what people think, but as normal when global climate things arn’t as simple as they seem. (I tend to be very sceptic to anyone who is totally shure about global warming.) Look over here at news.com.au for the story i read the following:

Ice levels are decreasing in western Antarctia, but growing in the east. And since east anterctica is about 4 times as large the net effect is that there is more ice on Antarctica today than for ten years ago. Actually last year, the ice had a maximum thickness of 1.89m. The average thickness of the ice at Davis since the 1950s is 1.67m.

But please note the article isn’t published yet by the British Antarctic Survey but will be in the journal Geophysical Research Letters and is expected to confirm that over the past 30 years, the area of sea ice around the continent has expanded.

drug use or drug abuse

It may seem that i have a hangup around drugs.

And that’s correct i love drinking beer and a occasional Becherovka or Tuzemský slinks down. But nothing else, it just isn’t my cup of tea. But i hang out with drug users, and have no problem with them using drugs. I actually have a much bigger problem with people getting to drunk and violent…

But i have an even bigger hangup of the Swedish system of criminalising and hunting drug users. I think it’s counter productive. And it’s so established that even official translations of EU documents is translated wrong to suit the official stance.

I guess you don’t believe me. Official EU documents being forged while translated? No way!

Ok time for some proof, when an English document says “Drug use” it is translated as “drug abuse” (Narkotikamissbruk or drogmissbruk in Swedish.)

Take for example this site in English and in Swedish.

This is just outrageous! How can this be allowed? Is there any way to complain and eventually get an ending to this?

Also what kind of trust can we have in other more important documents? Is all material rigged in this way?

Big questions i know, but i would like to have an answer. And a stop to this!

By the way i would like to have some feedback from you all. Which other translation of the page above does the same? Please give me that feedback and i will keep this page updated. And only real persons with knowledge in the language, i don’t trust translation engines in this matter.

Wrongly translated:

Swedish: Narkotikamissbruk (Narcotic abuse)

Danish: Stofmisbruget (substance abuse)

Rightly translated:

English: Drug use

Estonian: kasutama (use)

Finnish: käyttö (use)

French: consommation de drogue (consumption of drugs)

Portuguese: consumo de droga (consumption of drugs)
Spanish: consumo de drogas (consumption of drugs)

German: Drogenkonsum (Drug consumption)

Polish: zażywanie (use)

time does not exist

A couple of days ago i stumbled over this article in New scientist. And i have been thinking about eriting something about it, but i have been to busy with other stuff to really put an effort into this post. So i just decided to throw it out to you so it gets some attention, and in the same time i get it out of my brain…

Quantum physics have a hard time integrating gravity into the theory. Basically they would like to have a quantum theory of gravity to reconcile Einstein’s general relativity, which describes gravity at the largest scales, with quantum mechanics. And time is one of the things getting in the way all the time. So some researchers are considering that time might just be a derivative effect of some thing else going on. Wait, stop you might say, time is very real! But there is a great analogy in the article:

Temperature is very real for us. But the definition of temperature is the energy in the motion of atoms and molecules swirling around in the sample. So temperature is just a macroscopic average of the momenta of all the microscopic molecules. If we would have been (a lot…) better at seeing end feeling atoms and molecules we would not have temperature, but a collection of momenta for all the molecules in the sample.

So one line of reasoning right now is that time is also a derative, it dosn’t exit on a microscopic level. It only exits in our approximation of “reality”.

Read the original article here at New Scientist – Is time an illusion?

a small report from the drug liberal czech republic

A strange (For anywhere else in Europe besides Holland) incident happened yesterday.

I was sitting with my friends at a local “hospoda” (Czech for pub) chatting and drinking a couple of Gambrinus (a Czech brand of lager) when a police officer came in and ordred a beer. In his uniform… (I guess that is strange enough in most countries.)

He walked over to a table and chatted with one of the local guys and afterward he sat down with his friends. Not so strange maybe, but add the following into the scene:

  • Several packages of large rolling paper where scattered around the table.
  • Several boxes of cigarettes had pieces torn of to be rolled up as “filters”.
  • A number of half cigarettes with that typical twist on the top so the tobacco would not fall out.

To me that is a big indication of what is going on, not to mention the fact that they where going outside for a smoke once in a while. (Remeber here in the Czech Republic there is no ban on smoking in pubs, bars and restaurants…)

A little bit later another local at the pub walked over to the table and discreetly received a small package of marijuana, not bothered at all with the police officer sitting half a meter away.

That how totally open the drug scene is here in Prague. And a lot of downtown bars and discoteques have clean horisontal mirrors in the toilets so you have a clean surface to split your cocaine on. So dope apparently isn’t a high priority here.

I guess the police concentrates on hunting people who actually hurt others or steal, instead of hunting pot and cannabis smokers or people buying sexual services. This liberalisation is going on all over Europe except in Sweden, reports Henrik Alexandersson. I guess the Swedish government will scream like hell when the Danes start opening coffe shops in Copenhagen, only 20 mimnutes by train from Swedens third city Malmö.

By the way, The Economist have a good article about The war on drugs and liberalisation of narcotic related laws.

trafficing and giant lizards

Reading the Swedish online tabloids is getting on my nerves (yes i know i should stop instead of complaining…) The other day it was a fabricated story about a mind reading machine. And now today in an article about a fossile of a pliosaur aka. predator X in Svalbard. They managed to place Svalbard in Scandinavia. Well it is quite a long way from the Scandinavian Peninsula to Svalbard

In another article someone is upset about prostitution on one of the boats inbetwen Sweden and Latvia. And they call it trafficking.

Human trafficking is the recruitment, transportation, harbouring, or receipt of people for the purposes of slavery, forced labor (including bonded labor or debt bondage), and servitude. (Definition frrecruitmentom wikipedia.)

Well i guess there could be cases where trafficking wictims are transported or recruited on the boats, but prostitution is the act of selling sexual services. And trafficking is the slave trade. So could we please keep the two things seperate so we know what we are talking about, that would help much more that whining in a tabloid.

how to take two stories and make a horrifying device

Well Aftonbladet a Swedish tabloid has made it again. This time by combining two different technological advances, and then combining them in an article to make it seem like researchers have invented a mind reading machine.

First they write four sentences about a British experiment where scientists have managed to discover where in a virtual world a subject is using a MRI to scan the brain. (Yes they are noisy, and claustrofobic you would notice if someone where scanning you…) Basically just reading out a trace of your spatial abilities. BBC have written about if here.

Then they continue with copying the content of a FOX News article about  “Future Attribute Screening Technology” (FAST) which is a technique to monitor how nervous a person is. This is all done by analyzing sweat, temperature, micro movements and breathing. Far from mind reading… (Also they manage to claim that it was a British invention when it in fact was American, also called MALINTENT developed by the U.S. Department of Homeland Security.

So by this simple method people can now be scared of riscing having their minds read.

Naturally the blogers got it right. For example here and here.
By the way, no idea to whear that foil hat. It will be dectected too..

shit and alcohol eq energy

Yesterday i wrote about garbage and “secondary raw materials”. Today i stumbled over another strange way of generating energy. In the Swedish cities Laholm and Båstad they extract heat and electricity from, hold your breath! Shit and fine spirits…

Basically they collect manure (that’s a nicer word for shit), leftovers from schools and restaurants and other organic waste and mix this with spirits confiscated from smugglers. Now they ferment this slurry for about 25 days and in the process a lot of methane is generated. Enough to cover 20-25% of the heating in the area and 21 million kilowatt hours of electricity. When they are done they return the dry remnants of the slurry to the farmers to use as fertilizer.

A translation by google translate can be found here.

two sides of a trash problem

The other day i picked up an issue of the magazine “Czech Buisiness Weekly” (CBW) at the Pink Floyd bar in downtown Prague.

It was mostly filled with articles regarding the Czech presidency for the European Union and the economic crisis. But in the editorial i found an interesting side effect of the global economic slowdown. A garbage crisis!

That is, the Czechs used to export a lot of garbage to China! And now due to the economic crisis China, the worlds biggest buyer of “secondary raw materials”. Have stopped buying and transporting garbage to China. I guess they don’t expect to refine so much Czech trash into Chinese trash and export it back to Europe.

Strangely enough a couple of days later i read as they used to do about the opposite problem in Gothenburg, Sweden. During the last six months the Swedish garbage production has dropped by 20%. So now there isn’t enough garbage to feed the remote heating system in Gothenburg. According to Dagens Industri they have started to import garbage from Norway and Holland to keep the Swedes warm.

So Swedish tourists visiting Prague, please bring your garbage with you back home and you will help two nations ;-)

the first security related bug in djbdns

As someone put it, hell froze over today.

Daniel Bernstein aka. djb for the first time have paid out the promised 1000$ for the first security related bug in djbdns.

Basically if you have a subdomain (a setup that is discouraged, but supported) in control by a third party that third party can poison your cache to send out wrong answers to dns queries. Details of the bug and how to exploit it can be found here.

But still the first alpha of djbdns was made public 10 years ago and this is the first security bug. (The current version of djbdns was released in February 2001) That is a really good security record, specially considering that a big company like Microsoft can’t even manage 10 months without new security bugs…

So there will be a new version released soon, and djb says there will be a new security guarantee.

Here is the original announcement from Bernstein:

Date: 4 Mar 2009 01:34:21 -0000
From: D. J. Bernstein
To: dns@list.cr.yp.to
Subject: djbdns<=1.05 lets AXFRed subdomains overwrite domains

If the administrator of example.com publishes the example.com DNS data through tinydns and axfrdns, and includes data for sub.example.com transferred from an untrusted third party, then that third party can control cache entries for example.com, not just sub.example.com. This is the result of a bug in djbdns pointed out by Matthew Dempsky. (In short, axfrdns compresses some outgoing DNS packets incorrectly.)

Even though this bug affects very few users, it is a violation of the expected security policy in a reasonable situation, so it is a security hole in djbdns. Third-party DNS service is discouraged in the djbdns documentation but is nevertheless supported. Dempsky is hereby awarded $1000.

The next release of djbdns will be backed by a new security guarantee. In the meantime, if any users are in the situation described above, those users are advised to apply Dempsky’s patch and requested to accept my apologies. The patch is also recommended for other users; it corrects the bug without any side effects. A copy of the patch appears below.

—D. J. Bernstein
Research Professor, Computer Science, University of Illinois at Chicago

— response.c.orig 2009-02-24 21:04:06.000000000 -0800
+++ response.c 2009-02-24 21:04:25.000000000 -0800
@@ -34,7 +34,7 @@
uint16_pack_big(buf,49152 + name_ptr[i]);
return response_addbytes(buf,2);
}
- if (dlen <= 128)
+ if ((dlen <= 128) && (response_len < 16384))
if (name_num < NAMES) {
byte_copy(name[name_num],dlen,d);
name_ptr[name_num] = response_len;