Skip to content

Instantly share code, notes, and snippets.

View basilfx's full-sized avatar

Bas Stottelaar basilfx

View GitHub Profile
@basilfx
basilfx / power.py
Created May 7, 2016 08:35
SAJ Solar Inverter query tool
import xmltodict
import requests
import argparse
import urlparse
import sys
__version__ = "1.0.0"
__description__ = "Query tool for SAJ solar inverters"
/*
* Copyright (C) 2016 Bas Stottelaar <[email protected]>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_efm32_common
basilfx:/tmp/ $ fio --randrepeat=1 --ioengine=libaio --direct=1 --name=testingtons --filename=5GBtestfile --bssplit=512/10:4k/60:8k/20:64k/10 --iodepth=64 --size=5G --readwrite=randrw --rwmixread=75
testingtons: (g=0): rw=randrw, bs=512-64K/512-64K/512-64K, ioengine=libaio, iodepth=64
fio-2.2.10
Starting 1 process
testingtons: Laying out IO file(s) (1 file(s) / 5120MB)
Jobs: 1 (f=1): [m(1)] [100.0% done] [27434KB/8754KB/0KB /s] [6773/2281/0 iops] [eta 00m:00s]
testingtons: (groupid=0, jobs=1): err= 0: pid=18494: Sat Oct 8 11:04:04 2016
read : io=3840.5MB, bw=37328KB/s, iops=6506, runt=105353msec
slat (usec): min=1, max=9137, avg= 7.09, stdev=20.97
clat (usec): min=337, max=1557.3K, avg=8176.76, stdev=14901.69
@basilfx
basilfx / example.py
Last active November 17, 2016 19:05
PyOO/Uno: export chart to PNG.
import pyoo
import uno
def export_image(context, element, path):
"""
Export the given element to an image.
"""
manager = context.getServiceManager()
@basilfx
basilfx / httpd-xampp.conf
Created December 22, 2016 15:05
XAMPP + PHP 7.0 FCGI
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
SetEnv PHPRC "\\xampp\\php"
@basilfx
basilfx / CustomEvents.h
Created September 16, 2017 22:03
Repetier Firmware and WS2812B using events
#ifndef CUSTOM_EVENTS_H_INCLUDED
#define CUSTOM_EVENTS_H_INCLUDED
extern void Custom_Initialize();
extern void Custom_Timer100MS();
extern void Custom_SetBedTemp(float temp, bool beep);
extern void Custom_Kill(bool only_steppers);
extern void Custom_JamDetected(int8_t id);
extern void Custom_HeaterDecoupled(int8_t id);
extern void Custom_HeaterDefect(int8_t id);
@basilfx
basilfx / knxd.rb
Last active August 20, 2018 08:58
Homebrew Formula for knxd
class Knxd < Formula
desc "knxd is an advanced router/gateway; it can talk to all known KNX interfaces"
homepage "https://github.com/knxd/knxd"
head "https://github.com/knxd/knxd.git"
url "https://github.com/knxd/knxd/archive/v0.14.17.tar.gz"
sha256 "f1e64fd09a0bfa789e75311d4ac11353ebe83cca49929159f02b9bc41960afdd"
depends_on "argp-standalone" => :build
depends_on "autoconf" => :build
depends_on "automake" => :build
@basilfx
basilfx / config.plist
Created May 7, 2019 16:50
Hackintosh on a HP 800 G1 SFF (macOS 10.14.4)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Fixes</key>
<dict>
package observable
import (
"sync"
"github.com/twinj/uuid"
log "github.com/sirupsen/logrus"
)
@basilfx
basilfx / Dockerfile
Last active October 10, 2022 19:35
Emulated-compilation of Docker images for another target platform with Python packages from source
# syntax=docker/dockerfile:experimental
# Compile all dependencies in a separate build environment. Note that the
# cache is copied to /cache as a final step, because the actual cache folder
# is an external mount.
FROM --platform=$TARGETPLATFORM python:3.8-alpine3.13 as buildenv
COPY requirements_base.txt requirements.txt ./
RUN --mount=type=cache,target=/root/.cache \