Skip to content

Instantly share code, notes, and snippets.

@clarencesong
clarencesong / os-x-enable-trim.md
Last active September 28, 2023 17:03
Enable TRIM in OS X 10.7.5 to 10.9.5

Enable TRIM on non-Apple SSDs in OS X

NOTE: This is tested on the versions mentioned in the title, and NOT earlier or later versions. YMMV.

Run the following commands in Terminal…

Backup the original driver:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup
@ufux
ufux / lcdui.py
Created July 27, 2013 14:08
Created a working driver to drive a LCD 20x4 display based on HD44780U (http://www.exp-tech.de/Displays/I2C-LCD-1602-Module-652.html) via PCF8574 i2c bus expander driven from a raspberrypi.
import smbus
import getopt
import sys
from time import *
from time import gmtime, strftime
# TODO: Factor out all device_write calls to some PCF8574 specific module ...
# will be different with another io expander
# communication from expander to display: high nibble first, then low nibble