Skip to content

Instantly share code, notes, and snippets.

@mkol5222
mkol5222 / BluetoothConstants.ts
Created January 4, 2025 16:01 — forked from ariccio/BluetoothConstants.ts
GATT services and characteristics
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue.
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800.
// This is a hack to make things easy.
['1800', "generic_access"],
['1801', "generic_attribute"],
['1802', "immediate_alert"],
['1803', "link_loss"],
@mkol5222
mkol5222 / show.sh
Created January 1, 2025 19:52 — forked from sarjsheff/show.sh
openwrt traffic accounting by ip
# get statistics in json from console
ubus call traff all
@mkol5222
mkol5222 / README.md
Created November 5, 2024 15:35 — forked from yorickdowne/README.md
Ubuntu Desktop 20.04 with mirrored ZFS boot drive

Ubuntu 24.04

From the comments: "These exact instructions are not working on Ubuntu 24.04. Ubuntu has changed the naming of ZFS partitions, partition 2 and 3 are switched around, and the boot/efi folder is now different."

I don't have my dual-disk test system any longer, and so can't adjust these steps myself.

Overview

Ubuntu Desktop 20.04 supports a single ZFS boot drive out of the box. I wanted a ZFS mirror, without going through an entirely manual setup of Ubuntu as described by OpenZFS in their instructions for Ubuntu 20.04 and instructions for Ubuntu 22.04

resource "azurerm_container_group" "aci_caddy" {
resource_group_name = "aci_caddy"
location = local.location
name = "aci_caddy"
os_type = "Linux"
dns_name_label = "aci-caddy"
ip_address_type = "public"
container {
name = "app"
@mkol5222
mkol5222 / docker-for-mac.md
Created September 2, 2024 16:16 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@mkol5222
mkol5222 / terminal.sh
Created September 2, 2024 06:06 — forked from webarchitect609/terminal.sh
Git: disable GPG signing for current repo only.
# Write local
git config --local commit.gpgsign false
# Read local (if never set, can be an empty value)
git config --local commit.gpgsign
@mkol5222
mkol5222 / azure-update-ddns.dockerfile
Created August 27, 2024 20:34 — forked from ramondeklein/azure-update-ddns.dockerfile
Update Azure DNS based on current external IP (dyndns)
FROM mcr.microsoft.com/azure-cli:latest
COPY azure-update-ddns.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/azure-update-ddns.sh
CMD ["/usr/local/bin/azure-update-ddns.sh"]
@mkol5222
mkol5222 / README.md
Created June 12, 2024 17:25 — forked from killerbees19/README.md
[certbot] Let's Encrypt: Dual RSA/ECDSA certificates without frequent key changes

Tested at

  • Debian Buster [2019-07-18]
  • Debian Bullseye [2022-04-28]

Installation

apt update
apt full-upgrade

apt install certbot nginx-full
@mkol5222
mkol5222 / get-aws-console-url.js
Created March 27, 2024 12:05 — forked from janaz/get-aws-console-url.js
Generate AWS console URL from the credentials stored in environment variables
/**
* This little program prints out the url to the AWS console
* generated from the local AWS credentials stored in environment variables:
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY
* AWS_SESSION_TOKEN
*
* Steps:
* 1. Create a JSON object
* session = JSON.stringify({
multipass launch -n testvm -mem --cpu 1 --disk 5G --memory 2G 22.04 --cloud-init ~/.config/cloud-init.yml -v
ip_addr=$(multipass info testvm | awk '/IPv4/ {print $NF}')
ssh "ubuntu@${ip_addr}"