Skip to content

Instantly share code, notes, and snippets.

@hartzell
hartzell / simple-spack-install.sh
Created December 3, 2019 16:49
Simplified version of a script for providing a big bunch of things with Spack
#!/bin/sh
set -e
# having an app tree set up messes up the build. Clear the field.
if [[ $(type -t module) == "function" ]]; then
module purge
fi
cat << "EOYAML" > etc/spack/packages.yaml
packages:
@hartzell
hartzell / app-init.sh
Created January 16, 2019 23:42
A script to initialize a user's environment to use a tree of Spack packages
# -*- mode: sh -*-
# vim: set ft=sh
#
# The typical user's .bash_profile would include:
#
# APPS_MODULES="emacs git htop the-silver-searcher" # and etc....
# source /moose/apps/init.sh
#
# Even setting APPS_MODULES is optional if user is ok with default list...
#
@hartzell
hartzell / .lircrc-A1156
Last active January 19, 2021 11:42
Configuring a headless PiCorePlayer to use an Apple 1294 IR remote
begin
remote = Apple_A1156
button = KEY_UP
repeat = 0
prog = squeezelite
config = volup
end
begin
remote = Apple_A1156
echo -n "CAAT" | perl -pe '{tr/atcgATCG/tagcTAGC/; $_=reverse}'
or for IUPAC:
tr/ABCDGHMNRSTUVWXYabcdghmnrstuvwxy/TVGHCDKNYSAABWXRtvghcdknysaabwxr/;
@hartzell
hartzell / emacs-profile.txt
Created June 10, 2020 00:07
esup profile of my emacs startup on AWS
$ cat emacs-profile
Built an X emacs and ran esup. Here's what it told me:
FWIW: The total of the non-zero times excluding sm-modules is 3.95....
---
Total User Startup Time: 17.204sec Total Number of GC Pauses: 0 Total GC Time: 0.000sec
@hartzell
hartzell / dropdown-value-not-reset.py
Created June 6, 2020 16:26
Demo of the dropdown's value not being reset when it is removed from the list of options.
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from flask import Flask, send_file
server = Flask(__name__)
app = dash.Dash(server=server)
@hartzell
hartzell / uploader-not-reset.py
Created June 6, 2020 14:43
Demo of possible bug with Dash Upload component
# this has a problem that the "new_jobs" values aren't reset after
# being used.
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from flask import Flask, send_file
server = Flask(__name__)
@hartzell
hartzell / upload.py
Created June 2, 2020 16:18
Simple sample Dash uploader script, sometimes complains 'Failed to fetch'
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from flask import Flask
server = Flask(__name__)
app = dash.Dash(server=server)
@hartzell
hartzell / aurora_cluster.tf
Last active April 6, 2020 16:11 — forked from sandcastle/aurora_cluster.tf
Creates a AWS RDS Aurora Cluster with Terraform
########################
## Variables
########################
variable "environment_name" {
description = "The name of the environment"
}
variable "vpc_id" {
@hartzell
hartzell / spack-debug-output
Created February 28, 2020 23:44
spack install unable to use checksum generated by spack checksum
[ghartzell@bifx1n03 spack-update-kallisto]$ spack -d install kallisto
==> [2020-02-28-15:43:15.438065, 15427] Imported install from built-in commands
==> [2020-02-28-15:43:15.439304, 15427] Reading config file /home/ghartzell/tmp/spack-update-kallisto/etc/spack/defaults/config.yaml
==> [2020-02-28-15:43:15.453801, 15427] Imported install from built-in commands
==> [2020-02-28-15:43:15.455972, 15427] Reading config file /home/ghartzell/tmp/spack-update-kallisto/etc/spack/defaults/repos.yaml
==> [2020-02-28-15:43:15.525066, 15427] Reading config file /home/ghartzell/tmp/spack-update-kallisto/etc/spack/defaults/packages.yaml
==> [2020-02-28-15:43:15.541270, 15427] READ LOCK: /home/ghartzell/.spack/cache/tags/.builtin-index.json.lock[0:0] [Acquiring]
==> [2020-02-28-15:43:15.541371, 15427] read locking [0:0]: timeout 120 sec
==> [2020-02-28-15:43:15.541434, 15427] READ LOCK: /home/ghartzell/.spack/cache/tags/.builtin-index.json.lock[0:0] [Acquired at 15:43:15.541416]
==> [2020-02-28-15:43:15.541831, 15427] READ L