Skip to content

Instantly share code, notes, and snippets.

View brainstorm's full-sized avatar

Roman Valls Guimera brainstorm

View GitHub Profile
@brainstorm
brainstorm / anritsu_bootlog.txt
Last active April 13, 2020 10:01
Anritsu builtin telnet debugger
[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 August 17, 2019 13:52
Anritsu MS2721B quick and dirty over-telnet symbol enumeration
#!/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 06:45
htslib access (un)compressed offsets, now with newest htslib featuring hts_idx_load3 method.
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 08:23
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
@brainstorm
brainstorm / igv_server_setup.md
Created February 14, 2019 02:41
IGV HTTP server setup

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 December 19, 2018 06:43
IGV S3 to HTTP bridge
#!/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=()
@brainstorm
brainstorm / esc_motor_pseudo.c
Created September 5, 2018 10:26
ARDrone ESC motor pseudocode (with r2dec decompiler, pdd command)
#include <stdint.h>
#include <limits.h>
#define DISABLE_INTERRUPTS __asm(cli)
#define ENABLE_INTERRUPTS __asm(sei)
#define MEM_X ((uint16_t*)((r27 << 8) | r26))
#define MEM_Y ((uint16_t*)((r29 << 8) | r28))
#define MEM_Z ((uint16_t*)((r31 << 8) | r30))
@brainstorm
brainstorm / openscad_trolley.scad
Created March 25, 2018 11:00
OpenSCAD trolley fix for titan bags
/*
This is a titan bags (https://www.titan-bags.com/) custom part replacement. This piece goes inside the
"telescopic" handle bar after removing two screws. The mechanism is brittle and breaks with repeated
pressure to the main button, leading to an "always locked" position of the telescopic bars.
I've printed this part successfully with PETG 3D printing material via http://3dhubs.com.
*/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brainstorm
brainstorm / pcgr.service
Last active October 22, 2019 10:44
systemd with python3 virtualenv does not find modules
(venv) ubuntu@localhost:/etc/systemd/system$ sudo cat pcgr.service
[Unit]
Description=PCGR sample consumer process
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/home/ubuntu
ExecStart=/mnt/pcgr/venv/bin/python3 /mnt/pcgr/pcgr_consumer.py pcgr ap-southeast-2 pcgr 10 10 /home/ubuntu