Category

Coding

19 articles in this category

Use PowerShell to get total size of files recursively

June 20, 2024 1 min read

Here’s a one-liner in PowerShell to get the total size of all files found with wildcard pattern of *ORIGINAL*. [math]::round((get-childitem -path . -filter "*ORIGINAL*" -file -recurse | measure-object…

PHP real-time system command output

June 12, 2023 1 min read

Throwing some notes here for me to remember on having PHP not buffer the output of a long running process so that it provides realtime output to the…

A Port Scanner in C

June 9, 2023 5 min read

The following port scanner C code checks approximately 65535 ports in about 15 seconds on-network. #include <stdio.h> #include <stdlib.h> #include <netinet/in.h> #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> #include…

A BOFH Generator in C

June 9, 2023 1 min read

// gcc bofh.c -o bofh #include <stdio.h> #include <stdlib.h> #include <time.h> #define NUM_QUOTES 10 const char* bofh_quotes[NUM_QUOTES] = { "No, my powers can only be used for good.",…

Analyze RDP Disconnection Logs using PowerShell

February 7, 2023 3 min read

The PowerShell script is designed to extract information about Remote Desktop Protocol (RDP) local session manager events from the Windows event logs on a RDS host and save…

Writing a portscan utility in .NET

January 30, 2023 1 min read

I’m working on a side project that is a portscan utility written in VB.net. Here’s my progress so far, and it is working. There’s some way to go…

Handling Commandline Arguments in VB.NET

January 27, 2023 3 min read

Handling commandline arguments in VB.NET (or really anything) can be tricky. I came across the following class the other day while looking for a drop-in solution to a…

Check Windows Servers Activation Status

October 7, 2022 1 min read

I needed a quick way to check activation status of Windows Servers in a domain. This is the solution I came up with using PowerShell to run the…

FileSystemWatcher – LastAccess Not Working

September 21, 2022 1 min read

To have System.IO.FileSystemWatcher LastAccess work, the system must have access logging enabled with the following command. fsutil behavior set DisableLastAccess 0 After setting this, reboot, and you can…

Pennsylvania COVID-19 Data Scraping with Python

March 29, 2020 2 min read

Over the last few weeks I've been using Python to scrape the Pennsylvania Department of Health's Coronavirus page. Over time the page has evolved and even split into…

Login to WordPress from Python

October 27, 2019 1 min read

I've been trying to learn some Python and have been tinkering with the requests module. Here is how I am able to log into a webpage, such as…