Skip to content

Instantly share code, notes, and snippets.

View blakeNaccarato's full-sized avatar

Blake Naccarato blakeNaccarato

View GitHub Profile
@blakeNaccarato
blakeNaccarato / $1 WSL2 Setup.md
Last active November 5, 2022 21:43
[20/08/25] A guide to setting up Windows Subsystem for Linux 2 (WSL2) in Windows 10 version 2004

WSL2 Setup [20/08/25]

First, execute these commands in Windows pwsh/cmd to ensure the proper features are turned on.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Then, update the [WSL 2 Linux kernel].

@blakeNaccarato
blakeNaccarato / generate_lab_data.py
Last active January 12, 2024 04:35
Generate data for different lab sections.
"""
From all Excel workbooks in the working directory, generate multiple distinct Excel
workbooks in subfolders with different data and computed results removed. Retain an
instructor's key for each distinct dataset.
- Remove cell names.
- Remove sheets matching "pivot".
- Multiply bold cells by a factor from a Gaussian distribution and unbold them.
- Clear italic cells.
- Clear table column formulas.
@blakeNaccarato
blakeNaccarato / $ Host a web portfolio.md
Last active January 13, 2024 01:18
Host a web portfolio

5. (WORK IN PROGRESS) Host the example website on GitHub

5.1. Create a GitHub profile

Create a GitHub profile. You may want to ensure that the email address you used to set up your account stays private. To do this, go to the Emails section of your profile settings. Configure it as you see below. Copy/paste the 0000000+userName@users.noreply.github.com address somewhere, as you will use it later when configuring Git.

![profile email options]

If you already have a GitHub profile, use that for now. Eventually, you may want to migrate your portfolio repository to its own, separate GitHub account, but that can be done easily later on.

@blakeNaccarato
blakeNaccarato / $ Set up Raspberry Pi.md
Last active January 12, 2024 04:37
Set up Raspberry Pi

Set up Raspberry Pi

Set up SSH with VSCode

Connect to WiFi. In bash, run sudo apt update, then sudo apt full-upgrade. Next, run mousepad /etc/dhcpcd.conf or similar to view the networking configuration file. Find the lines that look similar to below, uncomment them, and input proper addresses. Use eth0 to set a static IP for wired connection, and wlan0 for wireless.

# Example static IP configuration:
interface wlan0
static ip_address=192.168.X.XX/24
@blakeNaccarato
blakeNaccarato / Set up ESP-32.md
Last active January 12, 2024 04:37
Set up ESP-32

ESP-IDF

The basic tools for developing for ESP-32 in VSCode.

https://docs.espressif.com/projects/esp-idf/en/stable/get-started/index.html

Currently on "Step 6". Virtual environment exists in C:\Users\Blake\Desktop\esp-idf\examples\get-started\hello_world. You have to run C:\Users\Blake\Desktop\esp-idf\export.ps1 to configure the pwsh session w/ the proper environment variables to execute idf.py build.

Installing ESP-IDF Release from GitHub

@blakeNaccarato
blakeNaccarato / Base.md
Last active January 13, 2024 01:18
Setup for a Raspberry Pi image

Setup for Raspberry Pi image 21.02.02 Base.img

The Raspberry Pi image 21.02.02 Base.img is the base image.

Version info

This image runs Raspberry Pi OS from 2021-01-11 and Linux kernel 5.4. A sudo apt update and sudo apt full-upgrade was run before imaging.

$ uname -a
@blakeNaccarato
blakeNaccarato / $ ESPHome.md
Last active January 12, 2024 04:38
ESPHome

Had to pip uninstall typing in order to get past AttributeError: type object 'Callable' has no attribute '_abc_registry'. See https://community.home-assistant.io/t/upgrade-error-cryptography-module/194496.

Something else strange:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
esphome 1.16.0 requires PyYAML==5.3.1, but you have pyyaml 5.4.1 which is incompatible.
esphome 1.16.0 requires voluptuous==0.12.0, but you have voluptuous 0.12.1 which is incompatible.
Successfully installed PyJWT-1.7.1 aiohttp-3.7.3 astral-1.10.1 async-timeout-3.0.1 attrs-19.3.0 bcrypt-3.1.7 ciso8601-2.1.3 cryptography-3.2 h11-0.12.0 homeassistant-2021.2.0 httpcore-0.12.3 httpx-0.16.1 multidict-5.1.0 pip-20.2.4 python-slugify-4.0.1 pyyaml-5.4.1 requests-2.25.1 ruamel.yaml-0.15.100 sniffio-1.2.0 text-unidecode-1.3 voluptuous-0.12.1 voluptuous-serialize-2.4.0 yarl-1.6.3
@blakeNaccarato
blakeNaccarato / Microsoft.PowerShell_profile.ps1
Last active January 13, 2024 01:18
An older version of my PowerShell profile
# * -------------------------------------------------------------------------------- * #
# * ENVIRONMENT
# If there is an `.env` file in the PWD, load environment variables from it
Set-PsEnv
# If there is a Python virtual environment in the PWD, activate it
if (Test-Path ".\.venv\Scripts\Activate.ps1") {& ".\.venv\Scripts\Activate.ps1"}
@blakeNaccarato
blakeNaccarato / $Enums.md
Last active January 12, 2024 05:05
Different kinds of Python enums

Enums

Different kinds of Python enums.