Skip to content

Instantly share code, notes, and snippets.

View razielanarki's full-sized avatar
👼
עִיר / ἐγρήγοροι

Raziel Anarki razielanarki

👼
עִיר / ἐγρήγοροι
View GitHub Profile
@razielanarki
razielanarki / kms.md
Created November 18, 2024 16:45 — forked from mercuryrx/kms.md
KMS Keys/Product Keys for Windows/Windows Server

Here, you can find the Product Keys for activating Windows.

Warming: This won't work with Home editions. Please first update to Professional edition if you want to activate Windows.

How do I activate Windows?

  1. Search for "Command Prompt" in the search box
  2. Right Click on the Command Prompt entry
  3. Press "Run as Administrator", then press yes.
  4. Type these commands one by one:
@razielanarki
razielanarki / compose-config-colored.sh
Last active June 8, 2024 16:22
BASH: dead simple syntax highlighting for docker compose config yaml output
#!/usr/bin/env bash
#============================================================================
# dead simple syntax highlighting for docker compose config yaml output
#----------------------------------------------------------------------------
function ansi::sgr { echo -n $'\033'"[$(IFS=';'; echo "$*")m"; }
function ansi::str { while (( $# > 1 )); do ansi::sgr $1; echo -n "$2";shift 2; done; ansi::sgr; }
#----------------------------------------------------------------------------
@razielanarki
razielanarki / bpt.sh
Last active June 1, 2024 15:32
bpt : 'backports-enabled apt' - an tiny apt front by razielanarki
#!/usr/bin/env bash
#============================================================================
# bpt : 'backports-enabled apt' - a tiny apt front by razielanarki
#============================================================================
# auto adds "--target-release $(lsb_release -cs)-backports" where applicable
# (ex.: '--target-release oracular-backports')
#----------------------------------------------------------------------------
# install: move to ~/.local/bin/bpt (or anywhere in PATH)
#----------------------------------------------------------------------------
# usage:
@razielanarki
razielanarki / build-watchman-deb-on-ubuntu-24.xx-amd64.md
Last active May 27, 2024 03:01
build .deb of facebook/watchman on ubuntu 24.10 (amd64)

notes:

  • tested on ubuntu 24.10-dev (oricular), probably works on 24.04-LTS (noble) too
  • autogen.sh is modified to include the build steps from:
    • install-system-packages.sh (now requires user confirmation before installing anything)
    • watchman/build/pacakage/make-deb.sh
  • fixes and uses --no-facebook-internal (thus disables eden fs support)
    (the binary size is reduced from ~11 MB to ~3 MB)
  • uses --scratch-path=built/scratch as the build folder
    (so the build doesn't fail half-way if/when it runs out of free space under /run/user/$UID/tmp)
  • the output folder is moved to built/built
@razielanarki
razielanarki / pkgsuup.cmd
Created December 9, 2023 21:59
msys2: update keyring + update pkgs & autoclean + confirm & prune old/unneeded (place next to msys2_shell.cmd, run from cmd)
@echo off
setlocal EnableDelayedExpansion
:pacmgmt
set PKGS=%__CD__%\usr\bin\pacman
:nuukeys
for /f "delims=" %%r in ('%PKGS% -Qu msys2-keyring') do (
echo + fresskey
%PKGS% -Suuccy msys2-keyring
@razielanarki
razielanarki / scope.h
Created July 1, 2023 21:58
std::experimental scope guard support, implements fundamental-ts v3 (see N4948: 6.2.1-2)
//==========================================================================
// nonstd/scope.h: std::experimental scope guard support,
// implements fundamental-ts v3 (see N4948: 6.2.1-2)
//==========================================================================
// (C) 2023 Raziel Anarki
//--------------------------------------------------------------------------
#pragma once
#include <exception>
@razielanarki
razielanarki / function_ref.h
Created June 27, 2023 20:12
constexpr function_ref based on p0792r14 (sans the nontype parts)
#pragma once
#include <type_traits>
namespace nonstd
{
// ============================================================================
namespace detail
@razielanarki
razielanarki / hash.h
Last active June 23, 2023 03:37
C++23 hash combiner and helper concepts
#pragma once
// ============================================================================
// C++23 hash combiner + hash related concepts / generic specializations
// ----------------------------------------------------------------------------
// (c) Raziel Anarki <[email protected]> - MIT licensed
// ----------------------------------------------------------------------------
// the algo mangled from:
// https://newbedev.com/c-why-is-boost-hash-combine-the-best-way-to-combine-hash-values
// tldr<link> = its not
@razielanarki
razielanarki / util_guid.h
Created May 10, 2023 16:06
C++23 GUID parsing + literals
#pragma once
#include <concepts> // std::integral
#include <charconv> // std::from_chars, std::from_chars_result
#include <system_error> // std::errc, std::make_error_condition
#include <format> // std::format
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct _GUID
@razielanarki
razielanarki / dll_api.hpp
Last active March 7, 2025 23:30
RAD C++20 wrapper for win32 libloaderapi + some unfinished uxtheme hackery (dark mode/colorpalette/acrylic/etc)
#pragma once
// Modern C++ wrapper for libloaderapi, see theme_hacks.hpp for usage
// after https://github.com/bblanchon/dllhelper aka "How to GetProcAddress like a boss 😎"
// with added return type safety if the function ptr is null
// -> returns a default 'RetType()' value, ie false, null etc (line 31)
#include <libloaderapi.h>
namespace raz::hacks