Skip to content

Instantly share code, notes, and snippets.

View mxpv's full-sized avatar

Maksym Pavlenko mxpv

View GitHub Profile
@mxpv
mxpv / windows_build_numbers.txt
Last active June 5, 2023 06:53
Windows build numbers
Windows Name or Service Pack Version Number
---------------------------- --------------
Windows 1.0 1.04
Windows 2.0 2.11
Windows 3.0 3
Windows NT 3.1 3.10.528
Windows for Workgroups 3.11 3.11
@mxpv
mxpv / ProcessUtil.cs
Created September 28, 2012 09:31
Process start helper utility with CancellationToken and async output reading support
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading;
using Microsoft.Win32.SafeHandles;
namespace ConsoleApplication
{
public class ProcessUtil : IDisposable
{
@mxpv
mxpv / Win32.h
Created May 2, 2013 13:27
Slim version of windows.h header
#ifndef SYS_WIN32_H
#define SYS_WIN32_H
// Slim version of windows.h header
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef WIN32_EXTRA_LEAN
func TestBenchmarkListImages(t *testing.T) {
tmpDir := t.TempDir()
specFile := filepath.Join(tmpDir, "1.json")
testSpec := imagespec.Image{
Author: "1",
Architecture: "2",
Variant: "3",
OS: "4",
Config: imagespec.ImageConfig{
User: "c",
$ curl http://127.0.0.1:3338/v1/metrics
# HELP container_cpu_kernel_nanoseconds The total kernel cpu time
# TYPE container_cpu_kernel_nanoseconds gauge
container_cpu_kernel_nanoseconds{container_id="test120",namespace="default",runtime_class="io.containerd.runtime.v1.linux"} 1e+07
container_cpu_kernel_nanoseconds{container_id="test12345",namespace="default",runtime_class="io.containerd.other.v2"} 1e+07
# HELP container_cpu_throttle_periods_total The total cpu throttle periods
# TYPE container_cpu_throttle_periods_total gauge
container_cpu_throttle_periods_total{container_id="test120",namespace="default",runtime_class="io.containerd.runtime.v1.linux"} 0
container_cpu_throttle_periods_total{container_id="test12345",namespace="default",runtime_class="io.containerd.other.v2"} 0
# HELP container_cpu_throttled_periods_total The total cpu throttled periods
@mxpv
mxpv / benchmark_test.go
Last active September 18, 2018 23:59
Containerd decompression benchmark
package compression_test
import (
"bytes"
"crypto/md5"
"io"
"io/ioutil"
"os"
"os/exec"
"testing"
@mxpv
mxpv / gist:2935715
Last active April 18, 2018 19:16
InstallShield Custom Actions notes

Deferred Custom Actions

To adhere to the Windows Installer "Best Practices," all changes that are made to a system are in a "deferred" action.

A deferred execution custom action must be scheduled in the execute sequence table within the section that performs script generation.

Deferred execution custom actions must come after "InstallInitialize" and come

@mxpv
mxpv / gist:5262043
Created March 28, 2013 09:52
Git caret and tilde
http://paulboxley.com/blog/2011/06/git-caret-and-tilde
http://alblue.bandlem.com/2011/05/git-tip-of-week-git-revisions.html
@mxpv
mxpv / gist:034933deeebb26b62f14
Last active January 15, 2016 23:26
URL tests
Should pass:
http://foo.com/blah_blah
http://foo.com/blah_blah/
http://foo.com/blah_blah_(wikipedia)
http://foo.com/blah_blah_(wikipedia)_(again)
http://www.example.com/wpstyle/?p=364
https://www.example.com/foo/?bar=baz&inga=42&quux
http://✪df.ws/123
http://userid:password@example.com:8080
@mxpv
mxpv / gist:5879528
Created June 27, 2013 19:21
How to make sublime text the default editor for git on Windows
git config --global core.editor "'c:/program files/sublime text 2/sublime_text.exe' -w"