Powered By Blogger

Freitag, 27. März 2015

Moving Active Directory integrated DNS zones from Windows 2000 Server to bind9

Since some weeks I am in the act of moving services from my virtual Windows 2000 server to my Ubuntu 12.04 machine. The first step was moving all files out of it so they are saved on my Ubuntu machine.

This post is about moving the Active Directory integrated DNS zones from Windows 2000 to bind9. First, a little bit about my current setup: 192.168.1.1, named speedy, offers DHCP and DNS services, while 192.168.1.2, named gspdc, offers Active Directory services and therefore also acts as a DNS server. Requests belonging the AD integrated domain (greatsoft.local) are forwarded from speedy to gspdc. This KB article from Microsoft shows an easy way to get all AD integrated DNS zones in files so that they could be processed by bind9. The easy trick is to simply convert those zones to "primary zone files": Afterwards, they are saved in the default DNS directory (that is normally %WINDIR%\System32\DNS). To get them to Ubuntu, I use SMB, so I first activated sharing the directory as "dns". On Ubuntu, I mounted the share:

root@speedy:/mnt # mount -t cifs //192.168.1.2/dns temp -o username=Administrator

Then I copied the files to /etc/bind9:

root@speedy:/mnt # cp -v temp/*dns /etc/bind

To make the database file names compliant with the standard of bind9, I renamed all of them and gave them a "db." prefix like all other database files have.

Until that moment, I used forwarding in bind9 to get DNS requests for *.virtual, *.greatsoft.local (AD integrated) and reverse DNS requests belonging 192.168.0.0/16 being resolved by Windows 2000.

root@speedy:/etc/bind # cat named.conf.gspdc
zone "greatsoft.local" {
    type forward;
    forwarders { 192.168.1.2; };
};

zone "virtual" {
    type forward;
    forwarders { 192.168.1.2; };
};

zone "168.192.in-addr.arpa" {
    type forward;
        forwarders { 192.168.1.2; };
};


That's not necessary any more: now the zone files are available in /etc/bind. In that directory, I edited named.conf and commented out the reference to named.conf.gspdc. The replace these zones, I created three files: named.conf.greatsoft.local, named.conf.virtual and named.conf.192.168.1.x.subnet which have contents like the following:

root@speedy:/etc/bind # cat named.conf.greatsoft.local
zone "greatsoft.local" {
        type master;
        file "/etc/bind/db.greatsoft.local.dns";
};


In contrast to the previous situation, I now have separate files for every /24 of 192.168.0.0/16, so reverse DNS queries for 192.168.1.0/24 are resolved by a different file than those for 192.168.2.0/24. I think that's easier to manage, because otherwise the zone database file could get too large.

Next task it to add those new named.conf.* files to the main configuration file, named.conf:

include "/etc/bind/named.conf.192.168.1.x.subnet";
include "/etc/bind/named.conf.greatsoft.local";
include "/etc/bind/named.conf.virtual";


Now it's time to restart bind9 by "service bind9 restart" and troubles finally begin. A simple "nslookup www.mkcs.at.virtual 192.168.1.1" just returns "** server can't find www.mkcs.at.virtual: SERVFAIL". But a "host -t TXT test.virtual" returns the text that I entered for it once (just for test purposes, as the name suggests), the same is true for my test entries for "test.test.virtual" (type A) and "eee1.test.virtual" (type AAAA). Using "grep named /var/log/syslog | tail -30" I found an interesting line:

/etc/bind/greatsoft.local.dns:33: gc._msdcs.greatsoft.local: bad owner name (check-names)

That is line 33 of file greatsoft.local.dns:

gc._msdcs               600     A       192.168.1.2

It's yet unclear to me why this causes an error. However, that entry was used by Active Directory, which I am about to deactivate, so I can relinquish entries like that. After uncommenting this line and the following lines that belong to that entry "gc._msdcs", I use

service bind9 reload

to tell bind9 it should reload its configuration and voilà, it works (tested from a client PC in my network):

michael@michimain1404:~$ host -t A www.mkcs.at.virtual
www.mkcs.at.virtual is an alias for w3mkcs.greatsoft.local.
w3mkcs.greatsoft.local has address 192.168.1.64

That's it! The final steps in deactivating that old (virtual) system will be shutting it down, (finally!) uninstalling VMware and then move it to a safe place in case I still need some data from it.

If anyone has suggestions for me how to improve that process, just let me know, I'd be curious!

Samstag, 12. April 2014

Rusch Wanduhr von IKEA mit eigenem Ziffernblatt

Vor vielen Jahren hatten wir uns mal beim IKEA die Wanduhr "Rusch" gekauft. Seit Dezember 2012 hing sie in unserem Badezimmer. Die öfters Mal feuchte Luft hat jedoch scheinbar dem Ziffernblatt nicht so gut getan. In den letzten Wochen wurde das Ziffernblatt immer mehr spröde und fing nach und nach an, sich aufzulösen.

Daher habe ich kurzerhand in LibreOffice Draw ein neues Ziffernblatt entworfen, was ganz einfach war: Der Durchmesser des Ziffernblatts beträgt 18 cm, also habe ich in Draw einen Kreis mit 18 cm Durchmesser gemacht, mit einem radialen Farbverlauf gefüllt und die Ziffern von "1" bis "12" in Schriftgröße 44 entsprechend positioniert. In die Mitte habe ich noch ein liebes Foto von Tobias und Jana gegeben. Dann noch ausgedruckt und ausgeschnitten: Fertig war das Ersatzziffernblatt. :-)

Nun war es noch notwendig, dieses in die Uhr zu bekommen: Auf der Rückseite der Uhr sind 3 Einkerbungen, die man mit einem Schlitzschraubendreher leicht öffnen kann, sodass sich die Verdeckung der Uhr ablöst. Tobias hat mir dann geholfen, das alte Ziffernblatt so gut wie möglich rauszubekommen. Es waren nur mehr hunderte Brösel. ;-) Dann habe ich vorsichtig zuerst den Sekundenzeiger, dann den Minutenzeiger und zum Schluss den Stundenzeiger abgenommen und zur Seite gelegt. Das neue Ziffernblatt habe ich mittig positioniert und dann einfach hineingedrückt. Dann habe ich die Zeiger wieder auf die entsprechende Vorrichtung gedrückt, die Abdeckung raufgedrückt, die Batterie wieder eingesetzt und die Uhr gestellt.

Und so sieht das Ganze aus:


Nun haben wir im Badezimmer wieder eine aktuelle Uhrzeit. :-)

Montag, 27. Januar 2014

New at Google Hangouts: Talk to a bot

Some weeks ago, some"one" called "Johnnie Sengvilay" contacted me at Google Hangouts:


As I am an open person and almost always like to talk to other people, I answered. That some"one" seemed to be a girl, seeking for a boy. So I thought: 1. I am rather too old for her 2. Possibly, I am rather too far away from her 3. Most important: I've got a family already. So the best thing seemed to me to tell her that somehow (not too directly, I don't want to be considered rude):


But she didn't answered my question but instead told me she felt "naughty" and wanted to have some fun. But how would she be able to have "fun" with me? After I told her that I don't need "more fun", she sent me a link to a JPG file. I didn't open it, because from that moment on, I thought that something would be wrong here. In the following days and weeks, she contacted me several times:


Yesterday I thought I would answer again and see if this was a bot:


Ah, I write "bed" and "it" writes something about "bed" back. Now, how to test for a bot simply? Just write something context sensitive, a "cheap" bot that wasn't programmed that good cannot react accordingly to that:


Ah! It writes back something that hasn't to do with what I wrote. Obviously, that bot became 2 years older in a month. ;-) Let's test again:


Okay. :-) Now there was no doubt: I was talking to a bot!


After writing some garbage, I thought it would be a good idea to tell the bot that I knew about it. Since then, there was no other message. :-) It seems that it reacts to the word "bot" or it understands "EOD".

Basically, writing such chat bots is a quite interesting and challenging discipline. They were around some years ago also on IRC and ICQ. Swedish music artist "Basshunter" even wrote a song about such a bot ("Boten Ana").

Freitag, 9. August 2013

Testing Windows 8.1 aka Windows Blue and Visual Studio 2013 Preview

Recently, I downloaded an evaluation build of Windows Blue and Visual Studio 2013 Preview in order to test both of them.

First, some words to Windows 8.1: All annoyances that affect me are still present, like what Microsoft calls "Modern UI" and switching around between that "Modern UI" and the desktop. I couldn't find a method to show the seconds in the clock (must be quite complicated to program *fg*), extra-complicated way just to view the current IP addess and many more. I am tired to count all of them - would Microsoft change anything? No, they wouldn't. At the beginning, I used Internet Explorer, but on blogger.com I got so many errors that I decided to install Firefox.

On the other side, Visual Studio 2013 Preview makes me delighted. Unfortunately, I never had the time to test VS 2012, so what I actually see are the differences between VS 2010 and VS 2013. The first thing that attracted my attention was C++/CX (component extensions) that enables you writing C++ programs targeting Windows Runtime. Unfortunately, in FILE | New | Project... there is no template for C++/CX console applications. I found a template for that, but it doesn't work in VS 2013 Preview:

Figure 1: Error message when trying to install CxxWinRTTemplate

However, it isn't that difficult to write C++/CX console applications. In the "New Project" dialog, select Visual C++ / Win32 / Win32 Console Application. Click "Next" various times, it's okay to leave the settings or change them as needed. Now we tell Visual Studio that we want to program against CX, so we open the project's properties page and navigate to "Configuration Properties", "C/C++", "General" and change "Consume Windows Runtime Extension" to "Yes". Next, we navigate to "All options" and set "Enable Minimal Rebuild" to "No". Last but not least we change "Additional using# Directories" to

C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral;%(AdditionalUsingDirectories)

This website was helpful for that. You need the using# staff in order to include Windows.winmd and Platform.winmd.

Then you can start writing your first C++/CX console program. :-) Of course, mine was to the traditional "Hello World" program:

#include "stdafx.h"
//#using <Windows.winmd> // not required in this case
#using <Platform.winmd>
using namespace Platform;

[MTAThread]
int main(Platform::Array^ args)
{
    Platform::String^ message("Hello");
    message = Platform::String::Concat(message, " World!");
    Platform::Details::Console::WriteLine(message);
    return 0;
}


Of course, C++/CX offers many more possibilities and allows a modern programming style that let the borders between C# und C++ melt. If I find something that I like very much, I'll report it.

Mittwoch, 26. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (4./5./6. Tag)

Am 4. Tag unseres Urlaubs waren wir in der Früh wieder beim Meer. Zu Mittag hat Astrid Nudeln mit Thunfischsauce gemacht.

Mmmmh, lecker!

Jana hat nach dem Mittagessen ein kleines Mittagsschläfchen gemacht, während Astrid mit Tobias eine tolle Fahrt auf einem Piratenschiff (inklusive Angriff auf ein anderes Piratenschiff) gemacht hat. Dort wurde viel getanzt und gesungen.

Piratenschiff "Jolly Roger"

Tobias auf der "Jolly Roger"

Am Abend fuhren wir alle gemeinsam wieder nach Jesolo, und dieses Mal suchten wir gleich ein Fahrrad. Wir strampelten 1 Stunde lang durch Jesolo und verdienten uns unser Abendessen redlich. Tobias meinte dann: "Ich habe schon einen Eistee- und Lasagnehunger!" Sein Wunschmenü bekam er natürlich, er war ja auch sehr aktiv an diesem Tag und hat alles aufgegessen. Trotzdem war bei Tobias, Jana, Nina und Lara noch Platz für eine Kugel Eis.

Am 5. Tag war es nicht so heiß wie an den anderen Tagen und auch die Luftfeuchtigkeit war spürbar geringer, sodass wir in der Früh nicht einmal die Klimaanlage brauchten. Trotzdem war das Wetter wunderschön, wenngleich es auch recht windig war. Am Meer waren die Wellen etwas höher als in den Tagen davor und das Meer war um einiges kälter (aber mit geschätzten 20 - 22 °C immer noch recht angenehm). Die etwas besser aushaltbaren Temperaturen haben wir dann genutzt, um mit dem Schiff nach Venedig zu fahren und uns dort ein bisschen was anzuschauen. Wir waren dann auch gleich in Venedig Abendessen und auch ein Eis durfte natürlich nicht fehlen.

Der 6. Tag unseres Urlaubs in Italien war dann leider auch schon der Letzte. In der Früh mussten wir schnell frühstücken und den Schlüssel abgeben. Um kurz vor 9 Uhr sind wir dann nach Jesolo gefahren, um dort das Aquarium und Terrarium anzusehen, wo wir Fische, Krokodile, Pinguine und Schlangen gesehen haben. Gekocht hat für uns McDonald's, dann sind wir noch einkaufen gegangen (haufenweise Nudeln, Tomaten, Getränke) und um 13 Uhr 45 Richtung Heimat aufgebrochen. Dabei haben wir scheinbar unendlich lange Autoschlangen gesehen, Zigtausende wollten an Meer (hauptsächlich Italiener). Um circa 15 Uhr 45 haben wir die Staatsgrenze überquert und im selben Moment hat es zum Regnen begonnen, sodass aus unseren Plänen, beim Wörthersee eine kurze Pause einzulegen, leider nichts wurde. Wir kamen dann auf der B 317 sogar in ein richtiges Unwetter, das Autofahren war alles andere als angenehm. Bei der Grenze zwischen Kärnten und der Steiermark wurde das Wetter aber wieder besser und nach einem kurzen Halt beim Hofer in Scheifling kamen wir dann um 18 Uhr 15 endlich zu Hause an.

Dienstag, 25. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (2./3. Tag)

Am 2. Tag unseres Urlaubs war ich in der Früh beim Auto etwas holen und habe überrascht festgestellt, dass es im Auto - im Gegensatz zu unserem Caravan - sehr kühl war. Am Vormittag waren wir abermals im Meer, aber auch in einem Schwimmbad am Campingplatz. Dieses ist mit einem Piratenschiff im Bad selbst ausgestattet, wo es zwei kleine Rutschen ins Becken, Wasserpumpem zum Erzeugen von Fontänen sowie einen sich regelmäßig automatisch leerenden Wasserkübel gibt. Am Abend waren wir dann noch am Spielplatz.

Unser Caravan

Am 3. Tag ist Tobias in der Früh, so wie an jedem Tag, gleich mal zu Nina und Lara gelaufen, um "Guten Morgen" zu sagen. Dann sind wir gleich runter zum Meer gegangen, um viele schöne Muscheln zu sammeln.

Jana und ich beim Muschelnsammeln

Am Nachmittag sind wir dann ins Sea Life Centre nach Jesolo gefahren, was den Kindern natürlich sehr gut gefallen hat. Danach waren wir noch einkaufen und sind dann in Jesolo zum "Beach Grill" Abendessen gegangen. Dort hat's für die Kinder gratis einen kleinen Eistee gegeben. Tobias hat natürlich - wie immer - Lasagne bestellt. Dann wollten wir noch Rad fahren gehen, aber leider war es bereits so spät, sodass alle Räder verliehen waren. Dafür durften die Kinder noch mit kleinen Autos fahren, was ihnen nicht nur Riesenspaß machte, Tobias hat sich sogar ganz gut als Autofahrer gemacht. Natürlich haben wir dann noch alle ein gutes Eis gegessen.

Montag, 24. Juni 2013

Urlaub in Ca' Savio (VE, Italien) (1. Tag)

Am Sonntag, 16.06.2013 war es soweit: Um 21 Uhr habe ich das Leihauto, mit dem wir nach Italien gefahren sind, geholt. Leider mussten wir beim Einbau unseres DVD-Players feststellen, dass die Zigarettenanzünder keinen Strom liefern. So mussten wir die geplante Abfahrtszeit (4:15) verschieben, um in Villach das Problem lösen zu lassen. Wir fuhren am Montag um 5 Uhr 5 in Leoben weg, um 7 Uhr 5 waren wir beim McDonalds in der Maria-Gailer-Straße, wo wir mal alle aufs Klo gingen und uns eine Kleinigkeit fürs Frühstück holten. Dann fuhren wir zum ÖAMTC, der gleich um die Ecke war, der uns jedoch mit Hinweis auf die Garantie des Fahrzeugs zum Škoda-Händler schickte, der glücklicherweise auch nur wenige Minuten Fahrzeit entfernt war. Dort wurde dann die Sicherung ausgetauscht und Tobias und Jana konnten die Wickie-DVD ansehen und ich mein Handy aufladen. Um 8 Uhr 10 fuhren wir wieder auf die Autobahn auf. In Italien hatte es um 8 Uhr 45 schon 28 °C. Um kurz nach 10 Uhr sind wir dann in Cessalto von der Autobahn abgefahren und schließlich um 10 Uhr 55 am Campingplatz angekommen.

Der Schlüssel zum Maxi Caravan war leider noch nicht da, weswegen wir erst mal zum Meer gingen. Den Kindern hat das natürlich gefallen. Um 12 Uhr bekamen wir dann den Schlüssel und es ging ans Auspacken der Koffer. Dann hatten wir natürlich alle schon einen großen Hunger, den wir am Campingplatz im Restaurant stillten. Wir bestellten Lasagne und Pizza, womit wir unsere Bäuche füllten. Danach gingen wir ins Meer baden. Am Abend kamen dann auch unsere Freunde mit ihren Kindern und wir gingen gemeinsam zum Abendessen. Abermals bestellte Tobias Lasagne. Als ich ihn fragte, wie die Lasagne geschmeckt hat, antwortete er: "Sehr lecker! Ein bisschen leckerer als in Leoben." Scheinbar muss ich noch an meinem Lasagnerezept arbeiten. ;-)