Skip to content

Instantly share code, notes, and snippets.

@jhgorse
jhgorse / mono_4x_master_check_fail.log
Created April 19, 2022 15:30
mono 4x master make check failure
Failed test(s):
merp-crash-test.exe
=============== merp-crash-test.exe.stdout ===============
Running MerpCrashManaged
MONO_PATH=/Users/jhg/Work/mono/mcs/class/lib/net_4_x /Users/jhg/Work/mono/mono/mini/mono-sgen merp-crash-test.exe 0
=================================================================
Native Crash Reporting
=================================================================
From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 19 Feb 2016 22:13:29 +0000 (+0000)
Subject: 2016-02-19 Jakub Jelinek <jakub@redhat.com>
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=ec1cc0263f156f70693a62cf17b254a0029f4852
2016-02-19 Jakub Jelinek <jakub@redhat.com>
Bernd Edlinger <bernd.edlinger@hotmail.de>
* Make-lang.in: Invoke gperf with -L C++.
* cfns.gperf: Remove prototypes for hash and libc_name_p
@jhgorse
jhgorse / screen_serial_poll.sh
Last active December 19, 2021 23:44
Poll serial device at 2 Hz write/read using Bash, Screen, bc
#!/bin/bash
set -x # debug
# This polls the windows serial device over screen(1) connection
# with one command and one response.
# Clean the data point, print to stdout and log it to LOGFILE.
# Uses named pipe, unix fifo, attached to bash fd 4 to take the serial data.
if [[ "Darwin" != $(uname) ]]; then # windows
@jhgorse
jhgorse / play_time.cpp
Last active December 20, 2021 23:22
make time locale work on windows wsl, macOS, and linux
// 2021 JHG
// BSD 2 clause. Go nuts.
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <assert.h>
#if defined(_WIN32) || defined(WIN32)
#include <windows.h>
@jhgorse
jhgorse / pbf2csv.c
Created September 9, 2021 04:35
output power details to csv
// 2csv in c
// (C) 2021 Joe Gorse
// BSD 3 Clause
#include <stdio.h>
#include <string.h>
#include <assert.h>
// #include <printf.h>
// #include <stdint.h>
@jhgorse
jhgorse / pbf2csv.pl
Last active September 9, 2021 04:34
output power details to csv
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
my @a;
my $ts;
my $count;
#!/usr/bin/env python
# 2016
from hidapi import hidapi
from elftools.elf.elffile import ELFFile
import ctypes, time, sys
# Open device
@jhgorse
jhgorse / fifo_fun.c
Created December 19, 2019 20:21
fifo fum
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
#include <limits.h>
#include "comms_layer.h"
#define MAX_BUFFER_LENGTH 2 //135
#define MAX_TX_FIFO_LENGTH (MAX_BUFFER_LENGTH * 3)
@jhgorse
jhgorse / openvpn_client_instructions_connman
Last active June 14, 2019 04:17
OpenElec/OSMC/etc ConnMan + OpenVPN client
# Resolve by hack ConnMan + OpenVPN Client inability to add/del default route
# TODO: Get this packaged for upstream somewhere OpenVPN, ConnMan, OSMC, *Elec
# perhaps with systemd after openvpn goes up.
### Example output of openvpn client:
# Fri Jun 14 00:04:39 2019 /sbin/ip route add 0.0.0.0/0 via 192.168.xxx.1
# RTNETLINK answers: File exists
# Fri Jun 14 00:04:39 2019 ERROR: Linux route add command failed: external program exited with error status: 2
FROM ubuntu:16.04
# Install build dependencies (and vim for editing)
RUN apt-get -qq update \
&& apt-get install -y git build-essential wget make libncurses-dev flex bison gperf python python-serial python-dev libssl-dev libffi-dev vim \
&& apt-get clean \
&& wget https://bootstrap.pypa.io/get-pip.py \
&& python get-pip.py \
&& ln -s /usr/local/bin/pip /usr/bin/pip \
&& pip install --upgrade setuptools\