Skip to content

Instantly share code, notes, and snippets.

@strictlymike
strictlymike / pt.cs
Created Aug 24, 2016
Quick and dirty copy-pasta process tracing systray app for the curious and paranoid
View pt.cs
using System;
using System.Diagnostics;
using System.Drawing;
using System.Management;
using System.Windows.Forms;
namespace MyTrayApp
{
public class SysTrayApp : Form
{
@strictlymike
strictlymike / ptray2.cs
Created Aug 29, 2016
Enhanced quick and dirty copy-pasta process tracing systray app for the curious and paranoid
View ptray2.cs
using System;
using System.Diagnostics;
using System.Drawing;
using System.Management;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace MyTrayApp
{
public class SysTrayApp : Form
@strictlymike
strictlymike / trigger.c
Created Apr 22, 2017
Automated performance monitoring diagnostics trigger
View trigger.c
/**
* @file
* High CPU utilization in a particular process. Herein, Single-CPU
* %utilization for both threads and processes is calculated as:
*
* 100 * kernel + user
* %u1 = -------------------
* elapsed
*
* For multi-threaded applications, this figure can exceed 100% with regard to
@strictlymike
strictlymike / inspect.cpp
Created Apr 22, 2017
Automated performance monitoring application diagnostics
View inspect.cpp
/**
* @file
* A rough sketch of providing diagnostic information about to the state of an
* application relevant to diagnosing prolonged high CPU. When prolonged high
* CPU occurs, the high-level question that must be answered is:
*
* 1. What is the application doing?
* and,
* 2. Why aren't CPU throttling controls working? (if applicable)
*
View getpdb.py
import sys
import pefile
import struct
import httplib
import os.path
import argparse
# from urllib.parse import urlparse # Python 3
import urlparse
# PDB downloading adapted from:
@strictlymike
strictlymike / pwtopmost.c
Created Nov 21, 2019
Prevent Windows 10 from stealing the focus from the zip file password dialog
View pwtopmost.c
/* Prevent Windows 10 file transfer dialog ("0% complete") from stealing focus
* from "Password needed" dialog when copying files out of a password-protected
* zip file. */
#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "user32")
#define MY_EVENT_MIN EVENT_OBJECT_CREATE