Skip to content

Instantly share code, notes, and snippets.

Working from home

Roman Valls Guimera brainstorm

Working from home
View GitHub Profile
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))
brainstorm / openscad_trolley.scad
Created Mar 25, 2018
OpenSCAD trolley fix for titan bags
View openscad_trolley.scad
This is a titan bags ( 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
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 / pcgr.service
Last active Oct 22, 2019
systemd with python3 virtualenv does not find modules
View pcgr.service
(venv) ubuntu@localhost:/etc/systemd/system$ sudo cat pcgr.service
Description=PCGR sample consumer process
ExecStart=/mnt/pcgr/venv/bin/python3 /mnt/pcgr/ pcgr ap-southeast-2 pcgr 10 10 /home/ubuntu
brainstorm /
Created Feb 11, 2018
Fix posts metadata to migrate from Jekyll to Blogdown
#!/usr/bin/env python
import os
from pathlib import Path
import datetime
import frontmatter
posts_root = os.environ['HOME'] / Path('dev/brainblog/content/post')
for post in posts_root.iterdir():
#"IcePick", orginally "gardnert/aws-glacier-multipart-upload"
#./ [filename]
#byteSize=4294967296 # MAX Glacier, 4GB?
#byteSize=104857600 # 100MB otherwise timeouts? wrooong, not power of 2 so glacier will not accept it
byteSize=134217728 # 128MB, power of two, sweet spot to reduce uploading timeouts
View iperf3-speedtest-ssh-tunnel
box1$ cat speedtest-iperf
brainstorm /
Created Sep 1, 2017
Fix KiCAD's pcbnew python scripting support for OSX
# Inspired on:
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/ -iname *.dylib | xargs otool -L | grep executable_path | awk '{print $1}' | awk -F'/' '{print $4}'`
for kicadlib in $KICAD_LIBS_TOFIX;
echo "Fixing ${kicadlib} broken path on pcbnew..."
brainstorm / sigven_pcgr_pod.yml
Created May 18, 2017
Personal Cancer Genome Reporter Kubernetes pod deployment
View sigven_pcgr_pod.yml
apiVersion: v1
kind: Pod
name: pod-pcgr
- name: pcgr
image: sigven/pcgr:0.3.4
View xrandr lenovo x230
# Useless dock, cannot drive 2 monitors and LVDS at once :____(
# 2 invocations because the Intel graphics card can only handle two outputs at a time
xrandr -d :0.0 --output HDMI-2 --auto --primary --output LVDS-1
xrandr -d :0.0 --output HDMI-3 --auto --right-of HDMI-2