Skip to content

Instantly share code, notes, and snippets.

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 / 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
@hartzell
hartzell / failing-test-case.md
Last active January 29, 2020 00:30
Demo of failing and working cases of connecting to files.pythonhosted.org
(alice)[16:00:11]~>>/usr/bin/openssl s_client -connect files.pythonhosted.org:443
CONNECTED(00000005)
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/C=US/ST=California/L=San Francisco/O=Fastly, Inc/CN=r.ssl.fastly.net
   i:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign CloudSSL CA - SHA256 - G3
@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 / .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
@hartzell
hartzell / udev
Last active May 20, 2019 17:54
Amazon Linux udev rules
# Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is