Skip to content

Instantly share code, notes, and snippets.

View christian-korneck's full-sized avatar
💭
I may be slow to respond.

Christian Korneck christian-korneck

💭
I may be slow to respond.
View GitHub Profile
@jborean93
jborean93 / Get-ServiceCredential.ps1
Last active April 10, 2025 20:25
Get's the username and password for installed Windows services
# Copyright: (c) 2019, Jordan Borean (@jborean93) <[email protected]>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Get-ServiceCredential {
<#
.SYNOPSIS
Retrieve the username and plaintext password for all services installed on the local computer.
.DESCRIPTION
Will retrieve the username and plaintext password for the service(s) specified. This must be run as an
@kacole2
kacole2 / harbor.sh
Last active January 15, 2025 09:55
Quick Start Harbor Installation Script on Ubuntu 18.04
#!/bin/bash
#Harbor on Ubuntu 18.04
#Prompt for the user to ask if the install should use the IP Address or Fully Qualified Domain Name of the Harbor Server
PS3='Would you like to install Harbor based on IP or FQDN? '
select option in IP FQDN
do
case $option in
IP)
@haproxytechblog
haproxytechblog / haproxy-config-2-0.cfg
Created June 13, 2019 20:41
HAProxy 2.0 configuration
#
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
#
# Have questions? Check out our community Slack:
# https://slack.haproxy.org/
#
@reillysiemens
reillysiemens / signing-vbox-kernel-modules.md
Last active April 22, 2025 22:18
Signing VirtualBox Kernel Modules

Signing VirtualBox Kernel Modules

These are the steps I followed enable VirtualBox on my laptop without disabling UEFI Secure Boot. They're nearly identical to the process described on [Øyvind Stegard's blog][blog], save for a few key details. The images here are borrowed from the [Systemtap UEFI Secure Boot Wiki][systemtap].

  1. Install the VirtualBox package (this might be different for your platform).
    src='https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo'
@justenwalker
justenwalker / get_extended_tcp_table_windows.go
Last active June 20, 2021 16:14
Call Windows API for GetExtendedTcpTable and return a Byte Buffer containing the result.
package win32
import (
"syscall"
"unsafe"
)
var (
iphlpapiDLL = syscall.NewLazyDLL("iphlpapi.dll")
procGetExtendedTcpTable = iphlpapiDLL.NewProc("GetExtendedTcpTable")
@justenwalker
justenwalker / string_convert_windows.go
Last active July 31, 2020 02:49
Convert Go strings to C-compatible strings for Windows API Calls
package win32
import "unicode/utf16"
// StringToCharPtr converts a Go string into pointer to a null-terminated cstring.
// This assumes the go string is already ANSI encoded.
func StringToCharPtr(str string) *uint8 {
chars := append([]byte(str), 0) // null terminated
return &chars[0]
}
@justenwalker
justenwalker / call-windows.go
Last active October 8, 2021 22:58
Calling Windows API from Go
package win32
import "syscall"
import "unsafe"
var (
kernel32DLL = syscall.NewLazyDLL("kernel32.dll")
procCreateJobObjectA = kernel32DLL.NewProc("CreateJobObjectA")
)
table inet firewalld {
chain raw_PREROUTING {
type filter hook prerouting priority -290; policy accept;
icmpv6 type { nd-router-advert, nd-neighbor-solicit } accept
meta nfproto ipv6 fib saddr . iif oif missing drop
jump raw_PREROUTING_ZONES_SOURCE
jump raw_PREROUTING_ZONES
}
chain raw_PREROUTING_ZONES_SOURCE {
@brgnepal
brgnepal / powershell.go
Last active July 30, 2024 17:36
Playing PowerShell command via Golang
package main
import (
"bytes"
"fmt"
"os/exec"
"strings"
)
// PowerShell struct
@alexanderilyin
alexanderilyin / README.md
Created November 15, 2018 00:58
Auto-increment Minor Semantic Version using Docker Hub API v2

For example your latest image with semantic versioning looks like this:

${DOCKER_HUB_ORG}/${DOCKER_HUB_REPO}:v1.20.0

Example provided above will do the folowing:

  1. Generate token using your github username and password.
  2. Get list of all tags from repository.