Author Archives

Archive of the posts written by author : afish.

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…

Executing SQL query inside Excel spreadsheet

Did you know that you can execute almost any SQL query directly in your Excel spreadsheet? This can be very useful for executing queries with GROUP BY and aggregates since they cannot be generated that easily. Let’s begin. I will use Excel 2013…

ILP Part 47 — Battleship puzzle

This is the forty seventh 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 are going to solve Battleship puzzle. It is very similar to nonograms…

Sitefinity Part 4 — Turning on Redis in Sitefinity in Azure

This is the fourth part of the Sitefinity series. For your convenience you can find other parts in the table of contents in Sitefinity Part 1 — Capturing logs Last time we saw how to change database connection string for Sitefinity which can…

Sitefinity Part 3 — Dynamically changing database connection string in Sitefinity

This is the third part of the Sitefinity series. For your convenience you can find other parts in the table of contents in Sitefinity Part 1 — Capturing logs Sitefinity stores its database connection string in App_data\Sitefinity\Configuration\DataConfig.config so you can easily modify connection…

Sitefinity Part 2 — Dependency injection in Sitefinity

This is the second part of the Sitefinity series. For your convenience you can find other parts in the table of contents in Sitefinity Part 1 — Capturing logs In order to use DI in Sitefinity you need to configure two mechanisms. One…

Sitefinity Part 1 — Capturing Sitefinity logs and pushing them to Azure Storage

This is the first part of the Sitefinity series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 — Capturing logs Part 2 — Dependency Injection Part 3 — Changing connection string Part…

SQLxD Part 23 — Query parser tests

This is the twenty third part of the SQLxD series. For your convenience you can find other parts in the table of contents in Part 1 – XML Transformation Here go the tests for query parser: using System; using FluentAssertions; using Model; using…