Skip to content

Instantly share code, notes, and snippets.

# for string
awk '$3 ~ /snow/ { print }' dummy_file
# for numeric
cpwd_admin list | awk '{if ($4==1) {print $1}}'
# check if column contains a string and print it, will print just the columns containing the lines
mpstat -P ALL 1 1 | awk '$12 ~ /idle/ {print $12}'
# check if column contains a string and print it, if matched string, print all the values in this column
@mkol5222
mkol5222 / aro-create.sh
Last active February 10, 2025 10:07 — forked from sabbour/aro-create.sh
Create an Azure Red Hat OpenShift cluster
LOCATION=northeurope # the location of your cluster
RESOURCEGROUP=aro-rg # the name of the resource group where you want to create your cluster
CLUSTER=aro # the name of your cluster
az group create \
--name $RESOURCEGROUP \
--location $LOCATION
az network vnet create \
--resource-group $RESOURCEGROUP \
@mkol5222
mkol5222 / send_bytes_bluetoothctl_spp.md
Created January 22, 2025 14:59 — forked from zeheater/send_bytes_bluetoothctl_spp.md
Sending raw bytes to SPP Mobile Printer with bluetoothctl bluez

Send Raw Bytes to Bluetooth SPP with bluetoothctl

bluetoothctl gatt.list-attributes
bluetoothctl gatt.select-attributes <spp - attributes>
bluetoothctl gatt.write "0xhh 0xhh ..."

Using interactive cli

@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"]