Skip to content

Instantly share code, notes, and snippets.

View Bak-Jin-Hyeong's full-sized avatar

Bak, Jin Hyeong Bak-Jin-Hyeong

View GitHub Profile
@Bak-Jin-Hyeong
Bak-Jin-Hyeong / Hide-Server-Manager-At-Logon.ps1
Created March 5, 2019 07:47
How To Hide Server Manager At Logon
#
# How To Hide Server Manager At Logon
# https://blogs.technet.microsoft.com/rmilne/2014/05/30/how-to-hide-server-manager-at-logon/
#
Get-Item HKCU:\Software\Microsoft\ServerManager
Get-ItemProperty -Path HKCU:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon | select DoNot OpenServerManagerAtLogon | Ft –AutoSize
New-ItemProperty -Path HKCU:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon -PropertyType DWORD -Value "0x1" –Force
// https://stackoverflow.com/questions/4239993/determining-endianness-at-compile-time
#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
defined(__BIG_ENDIAN__) || \
defined(__ARMEB__) || \
defined(__THUMBEB__) || \
defined(__AARCH64EB__) || \
defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)
// It's a big-endian target architecture
#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
import datetime
import itertools
import json
import boto3
REGION = 'us-east-1'
CLUSTER = 'what-the-fuck'
ECS_CLIENT = boto3.client('ecs', REGION)
package main
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/awserr"
"github.com/pkg/errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"runtime"
)
@Bak-Jin-Hyeong
Bak-Jin-Hyeong / get_first_mac_address_windows.cpp
Created May 18, 2019 12:51
Find first mac address (windows)
#include "get_first_mac_address_windows.h"
#include <vector>
#include <WinSock2.h>
#include <ws2ipdef.h>
#include <WS2tcpip.h>
#include <iphlpapi.h>
#include "CoarseClock.h"
#if defined(_WIN32) || defined(_WIN64)
#if defined(_M_IX86) || defined(_M_AMD64)
#include <Windows.h>
#ifndef SPLITMIX64__H__
#define SPLITMIX64__H__
#include <cstdint>
constexpr uint64_t splitmix64_stateless(uint64_t previous_state) noexcept
{
uint64_t z = previous_state + 0x9E3779B97F4A7C15ull;
z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ull;
z = (z ^ (z >> 27)) * 0x94D049BB133111EBull;
@Bak-Jin-Hyeong
Bak-Jin-Hyeong / LiteralStringViewHolder.h
Last active September 26, 2019 03:36
Restrict creation of string_view to string literals only
#ifndef LITERALSTRINGVIEW__H__
#define LITERALSTRINGVIEW__H__
#include <cassert>
#include <string_view>
class LiteralStringViewHolder;
$invocation = (Get-Variable MyInvocation).Value
$invocationDir = Split-Path $invocation.MyCommand.Path
Get-ChildItem $invocationDir | ForEach-Object {
$p = (Join-Path -Path $_.FullName -ChildPath '.git')
if (Test-Path -Path $p) {
Write-Host "git --git-dir="${p}" fetch --prune --all"
git --git-dir="${p}" fetch --prune --all
}
}
@Bak-Jin-Hyeong
Bak-Jin-Hyeong / Verify--DigitalSign.ᅟps1
Created November 26, 2019 23:59
Verify digital signatures of executables or DLLs
function Get-RegistryValue
{
param
(
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Path,
[parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] $Value
)
if (Test-Path $Path)
{