Skip to content

Instantly share code, notes, and snippets.

View apoorvalal's full-sized avatar

Apoorva Lal apoorvalal

View GitHub Profile
@treddy73
treddy73 / monitor_cpu.txt
Last active July 5, 2025 22:13
Monitor CPU function
# This function will periodically print cpu information about the given process name
# Place it in your .zshrc or equivalent file or modify it to run via #!/bin/zsh
#
# Usage: monitor_cpu mediaanalysisd 28800 5 > ~/Desktop/cpu_log.txt
# Monitors processes containing "mediaanalysisd" for 12 hours reporting every 5 seconds
#
# Run this to output statistics:
# cat ~/Desktop/cpu_log.txt | grep "mediaanalysisd " | grep -v "0.0" | awk '{sum += $NF; count++} END {if (count > 0) {print sum / count; print count;} else print "No data"}'
function monitor_cpu() {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 3, 2025 16:10
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname