Skip to content

Instantly share code, notes, and snippets.

View rubeniskov's full-sized avatar
:octocat:
decrypting matrix

Rubén López Gómez rubeniskov

:octocat:
decrypting matrix
View GitHub Profile
@rubeniskov
rubeniskov / arm-none-eabi-gdb_openocd.sh
Created October 21, 2020 18:39
arm-none-eabi-gdb +openocd
arm-none-eabi-gdb \
-iex 'target extended | openocd \
--debug \
-f interface/stlink.cfg \
-f target/stm32f1x.cfg \
-c "gdb_port pipe"' \
-iex 'mon halt' \
-iex 'mon tpiu config internal swo.log uart false 2000000' \
-iex 'shell bash -m -c "orbuculum -f swo.log &"' \
-iex "file $(pwd)/ucm.elf" \
@rubeniskov
rubeniskov / missing_flag_declaration.patch
Created October 20, 2020 13:54
orbuculum_missing_flag_declaration.patch
diff --git a/Src/orbuculum.c b/Src/orbuculum.c
index 36bf17d..29cdd20 100644
--- a/Src/orbuculum.c
+++ b/Src/orbuculum.c
@@ -1542,7 +1542,7 @@ int setSerialConfig ( int f, speed_t speed )
// ====================================================================================================
int serialFeeder( void )
{
- int f, ret;
+ int f, flag, ret;
@rubeniskov
rubeniskov / recterm
Last active October 12, 2020 02:21
Save the terminal session to gif
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo -ne >&2 "Name of capture file required $0 <file>\n"
exit 1
fi
asciinema rec $1.json
docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 -t solarized-dark $1.json $1.gif
open $1.gif
@rubeniskov
rubeniskov / index.js
Last active June 3, 2020 16:31
email_list_from_location
#!/usr/bin/env node
const util = require("util");
const yargs = require("yargs");
const request = util.promisify(require("request"));
const puppeteer = require("puppeteer");
const fs = require("fs");
const delayMs = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const getContent = (page, url) =>
@rubeniskov
rubeniskov / semver-patcher.py
Last active May 14, 2022 17:03
Create a unified diff patch, changing the version of the config files that are most commonly used in package manager
#!/usr/bin/env python
from __future__ import print_function
import os, getopt, sys, re, difflib, io, itertools, sys, time
# Globals vars
__VERBOSE__ = False
__VERSION__ = "0.0.1"
def eprint(*args, **kwargs):
@rubeniskov
rubeniskov / semver-git.py
Last active May 14, 2022 17:03
Guess the version using the git history message commits as a reference
#!/usr/bin/env python
from __future__ import print_function
import os, getopt, sys, re, sys, time
# Globals vars
__VERBOSE__ = False
__VERSION__ = "0.0.2"
# Default vars
@rubeniskov
rubeniskov / addTwo.wast
Created April 11, 2020 14:29 — forked from kanaka/addTwo.wast
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
echo "Hola mundo" $@
@rubeniskov
rubeniskov / lot.sh
Last active September 29, 2022 00:39
exec_remote() { wget -q -O- "$1" | bash -s "${@:2}"; }
cache_remote() { bn=`[ -n "$2" ] && echo "$2" || basename "$1"`; td=`echo /tmp/test`; mkdir -p $td; fn=$td/$bn; [ -f $fn ] || wget -q -O- "$1" > $fn; chmod +x $fn; echo $fn;}
import_remote() { cn=`cache_remote "$@"`; bn=`basename $cn`; fn="${bn%.*}"; eval "$fn() { bash -e $cn "\$@"; }"; }
alias resolve-gist-url='exec_remote https://bit.ly/2JGtC2R'
alias import='import_remote'
tempfoo=`basename $0`
TMPFILE=`mktemp /tmp/${tempfoo}` || exit 1
filename=$TMPFILE/$(basename "$(1)")
wget -q -O- $(0) > $filename
echo $filename`