Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 23, 2026 01:20
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@bzerangue
bzerangue / json-to-ndjson.md
Last active April 15, 2026 11:39
JSON to NDJSON

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@bzerangue
bzerangue / mac-trim-support-non-apple-ssd.markdown
Created June 25, 2012 02:39
Enabling TRIM Support on Mac OS X with Non-Apple SSDs

How To: Enable TRIM with Non-Apple SSD

The guide breaks the process down into three steps, all performed via copying and pasting the code snippets through the terminal window. To launch a terminal window, open the Utilities folder inside the Applications folder and select terminal.

The first step makes a backup of the original IOAHCIBlockStorage file called IOAHCIBlockStorage.original. You will be prompted to enter in your system password when using the "sudo" command, since you are modifying system files. Copy and paste the code into the terminal window, a successful or uneventful response is a new blank terminal line.

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.original

Next the code patches the IOAHCIBlockStorage file, removing the requirements that the SSD be made by Apple. Copy and paste t

@bzerangue
bzerangue / world-currency-list.xml
Created April 29, 2013 19:57
World currencies list source from themoneyconverter.com. With name of currency, currency code, (unicode symbols for those available), and rss feed locations.
<?xml version="1.0" encoding="UTF-8"?>
<currency source-url="http://themoneyconverter.com">
<entry code="ARS" feed-location="/rss-feed/ARS/rss.xml">
<name>Argentine Peso</name>
<unicode>
<decimal>36</decimal>
<hex>24</hex>
</unicode>
</entry>
<entry code="AWG" feed-location="/rss-feed/AWG/rss.xml">
@bzerangue
bzerangue / disable-suspend.md
Last active September 27, 2025 02:38
Disable Sleep/Suspend and WiFi in Ubuntu 16.04 LTS

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

@bzerangue
bzerangue / macs-on-active-directory.md
Last active August 6, 2025 19:23
Binding and Unbinding to Active Directory from Mac OS via Command Line

Binding and Unbinding to Active Directory from Mac OS via Command Line

  • Open the Terminal Application
  • Type in sudo -i and type in your Mac Administrator account password. sudo gives you root level or administrator level privileges.

To View current Active Directory Settings

dsconfigad -show

To Unbind a Computer from an Active Directory Domain

@bzerangue
bzerangue / update-hosts.sh
Last active June 3, 2025 16:04
A small shell script that will add and remove lines from the hosts file. Originally created by Claus Witt, http://clauswitt.com/319.html.
#! /bin/sh
# @author: Claus Witt
# http://clauswitt.com/319.html
# Adding or Removing Items to hosts file
# Use -h flag for help
DEFAULT_IP=127.0.0.1
IP=${3:-$DEFAULT_IP}
@bzerangue
bzerangue / books-of-the-bible.xml
Created August 20, 2011 23:14
A list of the Books of the Bible in XML format.
<?xml version="1.0" encoding="UTF-8"?>
<books-of-the-bible>
<entry handle="01">
<name handle="genesis">Genesis</name>
<testament handle="old-testament" abbreviation="OT">Old Testament</testament>
<chapters>50</chapters>
</entry>
<entry handle="02">
<name handle="exodus">Exodus</name>
<testament handle="old-testament" abbreviation="OT">Old Testament</testament>
@bzerangue
bzerangue / html2md-with-pandoc.sh
Created April 26, 2012 23:14
RECURSIVELY Bash convert all your html to markdown files (with Pandoc)
find . -name "*.ht*" | while read i; do pandoc -f html -t markdown "$i" -o "${i%.*}.md"; done
@bzerangue
bzerangue / README.md
Last active January 14, 2025 17:50
PocketPlatform - Dynamic Event List by Month with PocketPlatform Lists of Lists and Webviews and PHP

PocketPlatform - Dynamic Event List by Month with PocketPlatform Lists of Lists and Webviews and PHP

THE SCENARIO

We wanted to get away from the Events page with the long stream of reoccurring events and wanted to come up with a more organized way of structuring the events page of the app. Ever since the PocketPlatform team introduced the Lists of Lists feature, this allowed a Dynamic way of organizing our content in PocketPlatform. We focused on this being the way to go.


OUR INITIAL RESPONSE