Skip to content

Instantly share code, notes, and snippets.

View tschoonj's full-sized avatar

Tom Schoonjans tschoonj

View GitHub Profile
@tschoonj
tschoonj / test-ceph-bucket-monitoring.py
Last active December 1, 2022 22:22
Monitor Ceph S3 buckets for new files from Python with boto3 and pika
import os
import boto3
from botocore.client import Config
import sys
import string
import random
import logging
import time
import json
import urllib
@tschoonj
tschoonj / test-aws-bucket-monitoring.py
Last active February 25, 2022 10:14
Monitor AWS S3 buckets for new files from Python with boto3
import boto3
import os
import sys
import string
import random
import logging
import time
import json
import urllib
from threading import Thread
# escape=`
FROM buildtools2019:latest
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
# Download the Miniconda installer
ADD https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe C:\TEMP\miniconda.exe
@tschoonj
tschoonj / # meson - 2019-09-15_16-55-59.txt
Created October 8, 2019 13:42
meson on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for meson on macOS 10.13.6
Build date: 2019-09-15 16:55:59
@tschoonj
tschoonj / ax_check_cuda.m4
Created May 10, 2014 14:56
gists for blogpost on cuda device library
#####
#
# SYNOPSIS
#
# AX_CHECK_CUDA
#
# DESCRIPTION
#
# Figures out if CUDA Driver API/nvcc is available, i.e. existence of:
# cuda.h
@tschoonj
tschoonj / xraylib_np.c
Created December 12, 2016 11:57
Cython clang issue
This file has been truncated, but you can view the full file.
/* Generated by Cython 0.25.2 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
#error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
@tschoonj
tschoonj / Recipe
Created November 25, 2016 15:51
DAWN Linux AppImage Recipe
#!/bin/bash
APP="DawnDiamond"
VERSION="2.3.0.v20161123-1546"
rm -rf $APP/$APP.AppDir
rm -rf out
mkdir -p $APP
@tschoonj
tschoonj / github-updater.c
Created July 8, 2013 18:34
Some code I wrote to have my software package XMI-MSIM check on github for available updates, by looking if git tags were pushed to the repository and comparing the version numbers
#include <curl/curl.h>
#include <json-glib/json-glib.h>
#include <string.h>
#include <stdlib.h>
/*
*
* This code allows for the checking of available updates by parsing the JSON output obtained
* through requesting the tags from the GitHub repo of XMI-MSIM
#python bindings will only be built if all buildtools are available, hence the following automake conditional
if ENABLE_PYTHON
#our python extension module
pyexec_LTLIBRARIES = _mytest.la
_mytest_la_CFLAGS = $(PYTHON_CFLAGS) -I$(top_srcdir)/include $(PYTHON_CPPFLAGS)
#link to the C-library
#probably on Windows one will need to link against the python dll as well
_mytest_la_LIBADD = ../src/mytest.la
#the source code for our extensions module
#nodist because this file will be generated by swig
@tschoonj
tschoonj / gtkextra-print-export.c
Last active December 20, 2015 00:19
gtkextra3 example that demonstrates how the plot canvas can be exported or printed
/*
* compile with gcc -o gtkextra-print-export `pkg-config --cflags gtkextra-3.0` gtkextra-print-export.c `pkg-config --libs gtkextra-3.0`
*/
#include <gtkextra/gtkextra.h>
#include <cairo-ps.h>
#include <cairo-pdf.h>
#include <math.h>
#include <string.h>