Category Archives: Coding

Datalagrinsdirektivet (DLD) zero-day exploit

I forbindelse med høringen om Datalagringsdirektivet så tenkte jeg å lage en liten zero-day exploit. Det vil si en exploit som er ute før sikkerhetshullet er fikset, eller i dette tilfellet allerede før sikkerhetshullet er implementert. DLD virker lite meningsfullt for alle som ikke har en post-it lapp hengende på skjermen som sier “HUSK! VG – BLÅ ikonet,… Read More »

Making ASP.Net recompile go faster

When developing in ASP.Net one often recompiling frequently to test changes and hunt for bugs. If the project is of any size this recompile can take quite some time. I was searching for information on how optimize ASP.Net recompile and I found an interesting article. Basically you add optimizeCompilations="true" to the <compile> tag in web.config. If you have… Read More »

History of IRC apps I've made

Throughout the years I’ve written a lot of IRC related programs as hobby projects. Here is a summary of what I can remember at least… mIRC IRC server (1996->1998?) When mIRC scripting got socket support back around 1996-1998(?) I wrote an IRC server in mIRC scripting. I remember it was surprisingly easy to use mIRC scripting for this.… Read More »


For the past 10 years I’ve been coding IRC clients on and off as sort of a hobby. Only a couple has been released in alpha, but I usually started redeveloping them from scratch at some point. And here we are again. Nimbus.IRC (originally Tedd.IRC) is the working name of yet another IRC client I’ve written. This time… Read More »

Bug in Mono.Cecil

I’m encountering this annoying bug in Mono.Cecil… It seems that when modifying the assembly it calculates wrong offset, depending on what I add… Basically Mono.Cecil adds a jump out of the method. Which in short leads to broken assemblies: [IL]: Error: [C:\…\Tedd.Fibres\Tedd.Fibres.Test.GUI\bin\Debug\Tedd.Fibres.TestModule_out.dll : Tedd.Fibres.TestModule.TestClass::Test][offset 0x00000028] Branch out of the method. I managed to Google some other people having… Read More »

Perl: Command-line regex

A few command-line tricks for Perl: Filter based on regex (like grep -E) cat file.txt | perl -n -e ‘print if /regex.*matched/’ Replace based on regex cat file.txt | perl -n -e ‘s/regex.*matched/replacement/gi’ Replace based on regex inside file (will change file) perl -pi -e ‘s/regex.*matched/replacement/gi’ *.txt Replace based on regex inside file (will change file) and make… Read More »

Perl: Modify certain line number in text-file

Just wrote up a small pseudocode for a previous post here. [sourcecode type=”php”] open (IF, "infile.txt"); open (OF, "outfile.txt");   while (my $line = <IF>) {     $count++;     if ($count == 10) {       # Modify       print OF "somethingelse\r\n";     } else {       # Don’t modify       print OF $line;     }   } close(OF);… Read More »

Tip: Always use ASP.Net State Server during development

Always use ASP.Net State Server during development Using “ASP.Net State Server” during development forces developers to use serializable-attribute on all objects stored in Session. Reasons: No extra effort required by the developer. Changing to ASP.Net State Service or SQL session storage on a solution not developed for it requires a full and extensive test of the whole solution. If… Read More »