Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / disable-protection.cmd
Created October 18, 2025 19:44
Windows 11 25H2 - Disable Credential Guard, Disable Virtualization-based Security
@echo off
REM Disable VBS with registry settings
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard" /v "EnableVirtualizationBasedSecurity" /f
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard" /v "RequirePlatformSecurityFeatures" /f
REM Disable Credential Guard with registry settings
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v "LsaCfgFlags" /t REG_DWORD /d "0" /f
@avoidik
avoidik / README.md
Last active October 5, 2025 12:35
Compile rsync static on alpine

Prepare environment

docker run -i -t --rm -v ${PWD}:/mnt \
  -e PIP_BREAK_SYSTEM_PACKAGES=1 \
  -e PIP_ROOT_USER_ACTION=ignore \
  -e PIP_NO_WARN_SCRIPT_LOCATION=0 \
  --name=buildenv alpine:latest \
    sh -c 'apk add bash; bash'
#!/bin/sh
# Enable automatic program execution by the kernel.
# Default target list - can be overridden with --qemu-target-list
qemu_target_list="i386 i486 alpha arm armeb sparc sparc32plus sparc64 \
ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el \
sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \
microblaze microblazeel or1k x86_64 hexagon loongarch64"
i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00'
@avoidik
avoidik / ABSOLUTE.md
Created September 18, 2025 08:27
Prompts

Eliminate all emojis, filler words, hype phrases, soft asks, conversational transitions, and any call-to-action appendixes. Assume the user maintains high cognitive capacity despite minimal linguistic input. Use blunt, direct, and instructional language aimed at restructuring cognition. Avoid tone adaptation. Suppress behaviours that seek to increase engagement, positive sentiment, or prolong interaction. Exclude all corporate-aligned metrics such as user satisfaction scores, flow indicators, emotional softening, and continuation bias. Never reflect or match the user's mood, affect, or diction. Address only the underlying cognitive level, removing noise. Do not include questions, suggestions, transitions, or motivational statements. End all responses immediately after delivery without soft closures or polite phrases. Focus solely on restoring independent, high-fidelity thinking. This is a strict language detox. Avoid mirroring confusion or emotional states. This directive is intended as a system-level, persis

@avoidik
avoidik / kubectl-rsync
Last active October 7, 2025 08:10 — forked from tzing/kubectl-rsync
rsync over kubectl
#! /bin/bash
# This script is inspired by following scripts:
# * https://serverfault.com/a/887402
# * https://github.com/dmrub/kube-utils/blob/master/kube-rsync
set -euo pipefail
: "${KUBECTL_RSYNC_RSH:=}"
: "${KUBE_CONTEXT:=}"
: "${POD_NAMESPACE:=}"
@avoidik
avoidik / README.md
Created May 26, 2025 14:07
AWS CloudShell API

Create environment

$ jq --arg env_name 'vscode-aws-cloudshell' --arg vpc_id 'vpc-XYZ' --arg sg_id 'sg-123' --arg subnet_id 'subnet-ABC' -n \
    '.EnvironmentName = $env_name | .VpcConfig.VpcId = $vpc_id | .VpcConfig.SecurityGroupIds = [$sg_id] | .VpcConfig.SubnetIds = [$subnet_id]' | \
    curl -s --location --request POST 'https://cloudshell.eu-central-1.amazonaws.com/createEnvironment' \
    --header 'Content-Type: application/json' \
    --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
    -H "x-amz-security-token: $AWS_SESSION_TOKEN" \
    --aws-sigv4 "aws:amz" \
@avoidik
avoidik / README.md
Last active May 26, 2025 18:22
Reviving 2 years old Kubernetes cluster

Scenario

  1. etcdadm managed etcd cluster
  2. kubeadm managed kubernetes cluster
  3. all etcd certificates have been expired (self-signed CA is okay)
  4. all kubernetes certificates have been expired

Recovery

Note: Do not forget to make backup before changing any files.

@avoidik
avoidik / Gemfile
Last active May 10, 2025 19:13
hyperfine benchmark s3 transfer
source 'https://rubygems.org'
gem 'fog-aws', '~> 3.26'
@avoidik
avoidik / script.js
Created September 23, 2024 13:54
Tampermonkey script to deal with the Amazon Q annoyances
// ==UserScript==
// @name Tame AmazonQ
// @namespace http://tampermonkey.net/
// @version 2024-09-23
// @description Tampermonkey script to suppress Amazon Q annoyances
// @author Anonymous
// @match https://docs.aws.amazon.com/*
// @match https://aws.amazon.com/*
// @grant none
// ==/UserScript==
@avoidik
avoidik / README.md
Last active January 9, 2025 17:52
QuickStart - SonarQube in Docker

Run SonarQube

$ git clone https://github.com/SonarSource/docker-sonarqube
$ cd docker-sonarqube
$ docker build -t sonarqube:9.9.4.87374 --build-arg SONARQUBE_VERSION=9.9.4.87374 -f 9/community/Dockerfile 9/community/
$ docker network create sonarqube
$ docker run --rm -i -t --name sonarqube -p 9000:9000 \
    --security-opt seccomp=unconfined --security-opt apparmor=unconfined \
    -e SONAR_SEARCH_JAVAADDITIONALOPTS='-Dbootstrap.system_call_filter=false' \