dev-hacks

Collection of developer hacks and tricks by @ololobus

View the Project on GitHub

macOS

Disable discrete GPU dependency for selected app

Open info.plist inside .app package and add

<key>NSSupportsAutomaticGraphicsSwitching</key>
<string>YES</string>

Hardware temps/fan speed

https://github.com/Chris911/iStats

gem install iStats
istats

Using Apache Spark with ipython/jupyter

See guide.

Remove latest TimeMachine snapshots

sudo tmutil thinLocalSnapshots / 10000000000 4

More info: 1, 2

XXX: What do these 10000000000 4 mean?

Use gdb

To resolve this

Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5).

issue you have to sign gdb executable. Refer to this and this.

Core dumps

Your current user may have no permissions on writing to /cores directory. So even with ulimit -c unlimited core dumps will not be generated. Set 777 on it:

sudo chmod 777 /cores

VNC client

What a luck macOS has a built-in VNC client! Just type:

open vnc://8.8.8.8:5901

Or use ssh to setup a secure tunnel first:

ssh -L 5901:127.0.0.1:5901 -C -N -l username 8.8.8.8

and then

open vnc://localhost:5901