Skip to content

Instantly share code, notes, and snippets.

@inntran
inntran / itunes-windows.md
Created February 20, 2024 01:53
iTunes individual installers (Apple Software Update) for Windows
@inntran
inntran / centos7-eol-archived-repo.sh
Last active October 14, 2024 01:41
Patch CentOS 7 and EPEL 7 repos to use archives
#!/bin/bash
ACTIVE_REPO_DIR="/etc/yum.repos.d"
BACKUP_REPO_DIR="$ACTIVE_REPO_DIR/backup"
STATUS_FILE="/etc/yum.repos.d/CENTOS7_EOL_REPO_URL_PATCHED.txt"
CENTOS_VAULT_SERVER_BASE="https://mirrors.aliyun.com/centos-vault"
EPEL_RPM_URL="https://mirrors.aliyun.com/epel-archive/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm"
EPEL_REPO="epel.repo"
EPEL_VAULT_SERVER_BASE="https://mirrors.aliyun.com/epel-archive"
@inntran
inntran / json_flattener.py
Created December 2, 2025 15:51
To convert nested JSON data into two-dimensional CSV or XLSX file.
#!/usr/bin/env python3
"""
JSON Flattener Tool
Flattens JSON data by specified levels and exports to CSV or XLSX format.
Each record becomes one row with flattened column names.
Usage:
python3 json_flattener.py input.json --output output.csv --levels 2
python3 json_flattener.py input.json --output output.xlsx --levels 3 --format xlsx