Skip to content

Instantly share code, notes, and snippets.

@zachselby
zachselby / macos-app-keepalive.md
Last active October 21, 2021 19:16
Keep Unstable Apps Running on Mac OS with a LaunchAgent and a Configured Interval

Keep Unstable Apps Running on Mac OS with a LaunchAgent and a Configured Interval

Overview

After facing issues with Big Sur on an M1 Mac, the following approach was implemented via launchctl and osascript to ensure an app is restarted if found to not be running.

This particular app was running stable on Catalina, and this approach is a temporary workaround until the root cause can be addressed. YMMV.

@zachselby
zachselby / Chromecast batch conversion script
Created May 27, 2021 22:56 — forked from steventrux/Chromecast batch conversion script
A bash script to batch convert video files for chromecast compatibility
#! /bin/bash
# Batch Convert Script by StevenTrux
# The Purpose of this Script is to batch convert any video file to mp4 or mkv format for chromecast compatibility
# this script only convert necessary tracks if the video is already
# in H.264 format it won't convert it saving your time!
# Put all video files need to be converted in a folder!
# the name of files must not have " " Space!
# Rename the File if contain space
@zachselby
zachselby / ffmpeg-helpers.sh
Last active September 9, 2022 05:25
ffmpeg Helper Script (Fade In or Out, Clip Trimming, Frame Rate Adjustments, Playback Rate)
#!/bin/bash
# Adjust Frame Rate
#
# Input File | Video Filter | Output File
ffmpeg -i "video-001.mov" -vf "fps=12" "video-001.mp4"
# ^ Lower framerate for smaller file
@zachselby
zachselby / unprotect-xlsx.sh
Created August 21, 2020 17:41
Bash Script to Unprotect Sheets in Excel Workbook
#!/bin/bash
#################
# Usage: #
#################
# Create an unprotected copy of XLSX file with suffix "-unprotected.xlsx".
# The following command produces `my-workbook-unprotected.xlsx`
# $ ./unprotect-xlsx.sh my-workbook.xlsx
# This is accomplished by removing from all workbook sheets the `sheetProtection` and `protectedRanges` XML elements.
@zachselby
zachselby / md-clean-table.py
Last active March 26, 2020 17:36
Bash Script: Format Markdown Tables from Input Using Python
#!/usr/bin/python
# Source copied from: https://leancrew.com/all-this/2014/06/cleaning-up-my-markdown-table-cleanup-script/
# Usage - stdin from file:
# $ cat sample.md
#| Column 1 | Column 2 | Column 3 |
#|--|:--:|--:|
#| first | second | third |
#| column | column | column |
@zachselby
zachselby / brew-multiuser.sh
Created June 20, 2019 12:53
Use Homebrew for Multiple Users
#!/bin/bash
# Create a new group, brew
sudo dseditgroup -o create brew
# Change owner to brew group on brew assets
sudo chgrp -R brew $(brew --prefix)/*
# Change permissions to brew group
sudo chmod -R g+w $(brew --prefix)/*
@zachselby
zachselby / keybase.md
Created August 4, 2016 14:33
keybase verification

Keybase proof

I hereby claim:

  • I am zachselby on github.
  • I am rambler (https://keybase.io/rambler) on keybase.
  • I have a public key whose fingerprint is E04C 15AD 5DE5 FC20 0F84 CEC6 BB88 9D84 2E6D 9055

To claim this, I am signing this object: