Skip to content

Instantly share code, notes, and snippets.

@stratomancer
stratomancer / MacBookPro-force-Intel-GPU.md
Last active March 2, 2026 11:04
Linux Mint on MacBookPro 11.5: force Intel iGPU + power off Radeon dGPU (repro guide)

Linux Mint on MacBookPro 11,5: force Intel iGPU + power off Radeon dGPU (repro guide)

This is a guide for improving the power consumption on Linux Mint 22.2 by disabling the Radeon GPU and enabling the Intel GPU on a 2015 MacBook Pro 11,5 (Intel Haswell iGPU + AMD Radeon dGPU + Apple GMUX). It is based on the work of Bruno Bierbaumer https://github.com/0xbb/apple_set_os.efi and credits belong to Andreas Heider who originally discovered this hack: https://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html

I simply adapted it to work on Linux Mint 22.2.

Goal:

  • Boot in a way that exposes/keeps the Intel iGPU usable (some Mac firmware disables or hides it for non-macOS boots).
  • Ensure the internal panel (eDP) is driven by i915.
@stratomancer
stratomancer / gcode
Created November 1, 2025 21:48
Cura - Ender-3 v2 with BLTouch and FYSETC direct drive mod
;
; ========== Cura Start ==========
;
; ---------- Standards and safety ----------
G21 ; Units in mm
G90 ; Absolute positioning
M82 ; Absolute extrusion mode, matches Cura default
M107 ; Fan off
G92 E0 ; Reset extruder
#!/bin/bash
#
# Put me in cron.daily, cron.hourly or cron.d for your own custom schedule
# Running daily? You'll keep 3 daily backups
# Running hourly? You'll keep 3 hourly backups
NUM_BACKUPS_TO_KEEP=3
# Who wants to know when the backup failed, or
# when the binary logs didn't get applied
@stratomancer
stratomancer / gist:a3e9773de138c2dbfa68
Created December 13, 2014 03:01
SSH config for LXC containers
Host *.lxc
User ubuntu
IdentityFile ~/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
ProxyCommand nc $(grep $(echo %h | sed "s/\.lxc//g") /var/lib/misc/dnsmasq.lxcbr0.leases | awk '{ print $3 }') %p
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
@stratomancer
stratomancer / url_sha1sum.py
Created October 21, 2014 02:11
A sha1sum check for file URL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" File download check """
__author__ = "Clayton Kramer"
__copyright__ = "Copyright 2014"
__credits__ = ["Clayton Kramer"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Rob Knight"
@stratomancer
stratomancer / gcharts_area_between_lines.js
Created October 13, 2014 13:44
Google Charts - Area between two lines
// Sourced from http://jsfiddle.net/asgallant/ydNT2/
google.load('visualization', '1', {packages: ['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['X', 'Y1', 'Y2'],
[0, 6, 12],
[1, 4, 9],
@stratomancer
stratomancer / apache_status.py
Last active April 19, 2017 18:57
Simple script for monitoring Apache2 mod_status pages. Designed for Zabbix usage.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Quick way to monitor Apache mod_status. Designed for use with Zabbix.
"""
import sys
import urllib2
import argparse
import string
from random import SystemRandom
from django.db import connections
key_chars = string.ascii_letters
random = SystemRandom()
class adhoc_db(object):
"""Context manager that temporarily adds a database connection.
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors: