Skip to content

Instantly share code, notes, and snippets.

@xvitaly
xvitaly / remove_crw.cmd
Last active July 12, 2025 09:00
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@ian-abbott
ian-abbott / ntstatuserror.c
Last active December 19, 2022 13:16
C function to convert an NTSTATUS code into a Win32 error code - alternative to RtlNtStatusToDosError()
#include <windows.h>
/*
* This is an alternative to the RtlNtStatusToDosError()
* function in ntdll.dll. It uses the GetOverlappedResult()
* function in kernel32.dll to do the conversion.
*/
DWORD
ConvertNtStatusToWin32Error(LONG ntstatus)
{
@martiner
martiner / ihned-pw.user.js
Created October 30, 2015 19:20
iHned Paywall Remover
// ==UserScript==
// @name iHned Paywall Remover
// @namespace http://ihned.cz
// @description Removes iHned paywall cookie
// @include http:/ihned.cz/*
// @include http://*.ihned.cz/*
// @version 2
// @grant none
// ==/UserScript==
document.cookie = "pw=; path=/; domain=.ihned.cz; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
@Manouchehri
Manouchehri / rfc3161.txt
Last active July 16, 2025 14:24
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
@konradko
konradko / golang_on_rpi.md
Last active September 24, 2024 14:37
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@AlexMAS
AlexMAS / ProcessAsyncHelper.cs
Last active September 30, 2024 04:25
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
{
var result = new ProcessResult();
@joelverhagen
joelverhagen / VersionConventions.md
Last active August 3, 2018 15:37
NuGet Package Version Conventions

NuGet Package Version Conventions

CI packages and release packages

A common pattern for NuGet package versions is producing two sets of .nupkgs for every CI build. That is two sets of functionally equivalent packages produced from the same source. Two sets are:

  1. CI packages: a NuGet package version that is suffixed with a build number. This allows bleeding edge consumption of the latest APIs or fixes. These packages are typically pushed to a development package feed like VSTS or MyGet. Example version numbers: 4.0.0-rc-2046, 3.5.0-rtm-1996, 3.5.0-beta2-1543

One thing that surprises newer programmers is that the older 8-bit microcomputers from the 70s and 80s were designed to run at the speed of random memory access to DRAM and ROM. The C64 was released in 1982 when I was born and its 6502 CPU ran at 1 MHz (give or take depending on NTSC vs PAL). It had a 2-stage pipelined design that was designed to overlap execution and instruction fetch for the current and next instruction. Cycle counting was simple to understand and master since it was based almost entirely on the number of memory accesses (1 cycle each), with a 1-cycle penalty for taken branches because of the pipelined instruction fetch for the next sequential instruction. So, the entire architecture was based on keeping the memory subsystem busy 100% of the time by issuing a read or write every cycle. One-byte instructions with no memory operands like INX still take the minimum 2 cycles per instruction and end up redundantly issuing the same memory request two cycles in a row.

@aelij
aelij / RoslynReflection.cs
Last active November 5, 2019 23:12
Reflection using Roslyn (without loading assemblies into the app domain)
var compilation = CSharpCompilation.Create("C")
.AddReferences(MetadataReference.CreateFromFile(pathToAssembly));
foreach (var type in
from assemblySymbol in compilation.SourceModule.ReferencedAssemblySymbols
from module in assemblySymbol.Modules
from n in module.GlobalNamespace.GetMembers()
where n.IsNamespace
from type in n.GetTypeMembers()
select type)
@9999years
9999years / Enable-ANSIEscapes.ps1
Last active February 5, 2020 11:42
Powershell enable ANSI / VT100 escape sequences
# This is a total of 5 logical LOC, but the API is... well hidden and highly opaque
# (magic numbers everywhere!) so it warrents a few dozen lines of comments
function Enable-ANSIEscapes {
# Enable ANSI / VT100 16-color escape sequences:
# Original discovery blog post:
# http://stknohg.hatenablog.jp/entry/2016/02/22/195644
# Esc sequence support documentation
# https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx