Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
👋

Adam Kaminski thimslugga

👋
View GitHub Profile
@thimslugga
thimslugga / build_app.sh
Created May 8, 2025 16:06 — forked from bistole/build_app.sh
archive, notarize and stapler
#!/bin/sh
CODE_BASE=/path/to/Storyboard
SCRIPT_PATH=$(dirname "$0")
DEPLOY_ROOT_PATH="${SCRIPT_PATH}/.."
LOG_PATH="${DEPLOY_ROOT_PATH}/logs"
BUILD_PATH="${DEPLOY_ROOT_PATH}/build/macos"
VERSION=
STATUS=
REQUEST_UUID=
@thimslugga
thimslugga / README.md
Created May 8, 2025 16:05 — forked from riaf/README.md
Script to manually apply your shell PATH to macOS GUI apps. Fixes issues finding Homebrew/custom tools via launchd & launchctl setenv.

Sync Your Shell PATH to macOS GUI Apps Manually with This Script

The Problem

Are you struggling with macOS GUI applications (like IDEs, text editors, or other tools launched from Finder or Spotlight) not finding command-line tools installed via Homebrew (/opt/homebrew/bin), MacPorts, or in custom directories like ~/bin or /usr/local/bin? This happens because GUI applications on macOS do not automatically inherit the PATH environment variable set by your login shell configuration files (like .zshenv, .zprofile, .bash_profile, or .bashrc). Your carefully configured shell PATH works in the Terminal, but GUI apps remain unaware of it.

The Solution

This Bash script provides a simple, manual way to apply the PATH from your current Terminal session to the macOS GUI environment. Instead of complex automatic synchronization, you run this script whenever you want to update the PATH that GUI applications will use.

macOS interesting tools

many are discovered by scouring the manpages apropos -s 1/8/? .

  • nettop
  • nscurl
  • (arp)
  • textutil
  • wish, tcl/tk etc.
  • last
@thimslugga
thimslugga / 01-mac-profiling.md
Created May 8, 2025 15:08 — forked from loderunner/01-mac-profiling.md
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

A curated list of shell commands and tools specific to OS X.

“You don’t have to know everything. You simply need to know where to find it when necessary.” (John Brunner)

Awesome Gitter

For more terminal shell goodness, please also see this list's sister list Awesome Command Line Apps.

@thimslugga
thimslugga / cmd.origin.sh
Created May 8, 2025 15:08 — forked from 166MMX/cmd.origin.sh
macOS Sierra /usr/bin/ Origin
#!/usr/bin/env bash
main() {
header
find "$1" \( -type f -o -type l \) -print0 | while IFS= read -r -d ''; do
second "$REPLY"
done
}
second() {
@thimslugga
thimslugga / justfile
Last active May 8, 2025 13:07 — forked from raspberrypisig/justfile
A justfile template
#!/usr/bin/env just --justfile
# -*- mode: justfile -*-
# https://just.systems/man/en/introduction.html
# ==============================================================================
# Settings
# ==============================================================================
# Enable unstable features
@thimslugga
thimslugga / sec_context.py
Created March 27, 2025 06:11 — forked from pudquick/sec_context.py
Check Security context flags
from ctypes import CDLL, byref, c_uint32
Security = CDLL('/System/Library/Frameworks/Security.framework/Versions/Current/Security')
kcallerSecuritySession = c_uint32(-1)
my_session = c_uint32(0)
session_bits = c_uint32(0)
result = Security.SessionGetInfo(kcallerSecuritySession, byref(my_session), byref(session_bits))
flags = session_bits.value
#!/bin/bash
VER="0.94.2";
SCRIPTTITLE="PV - HVM - version $VER";
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
# Configure logging
tmp="/tmp"
logfile="$tmp/$(basename $0).$$.log"
AWSTemplateFormatVersion: '2010-09-09'
Description: Extreme Performance Tuning Benchmark Environment
Parameters:
AmiId:
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'