Category Archives

Archive of posts published in the category: Coding

ILP Part 49 — Deadline24 2018 – Flow

This is the forty ninth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we solve the task B from Deadline24 2018 edition. Sewage system Introduction Beetlejumpers…

ILP Part 48 — Shapes and colors

This is the forty eighth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra You are given board with thirty rows and fifteen columns. For each cell you…

.NET Inside Out Part 8 — Handling Stack Overflow Exception in C# with VEH

This is the eighth part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# Today we are going to swallow Stack Overflow Exception…

DLL Injection Part 7 — Injecting Java code

This is the seventh part of the DLL Injection series. For your convenience you can find other parts in the table of contents in Part 1 – Registry We already injected native code into target, managed code into default application domain, and managed…

.NET Inside Out Part 7 — Generating Func from a bunch of bytes in C#

This is the seventh part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# In Capturing thread creation to catch exceptions we generated…

Transaction Scope time limit in ADO.NET

In ADO.NET there is a hard-coded system-wide limit for transaction set to 10 minutes. You cannot change it just like that in your web.config or App.config. You can change it in machine.config though. First, where are the machine configs? For 32 Bits: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machie.config…

VBS script to send an HTTP request

Another post with little script: Set o = CreateObject(“MSXML2.XMLHTTP”) o.open “GET”, “https://page.com”, False o.setRequestHeader “Header”, “Header value” ‘ Ignore certs (I bet you want to know how to do it) ‘ 2 stands for SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS ‘ 13056 means ignore all server side cert…

VBS script to check if workstation is locked

Well, here it is: Function IsWorkstationLocked( computer ) Dim wmi : Set wmi = GetObject(“winmgmts://” & computer & “/root/cimv2”) Dim logonScreenCount : logonScreenCount = wmi.ExecQuery (“SELECT * FROM Win32_Process WHERE Name = ‘LogonUI.exe'”).Count IsWorkstationLocked = (logonScreenCount > 0) End Function Dim o If…

Running VBS script in IIS

Sometimes you might want to deploy an incoming webhook for very simple use and do something when it’s called. On Windows you don’t need to have a full blown ASP.NET pipeline or even PHP server installed, you can go with simple VBS script.…

STM32 Key Part 4 — Server

This is the fourth part of the STM32 series. For your convenience you can find other parts in the table of contents in Part 1 – DES implementation We have all the building blocks for STM32 server, so let’s write it. Implementation main.c…

STM32 Key Part 3 — ARP, IP, UDP

This is the third part of the STM32 series. For your convenience you can find other parts in the table of contents in Part 1 – DES implementation Today we are going to handle some network packages on the STM32. Let’s go. Libraries…

STM32 Key Part 2 — Chat application

This is the second part of the STM32 series. For your convenience you can find other parts in the table of contents in Part 1 – DES implementation Today we are going to write very simple Java application to be able to see…

STM32 Key Part 1 — DES implementation

This is the first part of the STM32 Key series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 — DES implementation Part 2 — Chat application Part 3 — ARP, IP, UDP…

URL Encode in VBA

Short script found somewhere on the Internet for encoding URL in VBA: Function URLEncode(EncodeStr As String) As String Dim i As Integer Dim erg As String erg = EncodeStr ‘ *** First replace ‘%’ chr erg = Replace(erg, “%”, Chr(1)) ‘ *** then…

Logging in distributed system Part 5 — Parsing logs

This is the fifth part of the Logging series. For your convenience you can find other parts in the table of contents in Part 1 – Correlations We start with classes representing logs: using System; using System.Globalization; namespace LogHandler { public class LogEntry…

Logging in distributed system Part 4 — Passing data to other systems

This is the fourth part of the Logging series. For your convenience you can find other parts in the table of contents in Part 1 – Correlations We can generate correlation data on each request but we need to pass them throughout the…

Logging in distributed system Part 3 — Exceptions

This is the third part of the Logging series. For your convenience you can find other parts in the table of contents in Part 1 – Correlations So we need to handle errors and exceptions. Web jobs are already covered in the previous…

Logging in distributed system Part 2 — Action filters

This is the second part of the Logging series. For your convenience you can find other parts in the table of contents in Part 1 – Correlations We have our loggers and correlators, now we need to use them. Since we want to…

Logging in distributed system Part 1 — Correlations

This is the first part of the Logging in distributed system series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 — Correlations Part 2 — Action filters Part 3 — Exceptions Part…

.NET Inside Out Part 6 — Proxy handling casting in C#

This is the sixth part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# Let’s start with the following code: public interface IHaveASandwich…