pwnt.be

Asunción

If you like a bit of uplifting trance music, then why not check out Asunción, the latest melodic venture by yours truly? You know you want to.

Asunción, Paraguay at Night
Asunción, Paraguay at Night by alex-s
Some rights reserved

If you like what you hear—or, hell, even if you don’t—, be sure to listen to some of my other tunes as well. They’re all still absolutely free, so you’d better grab ’em before they hit the charts. It could happen.

Simple Linear Regression with JFreeChart

I’m sure there are numerous ways you can graph a simple linear regression using JFreeChart. Wanting to do so, I turned to Google and came across a few implementations. However, as none of them seemed terribly well written, I took a stab at it myself.

Basically, what I wanted was a scatter plot with the regressed line on top of it. As a bonus, I set out to include support for multiple data sets in one graph. JFreeChart allows you to combine data sets and create overlaid charts, so the whole thing was surprisingly easy. After looking at a few examples, I came up with the following:

Simple linear regression example
Simple linear regression example

Pretty nifty, huh? So, here’s how it’s done …

  • We start by creating a scatter plot from one or more series of data. The ChartFactory.createScatterPlot() method does exactly that, so I won’t elaborate on it here.

  • Next, we add a second data set to the plot. It will be used to render the regressed line and in fact consists of only two points per series: the end points of the line segment that will be drawn.

  • Obviously, JFreeChart already contains the functionality to draw line charts. Hence, all we need to draw the lines is a simple StandardXYItemRenderer. Thus, we create an instance of that class and associate it with the second data set.

  • And finally, some cosmetic surgery. Since JFreeChart does not know the scatter plot and line chart are related, it will paint associated series in a different color. Using setSeriesPaint(), however, we can easily match both renderers’ color schemes.

  • The result is a standard JFreeChart, which can be customized and visualized like any other one.

And that really is all there is to it. The resulting code can be found in RegressionDemo, which I am releasing under a GPL license. Enjoy.

Update: You’ll probably want to get rid of superfluous legend items. To do that, just tell JFreeChart that you want to hide them:

regressionRenderer.setBaseSeriesVisibleInLegend(false);

I took the liberty of updating the screenshot and code to reflect this.

The HTML 5 <audio> Element and You

Since HTML 5 started to emerge, modern web browsers have gradually been adopting its features. One of HTML 5’s cornerstones is Open Web technology. Arguably the most apparent improvement is that you no longer need a plug-in to watch a video clip: the <video> element lets you play a Theora clip on any page, and treat it like any other element. Along with <video> comes the highly similar <audio> element, which this site has now embraced. What that means for your weekend, after the break!

Record
Record by Seán Venn
Some rights reserved

The idea here is to gradually move away from Last.fm. Currently, all DJ CT songs are hosted there. Yeah, you can listen to them and all, but the fact of the matter is, their MP3 encoder really does a number on the audio quality—especially in the highs. Hence, eventually, I’m going to be hosting all of my songs right here on pwnt.be, in everybody’s favorite open format, Ogg Vorbis. I’ve already re-encoded all of them using oggenc’s default quality setting, which is a vast improvement over Last.fm’s MP3s, at roughly the same size. The files can be found right here.

Of course, a boring old directory listing isn’t the best way to deliver my music. That’s where HTML 5 comes in. Using a bit of MooTools-based JavaScript, I’ve developed a minimalist audio player for modern web browsers. That is to say, it’s only compatible with Firefox 3.5 and development builds of Google Chrome for now, but I’m working on that. If your browser is supported, you’ll see my elitist player pop up at my Oscillation page; if not, you’ll be directed to the downloadable file.

That’s about it. Incidentally, if you like what you hear, don’t forget to become a DJ CT fan on Facebook. You know you want to.

Automating OpenVPN Connection on Windows XP

We’ve been using OpenVPN at work for a while now. The technology itself is decent enough, but if you’re a Windows XP user, you’ll quickly get annoyed by the shortcomings of the rather Spartan OpenVPN GUI.

Personally, I had two main gripes. The first was that the TAP adapter, i.e. the virtual network interface, Cable unplugged would generate a cable unplugged system tray notification unless the VPN connection had been established. My second, more debatable annoyance was that, for security purposes, there’s no way to store your credentials in the client. In this article, I propose a straightforward solution to both these issues.

OpenVPN GUI
OpenVPN GUI

Dynamically Enabling the TAP Adapter

Under Windows XP, when you know a network connection is unavailable, the easy way to get rid of the cable unplugged warning is to disable the connection. This also works for the TAP adapter. Hence, if you can be bothered, just right-click the tray icon, select Disable, and there goes the warning. However, you will have to re-enable the adapter every time you want to use your VPN connection.

Luckily, you can also do so from the command line. Moreover, OpenVPN GUI can execute a batch script upon establishing as well as disengaging the VPN connection. Combining the two, you can fully automate the enabling-disabling process as follows.

  1. Install Microsoft’s DevCon utility for managing devices from the command line—if you thought the built-in Netsh would help you here, guess again. For convenience, be sure to add the containing folder to your PATH, or just place DevCon in system32, for instance.

  2. Run the following command to obtain the TAP interface’s ID:

    devcon find TAP*

    On my machine, it was simply ROOT\NET\0000.

  3. Open your OpenVPN configuration folder. Usually, it’s

    C:\Program Files\OpenVPN\config

    For the connection you wish to automate, there will be a .ovpn file sitting there. We will now create two small batch scripts, one for connection and one for disconnection.

  4. Still in the configuration folder, create a text file called profile_pre.bat. For instance, if your configuration file were called work.ovpn, you’d create work_pre.bat. Be sure to follow this naming scheme, as it’s required by OpenVPN GUI.

    The batch file should contain the following text:

    @echo off
    echo Bringing up TAP interface ...
    devcon enable @ROOT\NET\0000

    The first two lines aren’t required, but they clean stuff up a bit. The main thing is of course the last line, which you may need to modify if you got a different device ID earlier.

  5. Similarly, create another file called profile_down.bat, responsible for disabling the adapter when you disconnect:

    @echo off
    echo Taking down TAP interface ...
    devcon disable @ROOT\NET\0000

And that’s it. When you establish a VPN connection, a command prompt window should briefly pop up, enabling the adapter. When the connection is terminated, the same thing should happen, disabling the adapter.

Maybe you don’t want those windows to pop up. That can be arranged: just pass the option --show_script_window 0 to OpenVPN GUI.

Automatically Entering Credentials

As I mentioned, this second part is a bit more questionable. You may have strong feelings against automatically filling in logon dialogs, as do I. At the end of this article, I will discuss reducing the security risk a bit. However, if you are truly concerned about security, just memorize your password and enter it manually, or, better yet, use certificates instead. The latter wasn’t an option for me, which is the only reason why I explored automatically entering credentials—apart from laziness.

Before we begin, you should look at unofficial OpenVPN GUI builds that do allow storing your password. Just Google for the enable-password-save option and you’ll probably find a couple. Personally, I prefer using the official build and hacking my way around that.

… Although hacking is such a strong word, isn’t it? All we need to do is automate filling in the logon dialog. Several tools exist for this purpose, such as AutoHotkey. I went with AutoIt, since I already had it installed.

  1. So, if you don’t have AutoIt already, grab it and install it.

  2. Fire up AutoIt’s script editor and paste the following code:

    ; Close OpenVPN GUI if it’s already running.
    ; You may be using a different version.
    ProcessClose("openvpn-gui-1.0.3.exe")
    ; Start OpenVPN GUI.
    ; Change version, profile, and path if necessary.
    Run("openvpn-gui-1.0.3.exe --connect work.ovpn", _
        "C:\Program Files\OpenVPN\bin")
    ; Wait until the authentication dialog pops up.
    WinWaitActive("OpenVPN - User Authentication")
    ; Fill in your username.
    Send("username")
    ; Tab to the password field.
    Send("{TAB}")
    ; Fill in your password.
    Send("password")
    ; Confirm dialog input.
    Send("{ENTER}")
  3. Save the file as openvpn-work.au3 or whatever you like.

If you double-click the file, OpenVPN GUI will be fired up, AutoIt will automagically fill in your credentials and when it’s finished, you’ll have your VPN connection up. Note that the batch scripts from the first part of this article will not be affected by this at all.

Now to address that security concern expressed earlier. You can obscure your logon information a little by turning the plain-text AutoIt script into an executable. For this purpose, AutoIt comes with a utility called Aut2Exe. To build the executable, just right-click the .au3 file and select Compile Script. A .exe file of the same name will be generated. An additional benefit of this is that you can easily distribute this file instead of installing AutoIt on all your computers. Note, however, that it will still be easy to extract your credentials from the binary code.

Room for Improvement

So far, I’ve only found one shortcoming to this technique. Sometimes, the OpenVPN GUI logon dialog won’t get focus, blocking the AutoIt script until you click on the taskbar button. It still beats typing in the whole lot.

So, personally, I’ve attained my goal. I no longer have to burden myself with enabling and disabling the TAP adapter or entering my credentials. Hopefully, I won’t be the only one benefiting from this short tutorial. If nothing else, it’ll probably spark some comments about how much easier this stuff is on Linux or OS X. To which I say, “Meh.”

10 Days Off 2009 dag 5: Warmtefront

Noot: Naar aloude gewoonte leest u dit artikel eveneens bij Gentblogt.

De liefhebbers van het betere gebonk — had ik geen gevoel voor humor, dan alludeerde ik nu op dvd’s achterin uw sokkenlade — zaten alweer eventjes op droog zaad. Bijgevolg is hier mijn recensie van dag 5 van 10 Days Off, het elektronische-muziekfestival in Kunstencentrum Vooruit.

Matias Aguayo
Matias Aguayo

Op wat vooralsnog de nationale feestdag blijft, bood 10 Days Off opnieuw lang geen kwade selectie. In de concertzaal stond dit keer Tiefschwarz op het menu. Het duo is intussen dan wel een pijler van het festival geworden, maar mijns inziens moest men voor de meerwaarde opnieuw in het Vooruit-kaffee zijn. In tegenstelling tot op de nokvolle opening night, was de opkomst dit keer niettemin matig te noemen; dat hoeft u niet te verbazen, gezien de nakende dagtaak van velen.

Hoe dan ook begaf ik me bij aankomst naar het kaffee, alwaar de buitentemperatuur helemaal werd doorgedrukt door Matias Aguayo. De Argentijn draaide een ronduit zwoele set bij elkaar, verrijkt met zang, percussie en jawel, zelfs fluitgespeel van eigen makelij. Animo verzekerd, ook zonder de connotaties waar u zich misschien aan waagt.

Einzelkind
Einzelkind

Na deze toch wel letterlijke opwarmer was het de beurt aan Einzelkind — althans de helft ervan, al kan ik u niet vertellen welke. Zoals verhoopt, was ook deze set van exotisch en opzwepend allooi. Het heerschap hield er echter een klassiekere aanpak op na dan zijn voorganger. Het leek me dan ook het uitgelezen moment om de sfeer op te snuiven in de concertzaal, waar Tiefschwarz al een tijdje de draaitafels bemande.

Die sfeer zat best goed. De broertjes Schwarz weten wat het publiek wil en verkopen hun deephouse-gedreun dan ook met volle overtuiging. Laat ik dan geen fan zijn van wat ik met enige minachting het commerciëlere werk noem, wat het Duitse duo klaarspeelt, is zeker geen vanzelfsprekendheid. Ik wist me er zo’n halfuurtje mee te vermaken, hetgeen meer dan verdienstelijk is.

dj T. bij Tiefschwarz
dj T. bij Tiefschwarz

Vervolgens besteeg ik opnieuw de vele trappen om Einzelkind plaats te horen maken voor een ouwe rot. Daar was hij: dj T., medeoprichter van het ijzersterke Get Physical-label. Met een stoïcijnse schwung die enkel aan een Duitser toebedeeld kan zijn, bouwde de man een stevige set op. Naarmate de dosis groove toenam, kon er dan toch een bescheiden lachje en zelfs een dansje vanaf. Knap werk! Ook Matias Aguayo had zich intussen bij het gepeupel gevoegd en leek zich eveneens uitermate te vermaken.

Tot slot zakte ik alsnog even af naar de concertzaal. Daar hadden de Schwarzen immers de spreekwoordelijke fakkel doorgegeven aan Audiofly. Onvervalste technoproducties knalden er door de speakers, doorspekt met perfect gebrachte effectjes. Het gros van het publiek leek helaas amper geboeid, hetgeen vermoedelijk toe te schrijven was aan het late uur. Die dingen gebeuren.

Opnieuw was dit dus een geslaagd avondje 10 Days Off. Ga ik persoonlijk nog terug dit jaar, dan zal het wel aanstaande maandag zijn. Dan maakt de de M-nus-kliek, onder het alziend oog van Richie Hawtin, immers zijn opwachting. Wie wil ú nog aan het werk zien?

10 Days Off 2009 dag 1: Den Svenske Disco

Noot: Naar aloude gewoonte leest u dit artikel eveneens bij Gentblogt.

U wist het ongetwijfeld al, waarde lezer: de Gentse Feesten editie 2009 zijn van start gegaan. Dat betekent ook dat adepten van de elektronische muziek weer terecht kunnen in Kunstencentrum Vooruit voor 10 Days Off, een jaarlijks optreden van bekende dj’s — zo noemt mijn moeder dat namelijk. Al even traditiegetrouw gaat dit Gentse festival opnieuw gepaard met langverwachte recensies van mijnentwege.

10 Days Off

Alweer verkent 10 Days Off een allegaartje aan stijlen — het is écht niet allemaal dof gedreun, moet u weten. Van drum & bass tot disco, van electrorock tot minimal, wie een drumcomputer weet te appreciëren, vindt vast zijn gading in het aanbod. Wel lijkt het festival qua omvang op zijn retour: daar waar men enkele jaren geleden de setting nog moest uitbreiden met het S.M.A.K., wordt dit jaar zelfs de Vooruit-balzaal amper nog ingezet. Laat dat echter de pret niet drukken!

Op dag 1 stonden meteen tamelijk wat kleppers gepland. In de concertzaal maakten o.a. lokale helden The Subs en Dr. Lektroluv het mooie weer, terwijl in het café de Fanklub-dj’s het voorprogramma van de Zweedse formatie Slagsmålsklubben verzorgden. Op het laatste nippertje werd ook de balzaal alsnog geopend, voor een label night van Morse Records. Niet geheel onverwacht kwam dan ook het nieuws dat alle tickets de deur uit waren. Ikzelf was uiteraard op post om een verslag te voorzien voor de thuisblijvers.

Ook dit jaar biedt men, ter vervanging van een vestiaire, lockers te huur aan, hetgeen ik de voorbije jaren heb leren te waarderen. Helaas noopte het geringe aantal lockers me dit keer tot het meesleuren van mijn jas. Ik was dan wel rijkelijk laat gearriveerd, maar klaarblijkelijk was ik niet de enige gedupeerde. Wat meer is, in tegenstelling tot vorig jaar, kan een locker enkel nog per avond worden gehuurd, tegen niet minder dan 5 euro. Al koopt u al voor 15 euro een toegangskaart, dat is geen reden om te vervallen in dergelijke woekerprijzen. Het heerschap belast met de administratie deelde mijn mening en zou beide problemen aankaarten bij zijn overste; misschien is er dus beterschap in zicht.

Nu ja, het zij zo. Ik kwam tenslotte wel degelijk voor de muziek. Als opwarmertje gaf ik The Subs een luisterbeurt. De akoestiek in de concertzaal zal nooit aan mijn strenge kwaliteitseisen voldoen, maar voor het wilde punkspektakel van dit drietal vormt dat geen bezwaar. Zoals verwacht passeerden alle hits de revue en lustte de overvolle zaal er wel pap van. Luidkeels werd er ettelijke malen “Fuck that shit” gescandeerd; de toon was gezet.

Vervolgens verkaste ik naar het café, alwaar de dj’s van Fanklub, bekend van de hippe Blast Your Ghetto-feestjes, op hun eigenzinnige manier acte de présence gaven. Met enige nonchalance belandde menig puik nummer op de draaitafel, terwijl het café stilaan volstroomde voor wat volgen zou.

Slagsmålsklubben
Slagsmålsklubben

Ik was immers langs niet de enige die vooral voor Slagsmålsklubben naar de Vooruit was afgezakt, zo bleek. Wie deze zes Zweden nog niet kende, zag (en hoorde) daar spoedig verandering in komen. Monoloogjes over Asterix, vliegtuigen en verdovende middelen boden korte, broodnodige adempauzes voor zowel band als publiek, terwijl het volgende energetische Nintendo-melodietje in ijltempo werd voorbereid. Begeesterend was het om vervolgens de heren dolenthousiast de knoppen te zien beroeren op het al bij al bescheiden podium. Het café barstte uit zijn voegen en Slagsmålsklubben maakte het pand zelfs letterlijk onveilig. Het begon met een jongeling openlijk vragen om zijn joint op het podium te komen rollen en escaleerde, over een dansende menigte op het podium, tot een potje roekeloos crowdsurfen. Noem me gerust een spelbreker, maar ik vond de tussenkomst van het securitypersoneel niet onterecht. Maar de act zelf, die was in één woord fenomenaal.

Na een extatisch onthaald bisnummer, maakte het Scandinavische zestal plaats voor het net iets bekendere werk; de Britse dj/producer Riton besteeg het podium. Ik besloot eerst even mijn oor te luisteren te leggen in de concertzaal, alwaar Dr. Lektroluv het publiek reeds op zijn hand had. Het pseudoniem is dan wel gebleven, maar van electro was mijns inziens niet echt meer sprake. Niet dat dat zo’n probleem vormde, maar ik opteerde dan toch voor Riton. Al draaide die zeker geen onaardige set bij elkaar, de commerciële platenkeuze en het voorspelbare effectengetokkel ging toch snel vervelen.

In de concertzaal was intussen Sound of Stereo aangerukt. Hoewel ik dit tweetal eigenlijk aan het werk wou zien, zette ik er toch een punt achter; sinds ik het studentenleven gedag heb gezegd, is wakker blijven tot zonsopgang een beproeving geworden, moet u weten. Ik keerde dus huiswaarts, verzadigd en de hele tijd Zweedse 8-bitdeuntjes neuriënd.

Voor een volgend bezoek aan 10 Days Off zijn er voorlopig twee kanshebbers. Enerzijds verwelkomt men zondag het recentelijk herrezen duo Miss Kittin & The Hacker, maar ook o.a. het genie dat zich Nathan Fake laat noemen. Anderzijds staan dinsdag, naast Tiefschwarz, ook meesters van de groove Matias Aguayo, Einzelkind en dj T. op het programma. Welke acts wil ú graag zien? Ik hoor het graag!

Overheard in Ghent, volume 2

Wist u dat… Overheard in New York mij nu al twee exemplaren van het gelijknamige boek is verschuldigd, ter ere van winnende headlines?

Gelukkig ben ik niet haatdragend. Of neen, dat ben ik juist heel erg. Vuile rukkers zijn het. Maar daar ging het helemaal niet om. Ik wou eigenlijk gewoon onderstaand tafereel even reconstrueren.

Corpulente vrouwelijke paria: Is ’t goeie muziek?
Lichtgeraakte hipster: Mmm? (zet hoofdtelefoon af)
Paria: Ofdat ’t goeie muziek is.
Hipster: Mmm.
Paria: Welk genre is ’t? ’Ouse? Tegno?
Hipster: Ik ga nu verder luisteren.

—Bushalte, Korenmarkt

U mag raden welke van de twee betrokken partijen ik was. Se-ri-eus.

Ja, ik vond het zelf eigenlijk ook mijn blog onwaardig, maar kijk.

Food for Numerologists

I have a long-standing tradition of publishing my grades, so I’ve decided to do so one final time. The following is an overview of how I did on the prerequisite subjects for pursuing my PhD.

Subject Prognosis
Multimedia Networks 15/20
Design of Distributed Software 17/20
Optimization Techniques 11/20
Software Architecture 15/20
Queueing Theory 17/20

So that could’ve gone a whole lot worse. But now, I’m done showing off.

Serendipitously Sublime

Over the past few years, I’ve been collecting some of my HTML-related experiments under the /lab subdirectory of this web site. A couple of you have surely ended up there at some point, only to be confronted with a dull default directory listing. Well, not anymore.

Flasks
Flasks by Michos C
Some rights reserved

I have gathered my creations on the new Ingenuity page, accessible right from the navigation bar. You now get a pretty overview, with a word of explanation about each experiment, and even tiny preview images.

That is all for now—although I’m looking at apartments next week, so you can probably expect a lot of whinging about that in the near future.

U krijgt van mij 20 euro

Het wordt stilaan een gewoonte: word gratis klant bij Keytrade Bank, gebruik mijn promotiecode en u krijgt 20 euro startkapitaal.

Keytrade Bank
Keytrade Bank

Ik val dan wel in herhaling, maar u krijgt dus helemaal gratis:

  • een zichtrekening met 1,50% interest,
  • een betaalkaart met Proton en Maestro,
  • een premie van 5 cent per transactie,
  • een spaarrekening met 2,00% basisrente en
  • een beursrekening met competitieve tarieven.

Keytrade is natuurlijk een online bank, maar hoe vaak komt u nog in een bankkantoor? Bovendien is de webinterface prima uitgewerkt en weet ik uit persoonlijke ervaring dat men vakkundig en snel ondersteuning biedt via e-mail — de weinige keren dat dit nodig blijkt, uiteraard.

U zou allesbehalve de eerste zijn die op dit geweldige aanbod ingaat. Waarop wacht u dus nog? Begeef u snel naar Keytrade Bank, gebruik de promotiecode MM2517847323 en die premie is van u!

Opnieuw nodig ik iedereen uit om nadelen aan deze actie te bedenken. Ook andere reacties zijn zoals steeds welkom.

Noot: Deze actie is alweer afgelopen. Bedankt voor uw interesse.

Disorientation
Continuity
Retributions
Pidgin to Adium Emoticon Theme Converter
Tim, peter
A Message from Corporate Headquarters
lodenwijk
Google Chrome Still Sucks
Tim, milosh
Automating OpenVPN Connection on Windows XP
12vpn, Tim, neecom
10 Days Off 2009 dag 5: Warmtefront
Tim, lowieken
Colophonics