Skip to content

Instantly share code, notes, and snippets.

View lorenzhs's full-sized avatar

Lorenz Hübschle lorenzhs

View GitHub Profile
@lorenzhs
lorenzhs / numa_array.hpp
Last active February 8, 2021 22:30
Arrays that are transparently distributed onto multiple NUMA nodes using Silo (https://github.com/stanford-mast/Silo) and make use of transparent hugepages, with a fallback for non-NUMA systems
/*******************************************************************************
* numa_array.hpp
*
* Arrays that are transparently distributed onto multiple NUMA nodes using Silo
* (https://github.com/stanford-mast/Silo) and make use of transparent huge
* pages, with a fallback for non-NUMA systems
*
* Copyright (C) 2018 Lorenz Hübschle-Schneider <lorenz@4z2.de>
*
* All rights reserved. Published under the BSD-2 license.
@lorenzhs
lorenzhs / ox-bibtex-example.txt
Last active July 9, 2018 08:58
Example of using ox-bib
#+TITLE: Org Bibtex Example
#+AUTHOR: Lorenz Hübschle-Schneider
#+OPTIONS: toc:nil
#+OPTIONS: ':t
* Introduction
Citing is as easy as inserting a reference: [[cite:BoundedDiff1989]]
Using =ox-extra='s =:ignore:= property allows using an unnumbered bibliography
@lorenzhs
lorenzhs / tweetscam.py
Last active September 17, 2018 06:20
Twitter cryptoscam detection proof of concept. https://twitter.com/TinkerSec/status/961233575516389376
#!/usr/bin/env python3
# encoding: utf-8
# author: Lorenz Hübschle-Schneider
# This is really really simple. Twitter, you have no excuse for not doing something like this!
import codecs
import json
import re
from unicodedata import normalize
@lorenzhs
lorenzhs / proposal.md
Last active September 30, 2016 08:03
A proposal for better static polymorphism in C++
@lorenzhs
lorenzhs / just_let_me_select_a_language,_github.cpp
Created August 12, 2016 09:28
ICC double free or corruption
Reading symbols from /opt/intel/compilers_and_libraries_2016.3.210/linux/bin/intel64/icc...(no debugging symbols found)...done.
[New LWP 31279]
[New LWP 31303]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `icc -std=c++14 -Wall -Wextra -Werror -g -IDistributedSampling/lib -IDistributed`.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f5f5a2f31c8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5f5b7aa740 (LWP 31279))]
@lorenzhs
lorenzhs / style.css
Created February 16, 2016 19:19
Glowing Bear unread count style
/* adapted from https://github.com/20after4/glowing-bear/commit/931eb1166a2de2a1f0dd196e6ebca63920c7e432 */
#sidebar .badge {
border-radius: 5px;
padding: 3px 5px;
border: 1px inset rgba(20,40,60,0.4);
box-shadow: none;
}
// File needs to be stored in the root of the app.
this.addEventListener('install', function(event) {
event.waitUntil(
caches.open('v1').then(function(cache) {
return cache.addAll([
'/assets/img/favicon.png',
'/assets/img/glowing_bear_128x128.png',
'/assets/img/glowing-bear.svg',
'/assets/img/badge_playstore.png',
#include <boost/mpi.hpp>
/*
* Example how boost::mpi::broadcast could be implemented efficiently for types
* that need to be serialized, without falling back to Point-to-Point communication
*
* Lorenz Hübschle-Schneider, 2015
* Distributed under the Boost Software License, Version 1.0
*/
@lorenzhs
lorenzhs / unsafe_mpi.hpp
Last active March 1, 2016 21:31
Unsafe boost::mpi things
#pragma once
// Copyright (C) 2015 Lorenz Hübschle-Schneider <lorenz@4z2.de>
// MIT License
#include <cstdint>
#include <type_traits>
#include <vector>
#include <boost/mpi.hpp>
@lorenzhs
lorenzhs / 20-thinkpad-keyboard.conf
Created August 18, 2015 15:18
X11 ThinkPad USB Keyboard config with right click scroll
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|ThinkPad Compact USB Keyboard with TrackPoint|USB Trackpoint pointing device"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "3"
Option "EmulateWheelTimeout" "150"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"