Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Roman Valls Guimera brainstorm

🏠
Working from home
View GitHub Profile
@brainstorm
brainstorm / gist:736c138d60b420c30c7c942ab05fbe14
Created Oct 8, 2020
Rust htsget-aws compile times on OSX, Macbook Air, 1.6 GHz Dual-Core Intel Core i5
View gist:736c138d60b420c30c7c942ab05fbe14
(base) rvalls@umccr htsget-aws % time cross build --release --target x86_64-unknown-linux-musl
Updating git submodule `https://github.com/samtools/htslib.git`
Compiling libc v0.2.73
Compiling cfg-if v0.1.10
Compiling autocfg v1.0.0
Compiling proc-macro2 v1.0.19
Compiling unicode-xid v0.2.1
Compiling syn v1.0.35
Compiling lazy_static v1.4.0
Compiling log v0.4.11
@brainstorm
brainstorm / vscode-aws
Last active Nov 7, 2020
Poor man's vscode on AWS launch script
View vscode-aws
#!/bin/bash -x
## TODO:
# *** Just use this instead of this pestilent bash script: https://pypi.org/project/cdk-spot-one/ ***
# Monitor when and if the spot request is cancelled by AWS. Default shutdown behaviour is Stop so filesystems are kept intact, only connections die.
# 1. Launches instance w/ launch template and public VPC
# 2. Waits for spot request status to change to active/fulfilled
# 3. Gets public ip address for instance
View gist:d41fb302f05a7f277a99cfdc82f60d83
$ brew test-bot --skip-setup --root-url=https://dl.bintray.com/brainstorm/bottles-musl-cross --bintray-org=brainstorm --tap=brainstorm/musl-cross
Homebrew/homebrew-test-bot fe05361 (Merge pull request #338 from Bo98/dep_no_dev)
ARGV: --skip-setup --root-url=https://dl.bintray.com/brainstorm/bottles-musl-cross --bintray-org=brainstorm --tap=brainstorm/musl-cross
Homebrew.args: #<Homebrew::CLI::Args argv=["test-bot", "--skip-setup", "--root-url=https://dl.bintray.com/brainstorm/bottles-musl-cross", "--bintray-org=brainstorm", "--tap=brainstorm/musl-cross"], remaining=[], cmdline_args=["--skip-setup", "--root-url=https://dl.bintray.com/brainstorm/bottles-musl-cross", "--bintray-org=brainstorm", "--tap=brainstorm/musl-cross"], skip_setup?=true, root_url="https://dl.bintray.com/brainstorm/bottles-musl-cross", bintray_org="brainstorm", tap="brainstorm/musl-cross">
Error: No known CI provider detected! If you are using GitHub Actions or Jenkins
ghprb-plugin, then we cannot find the expected environment
variables! Ch
@brainstorm
brainstorm / c2rust_reg2bins.rs
Last active Jan 16, 2020
SAMv1 specification: C, C2Rust and Rust source code for computing bin number and overlapping bins
View c2rust_reg2bins.rs
#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case,
non_upper_case_globals, unused_assignments, unused_mut)]
#![register_tool(c2rust)]
#![feature(register_tool)]
pub type __uint16_t = libc::c_ushort;
pub type uint16_t = __uint16_t;
#[no_mangle]
pub unsafe extern "C" fn reg2bins(mut beg: libc::c_int, mut end: libc::c_int,
mut list: *mut uint16_t) -> libc::c_int {
let mut i: libc::c_int = 0 as libc::c_int;
@brainstorm
brainstorm / anritsu_bootlog.txt
Last active Apr 13, 2020
Anritsu builtin telnet debugger
View anritsu_bootlog.txt
[25 Sep 2019 at 22:14:46]:
...-> max contiguous free space: 26,544,177,156 bytes
# of files: 1,348
# of folders: 133
total bytes in files: 115,534 Kb
# of lost chains: 0
total bytes in lost chains: 0
Checking for log file (/card0/sys/evt/evt.log)
Purge old events: Found 11 events in the log
Initializing keypad driver
@brainstorm
brainstorm / anritsu_symbols_dump.py
Created Aug 17, 2019
Anritsu MS2721B quick and dirty over-telnet symbol enumeration
View anritsu_symbols_dump.py
#!/usr/bin/env python
import re
import csv
import telnetlib
from collections import defaultdict
## EXAMPLE FROM MS2721B telnet session
TEST_PAYLOAD='''lkAddr 0\r\n0x0c002000 _usrEntry text \r\n0x0c002040 _sysInit text \r\n0x0c002064 _intPrioTable text \r\n0x0c0
0216c _intPrioTableSize text \r\n0x0c002180 _ataDrv text \r\n0x0c002e40 _ataDevCreate text \r\n0x0c0030c0 _ataRawio
@brainstorm
brainstorm / Makefile
Last active May 7, 2020
htslib access (un)compressed offsets, now with newest htslib featuring hts_idx_load3 method.
View Makefile
all:
${CC} -g -Wall -I. -L. -I../rust-htslib/hts-sys/htslib -L../rust-htslib/hts-sys/htslib -I/usr/local/opt/bzip2/include -I/usr/local/Cellar/curl-openssl/7.68.0/include -I/usr/local/Cellar/xz/5.2.4/include -I/usr/local/opt/zlib/include s3_htslib.c -o s3_htslib -llzma -lz -lbz2 -lhts
clean:
rm s3_htslib
@brainstorm
brainstorm / htsget-openapi-factored.yaml
Last active May 17, 2019
htsget-openapi-factored.yaml
View htsget-openapi-factored.yaml
openapi: 3.0.0
servers:
- description: htsget genomics api
url: https://virtserver.swaggerhub.com/brainkod/htsget/1.1.1
info:
description: "This data retrieval API bridges from existing genomics bulk data transfers to a client/server model"
version: "1.1.1"
title: htsget
contact:
name: GA4GH
View igv_server_setup.md

Minimal NGINX configuration on the server side

WARNING: These notes are going to be eliminated by automation anytime soon (see Future section below).

Edit the file under /etc/nginx/sites-available/default to make sure it looks like this (read SSL section below for the encryption bits):

server {
        auth_basic "UMCCR AWS IGV Server";
        auth_basic_user_file /etc/nginx/htpasswd;
@brainstorm
brainstorm / igv_regenerate.sh
Last active Dec 19, 2018
IGV S3 to HTTP bridge
View igv_regenerate.sh
#!/bin/bash
##### CONFIG
S3FUSE_MNT=/mnt/igv
IGV_NGINX_MNT=/var/www/igv
IGV_XML_HEAD="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Global name=\"UMCCR AWS IGV server\" version=\"1\">\n<Category name=\"UMCCR Amazon IGV bucket\">"
IGV_XML_BODY_TMPL="<Resource name=\"SAMPLE\" path=\"URL\"></Resource>\n"
IGV_XML_TAIL="</Category>\n</Global>\n"
IGV_XML_BODY_ARRAY=()