Skip to content

Instantly share code, notes, and snippets.

@mcharo
mcharo / pingled.ps1
Last active February 7, 2023 21:25
Ping output to macOS CapsLock LED
#!/usr/bin/env pwsh
[CmdletBinding()]
param(
$IpAddress,
$Count = 4
)
@'
var capsState;
@mcharo
mcharo / opencv-install.sh
Last active November 9, 2019 05:20
Installing OpenCV 4.1.2 on macOS Mojave
#!/bin/bash
# references:
# - https://medium.com/@nuwanprabhath/installing-opencv-in-macos-high-sierra-for-python-3-89c79f0a246a
# - https://www.learnopencv.com/install-opencv3-on-macos/
# - https://bob.ippoli.to/archives/2005/02/06/using-pth-files-for-python-development/
# this is probably /usr/local for you
BREW_ROOT="/usr/local/homebrew"
@mcharo
mcharo / syn_diddle.py
Last active November 10, 2019 04:15
Synology API diddling
#!/usr/bin/env python3
# references:
# - https://github.com/N4S4/synology-api
import requests
import argparse
import json
from getpass import getpass
@mcharo
mcharo / non-admin-install.sh
Created November 13, 2019 03:00
Install Microsoft Teams pkg (and maybe others) on macOS without admin
#!/bin/bash
# setup
pkgpath=$1
pkgout=/tmp/$(/usr/bin/openssl rand -hex 10)
payout=/tmp/$(/usr/bin/openssl rand -hex 10)
if [ -d "$pkgout" ]; then
echo $pkgout already exists
exit 1
fi
@mcharo
mcharo / install-pwsh.sh
Last active November 13, 2019 16:51
Install pwsh on macOS without admin
#!/bin/bash
set -e
version=$1
if [[ -z "$version" ]]; then
cat << EOF
Usage:
$0 <version>