Skip to content

Instantly share code, notes, and snippets.

bzerangue /
Last active Nov 22, 2022
Scripts for recursively chmod directories only and recursively chmod files only

Useful commands

You may find these commands useful when adjusting file and directory permissions.

To recursively chmod directories only:

find /your/site/root -type d -exec chmod 755 {} \;

To recursively chmod files only:

bzerangue /
Last active Nov 19, 2022
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 /


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 /
Created Apr 26, 2012
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 / sermons.rss.xml.twig
Last active Oct 21, 2022
Twig Example template for RSS feed
View sermons.rss.xml.twig
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="" xmlns:wfw="" xmlns:dc="" xmlns:atom="" xmlns:sy="" xmlns:slash="" xmlns:itunes="" version="2.0">
<title>Sermons at Irving Bible Church</title>
<!-- Need to update with appropriate Sermon RSS Feed location -->
<atom:link href="" rel="self" type="application/rss+xml"></atom:link>
<description>Weekly morning sermons from Irving Bible Church in Irving, TX. For all of our sermon archives, please visit</description>
<lastBuildDate>Tue, 01 Dec 2015 00:00:00 -0600</lastBuildDate>
bzerangue /
Last active Oct 18, 2022
Installing Debian + Home Assistant Supervised

Installing Debian + Home Assistant Supervised (for a linux 64 bit pc intel or amd)

Build a USB installer for Debian (non-free firmware), download the Debian Buster and build usb installer with Balena Etcher

In the Debian installer, uncheck Debian desktop environment and check ssh server and other software modules.

After installing Debian, reboot the machine and login via ssh with the username you created during setup...

Once you have SSH'd from the terminal and have logged into your new Debian machine, run the following command...

bzerangue /
Created Apr 16, 2012
Terminal Script: Recursively rename or change file extensions (this example, changing extension from .html to .php)
find . -name "*.html" | while read i; do mv "$i" "${i%.html}.php"; done
bzerangue / master.xsl
Created Nov 15, 2010
HTML5 Boilerplate XSLT Master Stylesheet, see
View master.xsl
<?xml version="1.0" encoding="UTF-8" ?>
HTML5 Boilerplate XSLT Master Stylesheet (based on Paul Irish's HTML5 Boilerplate index.html file)
Created by Brian Zerangue on 2010-11-15.
Copyright (c) 2010 Paul Irish (Everything but the XSLT), Brian Zerangue (XSLT).
HTML5 Boilerplate,
<xsl:stylesheet version="1.0"
bzerangue / array2xml.php
Last active Sep 14, 2022
Decoding JSON to a PHP Array and then converting it to XML.
View array2xml.php
* Array2XML: A class to convert array in PHP to XML
* It also takes into account attributes names unlike SimpleXML in PHP
* It returns the XML in form of DOMDocument class for further manipulation.
* It throws exception if the tag name or attribute name has illegal chars.
* Author : Lalit Patel
* Website:
* License: Apache License 2.0
bzerangue / html-page-print-test.html
Last active Aug 19, 2022
nameTagContainer - MP NameTag - TEST for Secure NameTag
View html-page-print-test.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<div id="nameTagContainer" style="font-family:'Geneva','sans-serif';height:173px;width:272px;">