Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / script.js
Created August 6, 2024 13:59
Tampermonkey script to suppress Amazon Q annoyances
// ==UserScript==
// @name Tame AmazonQ
// @namespace http://tampermonkey.net/
// @version 2024-08-06
// @description Tampermonkey script to suppress Amazon Q annoyances
// @author Anonymous
// @match https://docs.aws.amazon.com/*
// @grant none
// ==/UserScript==
@avoidik
avoidik / 1-termux-adb.md
Last active July 7, 2024 19:07 — 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
@avoidik
avoidik / README.md
Created June 14, 2024 09:35
Run Ubuntu ARM on Mac M1 or similar

How to run Ubuntu on Mac

We're going to run Ubuntu (ARM) on Mac M1 (ARM) using the native binary translation, thanks to up-to-date version of qemu which has native hardware support.

Prerequisites

Install qemu and required tools (coreutils - we need truncate/gtruncate, dd/gdd CLI tools, samba - to share files between host and guest VM, yq - to insert SSH public key into the cloud-init configuration).

$ brew install qemu coreutils samba yq
@avoidik
avoidik / README.md
Last active August 12, 2024 09:41
Run Windows 11 IoT ARM on Mac M1 or similar

How to run Windows on Mac

We're going to run Windows 11 IoT (ARM) on Mac M1 (ARM) using the native binary translation, thanks to up-to-date version of qemu which has native hardware support.

Prerequisites

Install qemu and required tools (coreutils - we need truncate/gtruncate, dd/gdd CLI tools, samba - to share files between host and guest VM).

$ brew install qemu coreutils samba
@avoidik
avoidik / README.md
Last active July 16, 2024 22:26
Building nfstrace on Amazon Linux 2023

How to compile nfstrace

Prerequisites

Make sure we're using Amazon Linux

$ cat /etc/amazon-linux-release
Amazon Linux release 2023.4.20240429 (Amazon Linux)
@avoidik
avoidik / README.md
Created May 5, 2024 21:29
Jira in Docker on bare AWS EC2 instance

Jira on AWS

Prerequisites

  • VPC with two public subnets
  • A bunch of security groups (WAN to ALB, ALB to EC2, EC2 to RDS, RDS to EC2, EC2 to WAN)
  • ALB and Target Group (Health check on / for 200,302)
  • Route53 Hosted Zone (Public) and A-record to ALB
  • ACM certificate (DNS validation)
  • RDS Instance with Subnet group
@avoidik
avoidik / README.md
Last active April 28, 2024 20:39
How to list supported RBAC verbs in Kubernetes?

It appears kubectl has first-class support via api-resources like:

$ kubectl api-resources -o wide
$ kubectl api-resources --api-group certificates.k8s.io -o wide
$ kubectl api-resources --namespaced -o wide

Alternatively, we can use curl to query Kubernetes API, but we have to expose the API endpoint first:

@avoidik
avoidik / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active April 13, 2024 13:58 — forked from 33eyes/commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally
  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  

Or

git config --global filter.strip-notebook-output.clean 'docker run --rm -i -v \"${pwd}:/home/jovyan\" jupyter/datascience-notebook jupyter nbconvert --clear-output --to=notebook --stdin --stdout --log-level=ERROR'
  1. Create a .gitattributes file inside the directory with the notebooks