Skip to content

Instantly share code, notes, and snippets.

View basilfx's full-sized avatar

Bas Stottelaar basilfx

View GitHub Profile
@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 / 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:/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
/*
* 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
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"
@basilfx
basilfx / install.sh
Created March 11, 2016 07:52
Eclipse with CDT + ARM plugin
#!/bin/bash
wget -O "/tmp/eclipse.tar.gz" "http://ftp.snt.utwente.nl/pub/software/eclipse//technology/epp/downloads/release/mars/2/eclipse-java-mars-2-linux-gtk-x86_64.tar.gz"
wget -O "/tmp/cdt-plugin.zip" "http://ftp.snt.utwente.nl/pub/software/eclipse//tools/cdt/releases/8.8.1/cdt-8.8.1.zip"
wget -O "/tmp/arm-plugin.zip" "https://github.com/gnuarmeclipse/plug-ins/releases/download/v2.11.3-201602101653/ilg.gnuarmeclipse.repository-2.11.3-201602101653.zip"
tar xvf "/tmp/eclipse.tar.gz" -C "/opt"
unzip "/tmp/cdt-plugin.zip" -d "/tmp/cdt-plugin"
unzip "/tmp/arm-plugin.zip" -d "/tmp/arm-plugin"
@basilfx
basilfx / em_rtcc_utils.h
Last active January 23, 2016 12:41
EFM32 Gemstone RTCC conversion macros
#ifndef __SILICON_LABS_EM_RTCC_UTILS_H__
#define __SILICON_LABS_EM_RTCC_UTILS_H__
#include "em_device.h"
#if defined( RTCC_COUNT ) && ( RTCC_COUNT == 1 )
#ifdef __cplusplus
extern "C" {
#endif
<?xml version="1.0" encoding="UTF-8"?><cdtprojectproperties>
<!-- Automatically generated from make eclipsesym -->
<!--
Instrucions:
In Eclipse:
1. Open the project properties, menu Project->Properties
2. Select C/C++ General->Paths and Symbols
2a. (optional) Click Restore Defaults to delete any existing macros and include paths
@basilfx
basilfx / README.md
Last active May 21, 2023 06:01
OctoPi to Read-only

OctoPi to Read-only

These steps will provide a read-only OctoPi installation while still having a read/write home directory. In other words, as long as you don't have to update system files, this installation will be fully functional.

  • Install OctoPi on a 8GB (or more) SD card and boot it at least once.
  • Mount it with a Linux machine (e.g. Ubuntu).
  • Use sudo gparted and configure the remaining space as EXT4.
  • There are now three partitions. Mount the last two.
  • Move /home/pi to the new and empty partition.
  • Edit /etc/fstab:
@basilfx
basilfx / convert.py
Created November 16, 2015 21:07
Initialize EFM32 targets.
import shutil
import glob
import sys
import os
import re
# This file contains all templates for files
import templates