Skip to content

Instantly share code, notes, and snippets.

@natecostello
natecostello / colors.py
Created May 22, 2024 00:25
A script that shows how to produce color schemes for plotting distinct traces from two populations (e.g., pass, fall) #matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import numpy as np
# Generate some data
np.random.seed(0)
x = np.linspace(0, 10, 100)
y1 = [np.sin(x + i) for i in range(5)] # Periodic dataset
y2 = [np.exp(-0.1 * (x + i)) for i in range(5)] # Non-periodic dataset
@natecostello
natecostello / readme.md
Last active October 7, 2023 02:26
Convert ALAC to AAC

for i in *.m4a; do ffmpeg -i "$i" -c:a aac -b:a 256k "${i%.*}.aac"; done

To determine if alac or acc:

for i in *.m4a; do t=$(ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$i"); echo $t $i ; done

In a mixed directory, to only convert alac to aac:

for i in *.m4a; do t=$(ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$i"); if [ $t = 'alac' ]; then ffmpeg -i "$i" -c:a aac -b:a 256k "${i%.*}.aac" ; fi; done;

@natecostello
natecostello / Project-queries.md
Created April 25, 2023 15:21
Project Queries

These are the queries that I add to each new Project page

The easiest way to do this is to capture them in a single template that you can run for each new project.

#+BEGIN_QUERY
{:title "WAITING"
 :query [:find (pull ?b [*])
       :in $ ?current-page
       :where
@natecostello
natecostello / Journal_Queries.md
Created April 25, 2023 15:14
Logseq Journal Queries

These are Journal Queries displayed at the bottom of the current Journal Page

They are placed in this section of config.edn

:default-queries
 {:journals
 "INSERT HERE"
 }
@natecostello
natecostello / exiftool-recipes.md
Created February 28, 2023 18:22
Handy exiftool commands

Fixing the dates on GoPro videos

This will update all MP4 files in a directory with a date in the format "YYYY:MM:DD HH:MM:SS". It was taken from an answer to this question.

exiftool -FileCreateDate="2023:02:27 17:00:00" -FileModifyDate="2023:02:27 17:00:00" -Quicktime:CreateDate="2023:02:27 17:00:00" -api QuickTimeUTC *.MP4

@natecostello
natecostello / windows-utm.md
Created September 11, 2022 16:36
Windows on Apple Silicon UTM

Purpose

Installing windows 10 via UTM on apple silicon.

Motivation

Some of our equipment can't be fully configured without windows (e.g., victron, wakespeed). In the past we used virtualbox but they no longer, and will probably never, support apple silicon.

Steps

This page has the instructions we followed.

@natecostello
natecostello / VPS-VNC-setup.md
Last active August 23, 2022 04:46
Setting up VNC on a VPS (over SSH)

Purpose

The purpose of this gist is to document the setup of a VNC server to allow remote desktop access on my development VPS.

Motivation

There are some chome extensions (e.g. webscrapers) that I would like to run from a VPS. This way the connection quality of my present location isn't a factor.

Steps

I'm using this guide.

@natecostello
natecostello / geotagging.md
Last active October 5, 2022 03:20
Notes on Geotagging with exiftool

Notes On Geotagging

Our camera doesn't have a GPS. If we have a GPX track, we can tag all photos in a directory as follows:

  1. Ensure the GPX zulu + offset time matches the "Date/Time Original" field of the photos to be tagged.
exiftool -datetimeoriginal photo_to_be_tagged.jpg
  1. Copy the GPX file into the directory with the photos to be tagged.
@natecostello
natecostello / remote-dev.md
Last active August 18, 2022 03:59
Developing with VSCode in containers on a VPS

Purpose

The purpose of this gist is to document the setup of VSCode + VPS to allow remote development in containers.

Motivation

The reason for developing in this way is to assuage my fear of purchasing a new Mac with only 16GB of RAM that will replace my several-year-old Mac that has only 16GB of RAM. The new fancy RAM is supposed to be enough except for people that run a lot of Docker containers on Macs which uses a virtual machine, which ties up a fixed amount of RAM. With this method, the Mac runs no containers, thus no virtual machine, and thus no memory issue.

Steps

@natecostello
natecostello / insulation.md
Last active November 10, 2020 00:34
Transit Thermal Analysis
section category title author data tags
van
envelope
Insulation
Stello
2020-11-5
insulation
design
concept