Skip to content

Instantly share code, notes, and snippets.

View johndturn's full-sized avatar
🤷‍♂️

John Turner johndturn

🤷‍♂️
View GitHub Profile
@johndturn
johndturn / local-dns-setup.md
Created June 14, 2022 16:28
Simple walkthrough to configure local DNS on your Pi-hole instance.

How to Set up Local DNS

After 2 years of running Pi-hole on my RaspberryPI, I realized that I've been totally ignoring a massively beneficial (and easy-to-configure) feature that comes out of the box: Local DNS. Thankfully, I heard an episode of the Changelog Podcast that casually mentioned it, and it got me researching.

The setup is incredibly simple, and can be done entirely through the Pi-hole GUI. Thanks to Techno Tim for the great tutorial (see the section below for a link to the video).

  1. Log into your PiHole instance
  2. Click on the "Local DNS" navbar item on the left
  3. Select either "DNS Records" (for A records) or CNAME Records
  4. Create your entries
@johndturn
johndturn / restoring-unifi-controller.md
Created April 25, 2022 21:41
How to uninstall and reinstall the Ubiquiti Unifi controller software on a Raspberry Pi (or other Linux environment), and restore from a Backup

Restoring Unifi Controller

Today I woke up and realized that a power surge a while back had taken down our Unifi controller without me realizing. I went to log in to check on firmware updates for the network only to see that I couldn't log in at all. I guess that's the benefit of hosting your controller via a CloudKey Gen 2 with a built-in on-device battery vs. on a Raspberry Pi like I do.

That said, restoring from scratch was actually super easy, given that I had regular backups. Here's the process and some additional reading that I used.

Assumptions

  • You're running the most recent version of the Ubiquiti Unifi controller on a Raspberry Pi (or other Debian-based Linux-based environment)
  • You already have your self-hosted environment set up with a static IP address, and can access it via ssh or through a command line interface
@johndturn
johndturn / hosting-cometd-on-windows.md
Last active April 21, 2022 04:59
Guide on how to deploy a CometD Node client to Windows Server

Hosting CometD Clients on Windows Server (2019)

How to host and correctly run a Node CometD client on Windows Server (2019+) for connecting to a Salesforce instance in order to listen to Platform Events. These instructions are also specifically for accessing a Windows Server instance running in Azure.

Steps Followed

  1. Set up Remote Desktop connection to get access to the server
    1. Download macOS Microsoft Remote Desktop client via the Mac App Store
    2. Ensure that you have the Windows AD credentials for the organization in order to allow you to log in
    3. Get the URL of the Workspace from your Admin
@johndturn
johndturn / launchd-for-services.md
Last active November 4, 2024 14:45
Overview of using launchd to set up services on a macOS machine.

launchd - Script Management in macOS

What is it?

  • Used on macOS for managing agents and daemons and can be used to run scripts at specified intervals
    • macOS's competitor to cron, along with other things
  • Runs Daemons and Agents

What is a Daemon?

@johndturn
johndturn / Creating a Sourdough Starter.md
Last active September 3, 2020 02:35
Some thoughts from my experience baking with a wild yeast starter.

Creating a Sourdough Starter

I've been baking with a sourdough starter since about 2016. When I first started, I kept pretty close to the recipes and techniques listed in Flour, Water, Salt, and Yeast (FWSY), by Ken Forkish. Following Ken's advice as outlined in his book, I made some pretty great bread. However, after doing it for about a year, I decided to start to experiment with some changes.

Unfortunately, in my experiments I didn't make very good bread. So, I wanted to learn more about the process, and figure out what I was doing wrong. Ultimately, I wanted to gain more baking intuition. After working at it, and experimenting with different makeups of a sourdough starter (referred to by many as a levain), I was able to learn some things that I felt weren't adequately communicated in other blogs, forums, and YouTube videos. That, or I was just too hard-headed, and needed to experience bad outcomes to learn.

Why So Many Sourdough Recipes

There are tons of conflicting advice and recipes onlin

@johndturn
johndturn / PostLeads.md
Last active April 25, 2024 14:17
Post Leads to SFDC via JavaScript Fetch API and a Web-to-Lead form.

Post Leads to SFDC via JS Fetch API & Web-to-Lead

When working with Web-to-Lead forms, you might run into a situation where you'd like to integrate the form with your frontend framework (React, Vue, Angular, etc...). This can be accomplished quite easily using whatever HTTP library you're most comfortable with.

To demonstrate this, let's take a look at an example Web-to-Lead form, and the JavaScript required to post Leads to a SFDC org.

Example Form

<html lang="en">
@johndturn
johndturn / Controlling & Dependent Picklists in Web-to-Lead Forms.md
Last active September 11, 2023 16:16
Brief explanation and code snippets for Controlling/Dependent picklist functionality in your Web-to-Lead forms.

Controlling and Dependent Picklists in Web-to-Lead Forms

The Dependent Picklist feature in Salesforce is an incredibly powerful tool for keeping data clean and organized. Through setting up relationships between different fields, an Admin can filter available values in certain picklists based on the value of other fields.

Unfortunately, many Admins discover that, despite configuring dependent picklists for objects like Leads, that functionality disappears as soon as they generate a Web-to-Lead form.

Wouldn’t it be great to maintain that data cleanliness in the Leads generated by those that fill out your HTML forms? Turns out the code necessary for this is pretty straightforward.

Example Lead Form

@johndturn
johndturn / TestifyingOfChrist.md
Created March 8, 2020 05:44
Talk given on Mar 8, 2020 in Draper South Mountain 1st Ward on Testifying of Christ

Testifying of Christ

Introduction

Main Points for talk:

Pulling especially from this week's Come, Follow Me study...

  • Hone in on how Nephi testified of Christ
  • Answer the question: Why did he care?

Monokai+ Theme for Quiver App

I use the Quiver App quite frequently for code samples, general notes, etc... However, I've never been able to find a theme for it that really satisfied my love for Monokai. So, similar to my custom Monokai theme (based on the VSCode Monokai theme, which I call Monokai+) for Jetbrains products, I've created this theme for the Quiver app.

The initial theme was based on the Dark Ulysses theme. It's a great base theme, but since I write almost exclusively in Markdown in the editor, I found the Markdown cells needed some Monokai goodness. Hence, Monokai+ for Quiver was born.

Feel free to take it, add to it, or comment for improvements.

Note: As I mentioned, I write basically all of my notes in the Markdown cells in Quiver; therefore, I haven't really touched the theme for the other cells. If there are updates that you'd like to see there, feel free to update it.

@johndturn
johndturn / NewMac.md
Last active January 8, 2021 05:17
New macOS Machine Setup

Setting Up New macOS Machine for Development

With so much in the cloud these days, I find that it's become easier and easier to justify wiping my machine totally, and starting fresh. The pain of getting all your data transferred has mostly vanished away with the adoption of storing basically all of my most important data in various cloud repositories.

That being said, there are still plenty of things that need downloading and configuring on a fresh machine. To avoid the hassle of looking at the same GitHub repos over and over again for installation, and trying to remember all of the small command line tools that I had installed, I figured it was time to write down the things that I need on each machine.

Apps (From App Store)

  • 1Password
  • GifKeyboard (essential)