Skip to content

Instantly share code, notes, and snippets.

View jblachly's full-sized avatar

James S Blachly, MD jblachly

View GitHub Profile
@jblachly
jblachly / bcl2fastq build ubuntu 16 LTS.md
Last active March 14, 2023 17:33
How to build bcl2fastq2 on Ubuntu 16 LTS

1. Make sure configure can find sys/stat.h:

Modify bcl2fastq/src/cmake/macros.cmake

Find the last block:

#
# Macro to find libraries, with support for static-only search
#
macro(bcl2fastq_find_header_or_die variable file)
@jblachly
jblachly / freebsd_periodic_ssmtp.md
Created August 26, 2018 19:03
FreeBSD periodic output to external email addresses with SSMTP
@jblachly
jblachly / cloudinit-tips.md
Last active March 9, 2022 07:49
SmartOS (standalone) cloudinit setup for KVM images

The following keys, when placed in the customer_metadata section of the VM definition JSON will effect the specified behaviour:

smartos key corresponds to cloudinit key effect
hostname local-hostname
root_authorized_keys public-keys copies to /root/.ssh and default user ~/.ssh (e.g., ubuntu)
user-script user-script Executed each boot
user-data legacy-user-data
cloud-init:user-data user-data Evaluated by cloud-init once at VM creation only
iptables_disable iptables_disable ?

Keybase proof

I hereby claim:

  • I am jblachly on github.
  • I am jamesblachly (https://keybase.io/jamesblachly) on keybase.
  • I have a public key ASBhflLzaVYhElnFu5l3b2DdCG5OjrexLopbiUBdG_dImwo

To claim this, I am signing this object:

module minkowski;
import std.math : abs, pow, sqrt;
import std.algorithm;
import std.stdio;
float minkowski_distance(F)(F[] v1, F[] v2, int p=1)
{
// Theoretically the Minkowski distance can be defined for noninteger powers
// but I do not want to deal with this right now
jsbmbp13:/tmp$ uname -a
Darwin jsbmbp13.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
jsbmbp13:/tmp$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
Linux hostname 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[2686644.696004] usb 2-1.8: new low-speed USB device number 119 using ehci-pci
[2686644.798923] usb 2-1.8: New USB device found, idVendor=09ae, idProduct=3015
[2686644.798930] usb 2-1.8: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[2686644.798933] usb 2-1.8: Product: TRIPP LITE SMART2200RM2U
[2686644.798937] usb 2-1.8: Manufacturer: Tripp Lite
[2686644.798953] usb 2-1.8: SerialNumber: 2524DY0SM820700076
[2686644.926819] hid-generic 0003:09AE:3015.2BC64: hiddev0,hidraw4: USB HID v1.10 Device [Tripp Lite TRIPP LITE SMART2200RM2U ] on usb-0000:00:1d.0-1.8/input0
[2686659.539080] usb 2-1.8: USB disconnect, device number 119
package main
import (
"encoding/json"
"fmt"
"time"
)
type Duration time.Duration

rem_drv hid

//add doesnt work because 'ugen' already in use

//add_drv -i '"/dev"' -m '* 0666 nut root' -v ugen

update_drv -a -i '"usb9ae,3015.20a"' -m '* 0666 nut root' -v ugen

usb-vendor-id: 9ae usb-product-id: 3015

@jblachly
jblachly / Snakemake-Undocumented.md
Last active April 8, 2016 18:10
Undocumented Snakemake functionality

Wildcards

wildcards only appears in two cases as far as I can tell

  1. when using a function to define input files
  2. in a lambda function , as in e.g. params: stagger_len = lambda wildcards: stagger(int(wildcards.REVNUM))

Including variables in expand()

Including variables in an expansion doesn't seem to work at first: