Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / kubectl-rsync
Created August 19, 2025 08:04 — 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 -eo pipefail
if [[ -z "$KUBECTL_RSYNC_RSH" ]]; then
[[ -n "$KUBE_CONTEXT" ]] && echo >&2 "* Found \$KUBE_CONTEXT = $KUBE_CONTEXT"
[[ -n "$POD_NAMESPACE" ]] && echo >&2 "* Found \$POD_NAMESPACE = $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' \
@avoidik
avoidik / policies.json
Last active August 12, 2025 11:59
Firefox policies
{
"policies": {
"DisableTelemetry": true,
"DisableFirefoxStudies": true,
"ManualAppUpdateOnly": true,
"AutofillAddressEnabled": false,
"AutofillCreditCardEnabled": false,
"DisableFormHistory": true,
"NetworkPrediction": false,
"OfferToSaveLogins": false,
@avoidik
avoidik / 1-termux-adb.md
Last active January 21, 2025 21:55 — forked from kairusds/1-termux-adb.md
Instructions for connecting Termux's android-tools adb to the current device via Wireless debugging and fixing phantom process killing

Install android-tools if you haven't already:

$ pkg update ; pkg upgrade
$ pkg install android-tools

Pair with remote or local ADB

@avoidik
avoidik / README.md
Last active July 21, 2024 12:23
XFCE4 on Termux

XFCE4 on Termux

In this short guide I will explain how to run Ubuntu with Xfce4 desktop environment on your Android smartphone by using Termux-X11 in an isolated environment without root privileges. With minor adjustments this guide should work for Debian too (just replace ubuntu by debian).

Note: Neither of options won't support systemd. Moreover, Firefox on Ubuntu is distributed as a snap package, which in turn does not work without systemd.

Host system

I am a user of an arm64 based Android smartphone. First of all let's install Termux application from Play Market.

@avoidik
avoidik / openssl.cnf.diff
Created June 29, 2024 15:06 — forked from rdh27785/openssl.cnf.diff
diff -uN /etc/ssl/openssl.cnf\~original /etc/ssl/openssl.cnf for Nextcloud with OpenSSL 3
--- /etc/ssl/openssl.cnf~original 2022-03-16 08:35:51.000000000 +0000
+++ /etc/ssl/openssl.cnf 2022-05-04 02:37:30.336530711 +0000
@@ -56,6 +56,7 @@
# List of providers to load
[provider_sect]
default = default_sect
+legacy = legacy_sect
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect