Skip to content

Instantly share code, notes, and snippets.

View jblachly's full-sized avatar

James S Blachly, MD jblachly

View GitHub Profile

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:

@jblachly
jblachly / freebsd_periodic_ssmtp.md
Created August 26, 2018 19:03
FreeBSD periodic output to external email addresses with SSMTP
@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)
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
@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:

  1. ARP queries are both blocked and not blocked. Snoop results:

13 0.47698 OLD-BROADCAST -> (broadcast) ARP C Who is 169.254.43.135, 169.254.43.135 ?

Here, dhcpcd 6.7.1 has given up on finding a DHCP server (the frames were blocked) and is trying to pick a link local address

However, when re-running dhcpcd later I captured the following blocked frame with dtrace

ff ff ff ff ff ff d2 e8 b0 94 ee 08 08 06 00 01
08 00 06 04 00 01 d2 e8 b0 94 ee 08 a9 fe 2b 87
To use matplotlib in virtualenv on Ubuntu 14.04
make virtualenv
symlink as described here: http://www.stevenmaude.co.uk/posts/installing-matplotlib-in-virtualenv
ln -sf /usr/lib/python2.7/dist-packages/{glib,gobject,cairo,gtk-2.0,pygtk.py,pygtk.pth} $VIRTUAL_ENV/lib/python2.7/site-packages
Then pip install matplot lib -- if you pip install before, the install won't detect necessary packages for the backends to install correctly