Samstag, 10. März 2012
Donnerstag, 23. Februar 2012
Shortest URLs of the Internet
Some TLD operators have DNS entries of type "A" directly on their DNS, so these are the shortest possible URLs in the Internet. I wrote a small program in just ten minutes that finds all of them using a list from IANA:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace TldDns
{
class Program
{
static void Main(string[] args)
{
WebClient wc = new WebClient();
string TldList = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt";
string[] allTlds;
using (StreamReader sr = new StreamReader(wc.OpenRead(TldList)))
{
allTlds = sr.ReadToEnd().Split('\n');
}
int cnt = 0;
IPAddress[] addresses;
foreach (string tld in allTlds)
{
if (cnt > 0)
{
try
{
addresses = Dns.GetHostAddresses(tld + ".");
if (addresses.Length > 0)
{
Console.WriteLine("Entries for {0}", tld);
foreach (IPAddress address in addresses)
{
Console.WriteLine(" " + address.ToString());
}
}
}
catch (Exception ex)
{
Console.WriteLine("Quering host entry for {0} caused an error.", tld);
}
}
cnt++;
}
Console.WriteLine("\nFinished.");
Console.ReadKey(true);
}
}
}
Unfortunately, if a domain has no A entry, Dns.GetHostAddresses throws an exception which slows execution down dramatically. The programs needs about 15 minutes (!) on my PC to run.
Here are the TLDs I found and if a web site is available too (having an A entry doesn't necessarly mean that a web server runs on that address):
http://ac/
http://ai/
cm (points to 195.24.205.60, no web site available)
http://dk/
gg (points to 87.117.196.80, no web site available)
http://io/
je (points to 193.223.78.212, no web site available)
kh (points to 203.223.32.21, no web site available)
ph (points to 203.119.4.7, no web site available)
http://pn/ (404?)
http://sh/ (forwards to http://www.nic.sh/)
tk (points to 217.119.57.22, no web site available)
http://tm/
to (points to 216.74.32.107, no web site available)
http://uz/
vi (points to 193.0.0.198, no web site available)
http://ws/ (forwards to http://www.website.ws/)
XN--O3CW4H (that's a IDN in some non-ASCII coding)
Interesting, isn't it? :-)
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace TldDns
{
class Program
{
static void Main(string[] args)
{
WebClient wc = new WebClient();
string TldList = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt";
string[] allTlds;
using (StreamReader sr = new StreamReader(wc.OpenRead(TldList)))
{
allTlds = sr.ReadToEnd().Split('\n');
}
int cnt = 0;
IPAddress[] addresses;
foreach (string tld in allTlds)
{
if (cnt > 0)
{
try
{
addresses = Dns.GetHostAddresses(tld + ".");
if (addresses.Length > 0)
{
Console.WriteLine("Entries for {0}", tld);
foreach (IPAddress address in addresses)
{
Console.WriteLine(" " + address.ToString());
}
}
}
catch (Exception ex)
{
Console.WriteLine("Quering host entry for {0} caused an error.", tld);
}
}
cnt++;
}
Console.WriteLine("\nFinished.");
Console.ReadKey(true);
}
}
}
Unfortunately, if a domain has no A entry, Dns.GetHostAddresses throws an exception which slows execution down dramatically. The programs needs about 15 minutes (!) on my PC to run.
Here are the TLDs I found and if a web site is available too (having an A entry doesn't necessarly mean that a web server runs on that address):
http://ac/
http://ai/
cm (points to 195.24.205.60, no web site available)
http://dk/
gg (points to 87.117.196.80, no web site available)
http://io/
je (points to 193.223.78.212, no web site available)
kh (points to 203.223.32.21, no web site available)
ph (points to 203.119.4.7, no web site available)
http://pn/ (404?)
http://sh/ (forwards to http://www.nic.sh/)
tk (points to 217.119.57.22, no web site available)
http://tm/
to (points to 216.74.32.107, no web site available)
http://uz/
vi (points to 193.0.0.198, no web site available)
http://ws/ (forwards to http://www.website.ws/)
XN--O3CW4H (that's a IDN in some non-ASCII coding)
Interesting, isn't it? :-)
Mittwoch, 15. Februar 2012
Grazer Hauptbahnhof Februar 2012
Heute habe ich vom 10. OG des Bauamts aus Fotos vom Grazer Hauptbahnhof gemacht und vorgestern und gestern vor dem neuen Bahnhofvorplatz.




Blick vom 10 OG des Bauamts auf die Straßenbahnunterführung und den neuen Bahnhofvorplatz (15.02.2012)
Blick zur Baustelle von ca. 1 OG des Bauamts (14.02.2012)
Blick auf die Baustelle vom nordseitigen Ausgang aus (13.02.2012)
Blick auf die Baustelle von der temporären Bushaltestelle der Linien 58/58E/63 aus
Labels:
2012,
Baustelle,
Eisenbahn,
Graz,
Hauptbahnhof
Samstag, 11. Februar 2012
Thank god there is convmv
Some years ago, a stupid error happend to me: As I found in some tutorials, I mounted a Windows share from my Windows 2000 Server on my Ubuntu machine with "mount -t cifs" and so on, and moved a lot of pictures files from the Windows server to my Ubuntu server. Some weeks later I discovered that a lot of filenames got srambled. In detail, it was some umlauts and the "ß" (we use these letters in German) and some "é" and "è" from french descriptions that were replaced by some strange characters. Today, I searched the web for a solution and found it: convmv! Just do a "apt-get install convmv" to get that small program and call it like this:
convmv -r -f cp850 -t utf-8 *
If would show you for every file in your folder and its subfolders, if there would be something to do. If you are happy with the results, you put a "--notest" at the end, so it reads like this:
convmv -r -f cp850 -t utf-8 * --notest
And your file names are fixed. :-)
Hint: It's quite more intelligent to leave file names as they are (for example, my digital camera gives them names like DSCN0305.JPG) and save remarks and descriptions in the EXIF metadata or the like. In previous times (before 2009) I used to rename photos and I found out that's it's a bad idea, not only because of encoding problems when transferring or archiving those files, but also because it's the default setting of almost every file system browser like Windows Explorer, Nautilus, Thunar and so on to sort files alphabetically. If you leave the default names from your camera, your sorting is always in the same order as you have taken the pictures (sorting by EXIF data is possible too for example in Windows Explorer, but this forces the file system browser to look up the EXIF data in every file which takes much longer than sorting by file name on current systems).
convmv -r -f cp850 -t utf-8 *
If would show you for every file in your folder and its subfolders, if there would be something to do. If you are happy with the results, you put a "--notest" at the end, so it reads like this:
convmv -r -f cp850 -t utf-8 * --notest
And your file names are fixed. :-)
Hint: It's quite more intelligent to leave file names as they are (for example, my digital camera gives them names like DSCN0305.JPG) and save remarks and descriptions in the EXIF metadata or the like. In previous times (before 2009) I used to rename photos and I found out that's it's a bad idea, not only because of encoding problems when transferring or archiving those files, but also because it's the default setting of almost every file system browser like Windows Explorer, Nautilus, Thunar and so on to sort files alphabetically. If you leave the default names from your camera, your sorting is always in the same order as you have taken the pictures (sorting by EXIF data is possible too for example in Windows Explorer, but this forces the file system browser to look up the EXIF data in every file which takes much longer than sorting by file name on current systems).
Google Toolbar in Firefox 10
Recently, Mozilla has released Firefox 10 and at the first start, the Google Toolbar disappeared. I did the trick I have reported about some weeks ago and voilà, Google Toolbar is here again. :-)
Montag, 23. Januar 2012
Erste Fahrt mit dem elektrischen Stadler GTW
Am 25.10.2011 bin ich ja schon mit Tobias mit dem dieselelektrischen Stadler-GTW (VT 5063 bei der GKB) gefahren. Nachdem ich heute Tobias in den Kindergarten gebracht habe, habe ich heute das Vergnügen, das Erste mal mit dem elektrischen Stadler GTW von Leoben Hbf (Abfahrt 08:18) nach Graz Hbf (Ankunft 09:03) zu fahren (4062 002). Wie bei neueren Zügen scheinbar üblich, hat auch dieser ein lautes, nerviges Gepiepse beim Schließen der Türen.
Das Innere gefällt mir ganz gut. Es ist sehr viel Platz - eigentlich fühlt man sich wie in der 1. Klasse! Im Gegensatz zu den sonst ganz tollen Talent der ÖBB hat dieser Zug auch eine Stromversorgung bei den Sitzplätzen! Das erinnert mich wieder daran, dass ich mal einen Zugbegleiter fragte, ob der Talent nicht irgendwo eine Steckdose hätte und dieser mir entgegnete: "Nein, das ist ja ein Nahverkehrszug!" Hm. Ich frage mich, was das eine mit dem anderen zu tun hat. Nachdem das Wort Nahverkehr für ÖBB auch eine mehrstündige Zugfahrt (z.B. Graz - Unzmarkt mit dem REX 1763: Fahrtzeit 1 h 48 min) bedeutet und nicht alle, so wie ich, ein Notebook haben, wo der Akku mehr als 8 Stunden hält, wäre es ja wohl nicht zu viel verlangt gewesen, wenigstens ein paar Plätze mit Steckdosen auszustatten.
Leider ist der REX um 8 Uhr 18 derzeit noch der einzige Stadler GTW von Leoben nach Graz. Mal sehen, was der nächste Fahrplanwechsel und die seit ca. 2002 alljährlichen Zugstreichungen der ÖBB in der Obersteiermark so bringen.
Die Sitze sind in etwa so hart wie beim Talent und nicht so weich wie beim Cityshuttle. Vor der Haltestelle ertönt eine kurze Melodie und eine weibliche Stimme sagt: "Nächste Haltestelle - Frohnleiten".
Vielleicht habe ich in Graz dann schnell die Gelegenheit, kurz in der Führerstand zu schauen. :-)
Die Sitze sind in etwa so hart wie beim Talent und nicht so weich wie beim Cityshuttle. Vor der Haltestelle ertönt eine kurze Melodie und eine weibliche Stimme sagt: "Nächste Haltestelle - Frohnleiten".
Vielleicht habe ich in Graz dann schnell die Gelegenheit, kurz in der Führerstand zu schauen. :-)
Abonnieren
Posts (Atom)
