Skip to content

Instantly share code, notes, and snippets.

View vi7's full-sized avatar
πŸ’­
smd

Vitaliy D. vi7

πŸ’­
smd
  • Krakow, Poland
View GitHub Profile
@vi7
vi7 / macbook_firmware_password_reset.md
Last active October 14, 2026 07:35
Macbook Pro firmware password reset script. Tested ONLY on firmware dumped from MX25L6406E chip on Macbook Pro 15 early 2011

Macbook Pro firmware password reset

IMPORTANT Tested on:

  • firmware dumped from MX25L6406E chip on Macbook Pro 15 early 2011

Info

Flash BIOS Chip

@vi7
vi7 / windows-dns-client.py
Created June 1, 2026 09:21
Minimal Windows DNS client for the DNS management.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["pywinrm>=0.5"]
# ///
"""Minimal Windows DNS client for the DNS management.
!!! NO SAFETY BOUNDARIES !!! β€” this script does not enforce zone whitelists,
PROD refusal, or ExternalDNS detection. It will execute any operation it is asked
to execute, provided the credentials have permission on the server.
@vi7
vi7 / bt_reset.sh
Created March 22, 2026 15:23
Fix JBL speaker not detected as audio device on Intel MacBook. Prerequisite: brew install blueutil
#!/bin/bash
set -e
echo "=== Bluetooth & Audio Reset Script ==="
# 1. Turn Bluetooth off
echo "[1] Turning Bluetooth OFF..."
blueutil --power 0 2>/dev/null || true
@vi7
vi7 / fix-macos-hostname.sh
Created March 5, 2026 10:11
Script to fix macOS hostname
#!/bin/bash
# Script to fix macOS hostname
# Usage: ./fix-hostname.sh <desired-hostname>
if [ -z "$1" ]; then
echo "Usage: $0 <hostname>"
echo "Example: $0 MyMacBook"
exit 1
fi
@vi7
vi7 / check_ssl_cert_bundle.sh
Last active February 12, 2026 09:35
Simple bash script for openssl command to get info on all certificates in the provided certificate bundle text file
#!/usr/bin/env bash
bundle_file="${1:-bundle.crt}"
awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/' "$bundle_file" | \
while openssl x509 -noout -subject -dates -issuer 2>/dev/null; do
echo "---"
done
@vi7
vi7 / claude_settings.json
Created January 28, 2026 15:56
MCP tools permission settings for the Claude Code
{
"attribution": {
"commit": "πŸ€– Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>",
"pr": "πŸ€– Generated with [Claude Code](https://claude.com/claude-code)"
},
"permissions": {
"allow": [
"mcp__kubernetes__configuration_contexts_list",
"mcp__kubernetes__configuration_view",
"mcp__kubernetes__targets_list",
@vi7
vi7 / ssh_config_to_ansible_inventory.py
Created May 26, 2025 09:50
Convert hosts found in a standard ssh config into Ansible YAML inventory
#!/usr/bin/env python3
"""
Convert SSH config file to Ansible YAML inventory
No external dependencies required - uses only standard library
"""
import os
import sys
import yaml
import re
@vi7
vi7 / playlist_gen.sh
Created January 23, 2025 16:13
M3U playlist generator bash script
#!/bin/bash
playlist="playlist.m3u"
echo "#EXTM3U" > "$playlist"
find . -type f -iname "*.mp3" | while read -r file; do
echo "$file" >> "$playlist"
done
@vi7
vi7 / get_ip_address.sh
Created April 4, 2024 16:47
Oneliner to get IP address of the interface in Linux. Uses ip and jq commands
#!/usr/bin/env bash
INTERFACE_NAME=eth0
ip -family inet -json addr show $INTERFACE_NAME | jq --raw-output .[0].addr_info[0].local
@vi7
vi7 / k8s_nfs_pvc_pv_sc.yaml
Created February 23, 2024 17:10
Kubernetes NFS PVC PV SC example
---
apiVersion: v1
kind: PersistentVolume
metadata:
labels:
app.kubernetes.io/instance: storage
app.kubernetes.io/name: storage
name: my-awesome-nfs
spec:
accessModes: