Kraut & Rueben

this ‘n that with more of that on this

Lazy? You bet…

lazy

July 25, 2008 Posted by Gerald | career | | No Comments Yet

You are from Vienna, when

- you of course drink your beer in the streets
- you pass underground stations which Otto Wagner has built
- you understand the guy in the Ubahn when he says “Zug fährt ab”
- you don’t think it is strange when someone has never been to a district outside the Gürtel
- you can tell of people’s dialects from which district they are
- you don’t think it’s strange when all the students knocking the old wooden tables at the end of each class at university
- you don’t think it is strange drinking beer at flex with a business man next to a sandler
- you know the guy at schottentor who wants money to call his wife in the hospital since years!
- you know how to get home from the Arena in the middle of the night when you missed the last subway…
- you would NEVER move to another district
- you can’t believe you can’t go to the opera for 2 euros each night anywhere else
- you know it is normal to smell horse in the middle of the city
- you know you can go to the subway without a ticket easily
- and you know how the Schwarzkappler look like when they get into the train
- you act like putting money into the newspaper bags at weekend, but really stealing it.
- you know what “A Eitrige mit an Buckl und an Blech” means and where to get the best ones in the middle of the night.
- you are surprised if a waiter is friendly and fast
- at summertime you don’t get stopped from dressed-up-like-Mozart people who want to sell you tickets to overprized bad tourist concerts because they know you would never attend a concert in summer
- you think it is normal that no one is working from friday noon until monday morning.
- you know the Würstlstandbesitzer by name
- you think Kaiserin Sissi was a bitch.
- you’ve never been to a Sängerknaben-Konzert or Lippizaner-Show and will never do so.
- you know the difference between a Fiaker, an Einspänner, a Melange, a Großer Brauner and which one you like most.
- you boycott starbucks.

April 12, 2008 Posted by Gerald | career | | No Comments Yet

Windows PowerShell 2.0 CTP

 Using the Select-String Cmdlet

The information in this article was written against the Community Technology Preview (CTP) of Windows PowerShell 2.0.

 


Finding Text Using Select-String

The new remoting capabilities built into Windows PowerShell 2.0 represent the most-talked about feature of the recent Community Technology Preview (CTP) release. And for good reason: it is pretty to cool to be able to run PowerShell commands and PowerShell cmdlets against a remote computer. The truth is, even if that was the onlychange made to PowerShell that would be reason enough to download the CTP release. As it is, however, PowerShell 2.0 includes a number of other new features, ranging from brand-new cmdlets for working with WMI to useful little enhancements to existing cmdlets. Existing cmdlets like, say, the Select-String cmdlet.

The Select-String cmdlet is used to find target text within a file or a variable value. For example, suppose we saved the first paragraph of this article to a text file named C:\Scripts\Test.txt. Now, suppose we need to know whether this file contains the target string CTP. How could we determine whether the string CTP can be found anywhere in C:\Scripts\Test.txt? Like this:

Select-String C:\Scripts\Test.txt -pattern "CTP"

As you can see, this is a very simple little command: we just call Select-String followed: 1) by the item we want to search (C:\Scripts\Test.txt); and 2) the –pattern parameter (used to specify the target text; that is, the value we’re searching for). In return, Select-String will report back any matches that it found: C:\scripts\test.txt:2:about feature of the recent Community Technology Preview (CTP)

release. And for good reason: C:\scripts\test.txt:5:would be reason enough to download the CTP release.

As long as we’re on the subject, we should point out that Select-String reports back the file path, the line number, and the actual line in the text file where the target value was found. In some cases, that might be more information than you need; maybe all you need is the line number. In that case, you can pipe the output to the Select-Object cmdlet and select only the properties (FilePath, LineNumber, Line) that you’re interested in:

Select-String C:\Scripts\Test.txt -pattern "CTP" | Select-Object LineNumber

Or, tack on the –quiet parameter and get back nothing more than a Boolean value (True or False) that tells you whether at least one instance of the target text could be found:

Select-String C:\Scripts\Test.txt -pattern "CTP" -quiet

In and of itself, that’s pretty cool. But in PowerShell 2.0 several new parameters have been added to Select-String, including two that we’ll talk about in this article: -notMatch and –context. Let’s see if we can figure out what these two parameters do.

Top of pageTop of page

The –notMatch Parameter

Select-String was originally designed to return all the instances (e.g., all the lines in a text file) where a match occurred. However, there might be times when you’re interested in all the instances where no match occurred. For example, suppose you have a very simple text file (C:\Scripts\Test.txt), that looks like this:

Failed
Failed
Succeeded
Postponed
Failed
Succeeded
Succeeded
Postponed
Failed

As you can see, we have several different options here: Failed, Succeeded, and Postponed. Suppose you wanted to get back information on all the lines that include the word Failed. That’s easy enough:

Select-String C:\Scripts\test.txt -pattern "failed"

Ah, but what if you want all the lines in the text file that don’t include the word Failed? In Windows PowerShell 1.0, there’s no easy way to get that information.

In Windows PowerShell 2.0, however, there is a very easy way to get that information:

Select-String C:\Scripts\test.txt -pattern "failed" -notMatch

See what we’ve done here? We’ve asked Select-String to search through Test.txt looking for all instances of the word failed. However, we also tacked on the –notMatch parameter; this tells the cmdlet to return any lines in the text file that don’t contain the target word. In other words, -notMatch tells the script to return information like this:

scripts\test.txt:3:Succeeded
scripts\test.txt:4:Postponed
scripts\test.txt:6:Succeeded
scripts\test.txt:7:Succeeded
scripts\test.txt:8:Postponed

As you can see, the only information we got back were those lines in the text file that don’t contain the word failed. Which is what we were hoping to get back.

Top of pageTop of page

The –context Parameter

Sometimes searching for a target value can result in slightly-misleading output. For example suppose you use this command to search a log file for the word failure:

Select-String C:\Scripts\Test.lxt -pattern "failure"

Now, suppose Select-String reports back the following:

scripts\test.txt:4:a) Name Resolution failure on the current domain controller.

Name resolution failure on the current domain controller? Uh-oh; sound the alarm!

But wait. As it turns out, this entry in the log file actually reads (in part) like this:

Processing Failed 10/30/2007 10:04:05 AM
The processing of Group Policy did not succeed. Windows could not resolve the
computer name. This could be caused by one or more of the following:
a) Name Resolution failure on the current domain controller.
b) Active Directory Replication Latency (an account created on another
domain controller has not replicated to the current domain controller).

In other words, you might have a name resolution failure. But, then again, you might not; this is just one of several possible problems.

What that means is that context can be very important when extracting information from a text file. And that’s too bad, because context is something that the Select-String cmdlet simply cannot provide.

Well, not unless you use the –context parameter, that is.

As the name implies, the –context parameter not only finds matches but also lets you view those matches in context. That’s great. But what, exactly does that mean?

To answer that question, let’s modify our previous command by adding the –context parameter:

Select-String C:\Scripts\Test.lxt -pattern "failure" –context 2

What’s the 2 passed to –context for? That simply tells the script that, when it comes time to display any matches, we don’t want to see just the line of text where the match occurred. Instead, we also want to see the two lines of text immediately preceding that line as well as the two lines of text immediately following that line. In other words, we want output that looks like this (note that the line where the match occurred can be identified by the right angle bracket [>]):

  scripts\test.txt:2:The processing of Group Policy did not succeed. Windows could not resolve the
  scripts\test.txt:3:computer name. This could be caused by one or more of the following:
> scripts\test.txt:4:a) Name Resolution failure on the current domain controller.
  scripts\test.txt:5:b) Active Directory Replication Latency (an account created on another
  scripts\test.txt:6:domain controller has not replicated to the current domain controller).

That’s more like it; now we know that while we might have a Name Resolution failure we might also have some other problem instead (e.g., an Active Directory replication problem). That could save us from spending an enormous amount of time and energy pursuing a problem that doesn’t even exist.

If you prefer, you can specify different values for the lines preceding a match and the lines following a match. For example, this command shows us the 3 lines immediately preceding a matched line, as well as just the 1 line immediately following a matched line:

Select-String C:\Scripts\Test.lxt -pattern "failure" –context 3,1

Using our sample text, that results in output that looks like this:

  scripts\test.txt:1:Processing Failed 10/30/2007 10:04:05 AM
  scripts\test.txt:2:The processing of Group Policy did not succeed. Windows could not resolve the
  scripts\test.txt:3:computer name. This could be caused by one or more of the following:
> scripts\test.txt:4:a) Name Resolution failure on the current domain controller.
  scripts\test.txt:5:b) Active Directory Replication Latency (an account created on another

Very nice.

A bonus Select-String Tip. By default, Select-String does case-insensitive matching; that means the letter case is ignored which, in turn, means that both FAILURE and failure will be tagged as matches. If you’d prefer to perform a case-sensitive match, in which FAILURE and failure do not match, then simply add the –caseSensitive parameter.

April 10, 2008 Posted by Gerald | career | | No Comments Yet

Drohbotschaft" Videoclip auf "YouTube" warnt Susanne Winter

Die Grazer Lokalpolitik sorgt weiter für Schlagzeilen. Gegen die FPÖ-Spitzenkandidatin für die Gemeinderatswahl, Susanne Winter, ist auf dem Online-Videoportal YouTube am Dienstag ein “Drohvideo” aufgetaucht. Darin werden die islamfeindlichen Ausritte Winters als “Fehler” bezeichnet und indirekt Anschläge angedroht. Die Islamische Glaubensgemeinschaft in Österreich erstattete Strafanzeige gegen Winter und die FPÖ, die “Globale Islamische Medienfront” (GIMF) rief sogar in E-Mails zur Tötung Winters auf. Im Drohvideo wird außerdem ein Bild der Anschläge vom 11. September 2001 in New York gezeigt und mit folgendem Text unterlegt: “Schau her Susanne wegen deiner Aussage kann so was Ähnliches auch in deinem Land passieren – du bist verantwortlich dafür”. Am Ende des Videos heißt es: “Made by Bilal & Jasko”. Nach ersten Ermittlungen der Polizei könnten Bestandteile des Videos auf einen möglichen serbischen Hintergrund hindeuten. Am Ende des knapp fünfminütigen Clips ist ein Wappen zu sehen, das immer wieder mit der Region Sandschak in Verbindung gebracht wird, in der hauptsächlich Muslime leben. In der Machart unterscheidet sich das Video allerdings sehr stark von den bisher in Österreich aufgetauchten Drohbotschaften islamistischer Gruppierungen. Nach einer Meldung, das Drohvideo sei auf Weisung der Ermittler von der Internetplattform YouTube entfernt worden, stellte der Sprecher des Innenministeriums, Rudolf Gollia, klar, dass die Entfernung nicht durch die Exekutive veranlasst wurde. Tatsächlich dürften die Urheber der Botschaft den Clip selbst vom Netz genommen haben. Weitere Details zu den Ermittlungen wollte Gollia am Montag nicht nennen. Auch zum vermuteten serbisch-moslemischen Hintergrund wollte sich Gollia nicht äußern: “Wir bestätigen diesbezüglich gar nichts.” Die Aufklärungsarbeit gehe aber voran, man wolle versuchen, den Fall “mit allen zur Verfügung stehenden Möglichkeiten” aufzuklären. Islamische Glaubensgemeinschaft erstattet Anzeige Die Islamische Glaubensgemeinschaft in Österreich hat gegen Susanne Winter indes Strafanzeige wegen Herabwürdigung und Verspottung religiöser Lehren eingebracht. Die “Beschimpfung des Propheten des Islam in dieser Form ist eine Herabwürdigung und Verspottung. Der Vergleich der Muslime mit einer Tod und Verderben bringenden Naturkatastrophe hat ebenfalls zum berechtigten Ärgernis von Muslimen geführt”, heißt es in der Strafanzeige. Die Islamische Glaubensgemeinschaft in Österreich “zeigt daher Frau Winter als Privatperson und die FPÖ als Partei an”. Islamisten rufen zur Tötung Winters auf Die “Globale Islamische Medienfront” (GIMF) hat in E-Mails an TV- und Zeitungsredaktionen zur Tötung der Grazer FPÖ-Politikerin aufgerufen. Der Sprecher des Innenministeriums, Rudolf Gollia, erklärte am Dienstagabend, man sei informiert. “Allerdings auch nur aus den Redaktionen. Die nutzen einfach die Medien und schreiben E-Mails”, aber es gebe noch nichts Abrufbares im Internet. Die GIMF kündigte im Internet eine Stellungnahme zu den Islam-Aussagen von Winter an. Darin wird der Integrationsbeauftragte der Islamischen Glaubensgemeinschaft in Österreich, SPÖ-Politiker Omar Al-Rawi, als “Agent der Ungläubigen” bezeichnet. “Seine Aufgabe wäre es als Vertreter der Muslime, das islamische Urteil über solche Leute wie Susanne Winter zu erklären, nämlich dass diese Leute getötet werden müssen und ihr Besitz und ihr Blut für die Muslime erlaubt ist”. Drohvideo stammt nicht von GIMF Weiters kündigte die GIMF für die nächsten Tage eine ausführliche Stellungnahme an, in dem sie die Beweise dafür anführen will, “dass diese Beleidiger des Propheten getötet werden müssen und auch jeder Muslim diese Tötung durchführen darf.” Weiters wird darauf hingewiesen, dass “wir die anderen FPÖ-Politiker genauso wie Susanne Winter ansehen, solange diese sich nicht von diesen Aussagen distanzieren.” Abschließend wird darauf hingewiesen, dass das “einfache Amateur-Video” gegen Susanne Winter, das am Dienstag in der Internet-Plattform “Youtube” veröffentlicht wurde, nicht von der GIMF stammt. GIMF verfasste Drohvideo gegen Deutschland und Österreich Die GIMF wird von Islamkennern als Anlaufstelle für die radikale Sprache von Jungislamisten gesehen. Es handle sich um eine “Radikalisierung in Echtzeit, die man nachvollziehen kann. Das ist gefährlich und muss uns Sorge bereiten”, hatte zuletzt der Berliner Islam- und Terrorexperte Yassin Musharbash erklärt. Zuletzt hatte die GIMF ein Drohvideo gegen Deutschland und Österreich verfasst, in dem der Abzug von Soldaten aus Afghanisten verlangt wurde.

well done, die gute Frau hat einfach recht

January 16, 2008 Posted by Gerald | career | | No Comments Yet

Quoting Confucius

Before you embark on a journey of revenge, dig two graves.

That’s why quotes suck

YOU killed and died, that really should be sufficient contribution to this operation. Go, let somebody else worry about graves or agree on digging in personam  ex post.

16092007051

January 2, 2008 Posted by Gerald | career | | No Comments Yet

Flickr

This is a test post from flickr, a fancy photo sharing thing.

October 8, 2007 Posted by Gerald | career | | No Comments Yet

Flickr

This is a test post from flickr, a fancy photo sharing thing.

September 25, 2007 Posted by Gerald | career | | No Comments Yet

Sacked, bored and lacking ambition? Why not apply for a freelance consulting role?

Being freelance, no doubt about it has its upsides. The 3 most important have to do with money

you simply make more of it.

And the added risk? Well, I’ve provided services to the financial industry for the better part of 8 years for Deutsche Bank in Germany, for Commezbank and since 30 months for ABN AMRO in Amsterdam. And guess what – I’ve seen more then one round of “headcount reduction” or “Kosteninitiative” but it was always the expensive freelancers that survived unharmed, internals getting their pink slips. And still to act as if riding on a razors edge, everybody believing? Priceless. But externals are by and large more competent and focused on the customers needs? Bull,

I’ve seen retarded morons on the roll in this business, more than I care to and can count, some of them more thank once.

My best guess regarding the real reasons for this behaviour has to do with psychology and the notorious tendency of us – the human species – to justify the our decisions and/or assumptions. Based on that mindset, believe me, the performance of more expensive staff will steadily improve. Its like being a developer, having just spent 6 interesting hours optimizing hell out of some arcane piece of sh.., hmmm, code. Believe me, next time you check on the optimized section you WILL perceive significant gains. Everybody tried the same stunt with carefully instrumented code? Surprise, surprise. So don’t hesitate, take buzzwording and bullshitting lessons, learn legalese.

c u l8er, in the cubicle next to me

August 22, 2007 Posted by Gerald | buzzwording & bullshitting, career | | No Comments Yet