Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / home-assistant-x86-install.md
Last active May 6, 2022
Using Live Image of ZorinOS/Ubuntu/Linux Mint to Create Home Assistant OS boot drive - for x86 machines
View home-assistant-x86-install.md

Installing the official Home Assistant OS on an old x86 PC.

This is not a support document. Not responsible for whomever might use this. This put down for my personal use and if anyone else wants to use it they can, but this process will remove any data from the target device they are installing on.

REQUIREMENTS:

  • Intel or AMD x86 PC, monitor, keyboard, internet connection via ethernet.
  • Bootable USB thumb drive of the latest dekstop version of ZorinOS, Ubuntu, or Linux Mint
  1. Boot your machine with the bootable Zorin OS and select Try Zorin OS (you do NOT want to install it)
@bzerangue
bzerangue / debian-home-assistant-supervised_instructions.md
Last active Mar 6, 2022
Installing Debian + Home Assistant Supervised
View debian-home-assistant-supervised_instructions.md

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

View alpine-js-fetch.markdown
@bzerangue
bzerangue / xml2json-PHP-README.md
Last active Jun 21, 2021
xml2json - PHP associative array from XML encoded into JSON (from https://github.com/tamlyn/xml2json/)
View xml2json-PHP-README.md

Create plain PHP associative array from XML

Example usage:

    $xmlNode = simplexml_load_file('example.xml');
    $arrayData = xmlToArray($xmlNode);
    echo json_encode($arrayData);
@bzerangue
bzerangue / data.csv
Created Dec 24, 2020 — forked from Monichre/data.csv
Demo of importing a CSV file into a Contentful space
View data.csv
first name last name age
Stephen Sugden 31
Tom Reznik 29
Justin Thomas 30
@bzerangue
bzerangue / BulkRename.applescript
Created Dec 5, 2020 — forked from nrollr/BulkRename.applescript
Bulk rename files with csv file
View BulkRename.applescript
-- Store the .csv file in the same directory as the files you wish to rename
-- Replace 'username' in the path with your own (lines 3 & 10)
set csvFile to "/Users/username/Documents/index.csv"
set csvList to paragraphs of (read csvFile)
set {theID, my text item delimiters} to {my text item delimiters, ","}
repeat with csvLines in csvList
set {oldName, newName} to text items of csvLines
tell application "System Events"
set name of file oldName of folder "/Users/username/Documents/" to newName
@bzerangue
bzerangue / videoEmbed.js
Last active Nov 17, 2021
videoEmbed.js contentType - preview component for Sanity.io CMS richText PortableText editor - based off of Knut's YouTube Preview, https://www.youtube.com/watch?v=kLsER_zHiS4
View videoEmbed.js
import React from 'react'
const VideoEmbedPreview = ({ value }) => {
const url = value.url
const responsiveVideoContainer = {
padding: "56.25% 0 0 0",
position: "relative"
}
@bzerangue
bzerangue / x86-raspi-screenly-ose.md
Last active Feb 15, 2021
Running Screenly OSE on Raspberry Pi Desktop for x86 (PC) - instructions [this is not supported - this is a hack to get it to work]
View x86-raspi-screenly-ose.md

NOTE: These are not official instructions for the getting Screenly OSE to run on Raspberry Pi Desktop for x86 machines. This was a hack. These instructions are not supported. I posted them here to remember the steps I took to get it to work. Use at your own risk.

Step 1

  • Load Wifi deb files onto USB
  • Install Raspberry Pi Desktop for x86 PC - Raspberry Pi Debian Stretch - 2019-04-11-rpd-x86-stretch.iso

Step 2

View error.txt
Error: Cannot find module './cors/addCorsOriginCommand'
Require stack:
- /Users/bmz/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/commands/index.js
- /Users/bmz/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/index.js
- /usr/local/lib/node_modules/@sanity/cli/bin/sanity-cli.js
- /usr/local/lib/node_modules/@sanity/cli/bin/sanity
at require (/usr/local/lib/node_modules/@sanity/cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (~/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/commands/index.js:64:52)
at Module._compile (/usr/local/lib/node_modules/@sanity/cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
@bzerangue
bzerangue / a_README.md
Last active Jun 10, 2019
Migrating Symphony CMS REST API data to Sanity.io
View a_README.md

Migrating Symphony CMS REST API data to Sanity.io

Note: Using jq to transform JSON data.

  1. Original Data from the REST API extension in Symphony CMS --> example-01.json

  2. Clean-up original json data with jq from the command-line. --> example-02.json (cleaner JSON data)

cat example-01.json | jq '[.response.entry[] | {_type: "sermons", title: .title.value, date: .date.date.start._iso, scripture: .scripture.value, speaker: .["speaker-name"].value,audio: .["simplecast-url"].value}]' &gt; example-02.json