Category Archives: Computers

Mac OS X and Windows

MacBook Pro 2011 17″ Disable Broken Radeon Graphics Card and Force use Integrated Graphics

If you own one of the last generation of 17″ MacBook Pros from 2011, and if you have worked with a large external monitor, you may reach the point of frying the Radeon graphics card.

Since the model also has built-in Intel graphics, the question arises, can I not carry on working with that?

Yes you can.

This script helps you to disable the card at boot, and force use of the Intel integrated graphics. And, to re-run that process after an O/S update has undone the changes. The loss is that you can no longer plug an external monitor in. The gain is that your MacBook 17″ now works again, and runs slightly cooler/at lower power to boot.

Several steps are involved. I wrote a script to reduce the steps to:

1. Boot to recovery mode and run the script
2. Boot to single user mode and run the script
3. Optionally boot to recover mode again to re-able SIP.

Recall that to run the script you must make it executable: chmod a+x

But how do I use this if I’ve already broken the graphics card?

* You should still be able to use the Cmd-S, or Cmd-RS keypresses at boot to get to a command line. If you can get from there to a pendrive or a network drive, then you can copy the script.

#! /bin/sh


echo "---------------------------------------------------------------
Run this script twice.
First, from a Recovery Mode commandline to run csrutil disable.
Second, after rebooting to a Single user mode commandline, with / partition mounted writeable, to do all the things that must be done with csrutil status= disabled

After that, rerun Recovery mode to run \`csrutil enable\` again.

* How to start in Recovery mode? Cmd-R

* How to start in Single user mode? Cmd-S


echo "
nb: csrutil disable only works in recovery mode
csrutil disable
echo "
csrutil status

echo "
Moving the AMDRadeonX3000.kext out of extensions and updating the extensions cache
mount -uw /
mkdir -p $kextoffdir
mv /System/Library/Extensions/AMDRadeonX3000.kext/ $kextoffdir/
touch /System/Library/Extensions/

echo "
Set nvram magic things. This is the step that disables the Radeon as the bootup graphics card
nvram 'fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00'
nvram boot-args="-v"
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs
nvram -p

echo "
Add a loginHook to load AMDRadeonX3000.kext after boot
mkdir -p /Library/LoginHook

cat > /Library/LoginHook/ <

Kudos and References


Windows Delayed Startup Script

Put this in the Target of a cmd.exe shortcut and optionally set Run to Minimized:

cmd.exe /c “dir ..\StartupDelayedStart\* && Timeout /T 10 && echo ‘waiting…’ && Timeout /T 30 && for %f in ( ..\StartupDelayedStart\* ) do start “” “%f” “

Add Merge Fields to a Word Document before adding a DataSource

Adding merge fields to a Word document without adding a datasource to it – and anyone working with multiple datasources, or programmatic mailmerge setup wants to do this sometime – is not at all obvious when the mail merge button is greyed out..

You can do it, unobviously via Insert->QuickParts->Field:

Choose MergeField from the list on the left, and then you can type in your merge field name.

Your CPU vs your code. Two short lessons in software performance

There’s a great Q and Answer at dijkstra-path-finding-in-c-is-15x-slower-than-c-version which starts with C++ code at 2ms vs C# at 38ms; and finishes with C# at 2.8ms.

On similar lines, the solution to this riddle — why-does-net-core-2-0-perform-worse-than-net-framework-4-6-1 — has nothing to do with the framework; it results from the slower performance of 64bit code compared to 32bit.

Which just goes to confirm what you might have suspected;

VMs aren’t that slow; and
For best performance, you have to understand your VM, and your language, and your O/S, and ultimately your CPU.