Skip to content

Instantly share code, notes, and snippets.

View msimperi's full-sized avatar

Matti Simperi msimperi

  • Vantaa, Finland
  • 21:56 (UTC +02:00)
View GitHub Profile
@msimperi
msimperi / MAC-OS-SLEEP-BATTERY-DRAINING-TEMP-FIX.md
Last active January 10, 2026 18:02
macOS Sleep Battery Draining Temporary Fix (Turn Wifi + Bluetooth off when sleeping)

macOS Sleep Battery Draining Temporary Fix

This guide provides a workaround for macOS battery drain issues during sleep by automatically disabling Bluetooth and WiFi when the system sleeps and re-enabling them on wake.

Problem

macOS currently has issues with battery draining during sleep when Bluetooth and WiFi remain active.

Solution Overview

Use sleepwatcher to run scripts that:

  • Disable Bluetooth and WiFi when the system goes to sleep
@msimperi
msimperi / ebs-snapshot.sh
Last active March 26, 2018 11:28
AWS EC2 Single Volume Automatic Snapshot Bash
#!/bin/bash
#####################
# Original https://github.com/CaseyLabs/aws-ec2-ebs-automatic-snapshot-bash
#
# Changes:
# - take volume_list as 1st parameter ($1)
# - take retention_days 2nd parameter ($2)
# - add volume tag Name to snapshot name also
#