Skip to content

Instantly share code, notes, and snippets.

View aaronwolen's full-sized avatar

Aaron Wolen aaronwolen

View GitHub Profile
@aaronwolen
aaronwolen / open_door_notification.yaml
Last active February 28, 2024 16:24
Home-Assistant Blueprint: Open Door Notifications
# version: 1.0.1
# changelog:
# - Support for multiple door sensors
# - Initial release
blueprint:
name: Open Door Notification
description: Send a notification when a door is left open.
domain: automation
input:
@aaronwolen
aaronwolen / retrieve-aws-credentials.py
Created March 9, 2022 20:24
retrieve-aws-credentials
# access aws credentials for a profile from ~/.aws/credentials
import boto3
profile = 'default'
session = boto3.Session(profile_name=profile)
credentials = session.get_credentials()
credentials.access_key
credentials.secret_key
@aaronwolen
aaronwolen / find-and-rename.sh
Created September 29, 2021 19:11
Find and rename files
while read line; do
mv -v "$line" "${line// - /}"
done < <(find . -name '* .png')
@aaronwolen
aaronwolen / setup-ebs.sh
Last active November 25, 2021 13:24
Setup EBS Raid on EC2 Linux Instance
#!/usr/bin/env bash
# format
sudo mkfs -t ext4 /dev/nvme1n1
# mount ebs volumne
sudo mkdir -p /mnt/data
sudo mount /dev/nvme1n1 /mnt/data
# fix permissions
@aaronwolen
aaronwolen / Makefile
Created July 15, 2021 20:07
Modify ClinVar VCF for ingestion into TileDB-VCF
# genome reference
fai_url := s3://broad-references/hg38/v0/Homo_sapiens_assembly38.fasta.fai
fai_file := $(notdir $(fai_url))
# original clinvar vcf
vcf_url := ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar_20210710.vcf.gz
raw_vcf := $(notdir $(vcf_url))
# modified vcf file
mod_vcf := $(raw_vcf:%.vcf.gz=%_modified.vcf.gz)
@aaronwolen
aaronwolen / osfr-wiki-download.R
Created June 22, 2021 16:18
Use osfr to download individual OSF Wikis
library(osfr)
library(purrr)
library(tibble)
# functions ---------------------------------------------------------------
# id: project GUID
.osf_list_wikis <- function(id) {
api_path <- sprintf("nodes/%s/wikis", id)
@aaronwolen
aaronwolen / tiledbvcf-ingest-export-test.sh
Last active October 21, 2020 17:19
Shell script to run ingest/exports with different versions of tiledb-vcf
#!/usr/bin/env bash
# variables
#############
tilevcf="dist/bin/tiledbvcf"
tmpdir="/mnt/data/tmp"
samplefile="$tmpdir/samples.txt"
output_dir="data"
export_dir="$output_dir/exports"
@aaronwolen
aaronwolen / door-notification.yaml
Last active July 25, 2020 18:38
HASS Door Notification
- alias: Announce Door Open
trigger:
- platform: state
entity_id:
- binary_sensor.back_door
- binary_sensor.front_door
to: 'on'
for:
seconds: 30
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aaronwolen
aaronwolen / macos-10.15-prefix-dist
Last active May 18, 2020 19:30
Outputs from various build attempts.
../bootstrap --prefix=../dist
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++