Skip to content

Instantly share code, notes, and snippets.

View kevpar's full-sized avatar

Kevin Parsons kevpar

View GitHub Profile
package main
import (
"flag"
"fmt"
"os"
"unsafe"
"golang.org/x/sys/windows"
)
@kevpar
kevpar / main.go
Created November 3, 2023 20:49
Process info querying with containerd
package main
import (
"context"
"fmt"
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
"github.com/containerd/containerd"
"github.com/containerd/typeurl/v2"
)
package main
import (
"fmt"
"os"
"syscall"
"time"
)
func main() {
@kevpar
kevpar / div_ceil.rs
Created February 14, 2023 00:45
generic div_ceil
use std::ops::{Add, Div, Sub};
fn div_ceil<T>(n: T, d: T, s: T) -> <<<T as Sub<T>>::Output as Add<T>>::Output as Div<T>>::Output
where
T: Sub<T> + Copy,
<T as Sub<T>>::Output: Add<T>,
<<T as Sub<T>>::Output as Add<T>>::Output: Div<T>,
{
((d - s) + n) / d
}
package main
import (
"bufio"
"context"
"encoding/binary"
"fmt"
"os"
"strings"
"syscall"
package main
import (
"fmt"
"os"
"strconv"
"unsafe"
"golang.org/x/sys/windows"
)
package main
import (
"context"
"fmt"
"net"
"net/url"
"strings"
"time"
@kevpar
kevpar / main.go
Created April 9, 2021 19:11
gomodgraphviz
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {