Skip to content

Instantly share code, notes, and snippets.

Roman Valls Guimera brainstorm

Block or report user

Report or block brainstorm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / fix_osx_pcbnew_kicad_libs.sh
Created Sep 1, 2017
Fix KiCAD's pcbnew python scripting support for OSX
View fix_osx_pcbnew_kicad_libs.sh
#!/bin/bash
# Inspired on: https://www.bountysource.com/issues/31269729-libwx_osx_cocoau-3-1-dylib-not-found
KICAD_LIBS_TOFIX="libwx_osx_cocoau_gl-3.0.0 libwx_osx_cocoau_adv-3.0.0 libwx_osx_cocoau_aui-3.0.0 libwx_osx_cocoau_adv-3.0.0 libwx_osx_cocoau_html-3.0.0 libwx_osx_cocoau_core-3.0.0 libwx_osx_cocoau_stc-3.0.0 libkicad_3dsg.2.0.0 libGLEW.2.0.0 libcairo.2 libpixman-1.0 libwx_baseu_net-3.0.0 libwx_baseu-3.0.0 libwx_baseu_xml-3.0.0"
#KICAD_LIBS_TOFIX=`find /Applications/Kicad/kicad.app/Contents/Frameworks/ -iname *.dylib | xargs otool -L | grep executable_path | awk '{print $1}' | awk -F'/' '{print $4}'`
for kicadlib in $KICAD_LIBS_TOFIX;
do
echo "Fixing ${kicadlib} broken path on pcbnew..."
@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
@brainstorm
brainstorm / htslib_idx_load.c
Created Mar 27, 2019
htslib access (un)compressed offsets
View htslib_idx_load.c
#include <stdio.h>
#include <stdlib.h>
#include <htslib/hts.h>
#include <htslib/bgzf.h>
#include <hts_internal.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv)
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 / esp32_promisc.c
Last active Jan 22, 2019
esp32 promiscuous mode and packet injection experiments
View esp32_promisc.c
// Espressif ESP32 promiscuous mode and packet injection experiments
// by brainstorm at nopcode org
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
@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=()
@brainstorm
brainstorm / esc_motor_pseudo.c
Created Sep 5, 2018
ARDrone ESC motor pseudocode (with r2dec decompiler, pdd command)
View esc_motor_pseudo.c
#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))
View XHC Mach3 CNC USB comms dump.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brainstorm
brainstorm / openscad_trolley.scad
Created Mar 25, 2018
OpenSCAD trolley fix for titan bags
View openscad_trolley.scad
/*
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.
*/
You can’t perform that action at this time.