Skip to content

Instantly share code, notes, and snippets.

@tzwenn
tzwenn / rapl-read.c
Created May 18, 2022 09:46
Read RAPL energy counters on FreeBSD using direct MSR access
/* Read the RAPL registers on recent (>sandybridge) Intel processors */
/* */
/* MSR Code originally based on a (never made it upstream) linux-kernel */
/* RAPL driver by Zhang Rui <rui.zhang@intel.com> */
/* https://lkml.org/lkml/2011/5/26/93 */
/* Additional contributions by: */
/* Romain Dolbeau -- romain @ dolbeau.org */
/* */
/* Compile with: gcc -O2 -Wall -o rapl-read rapl-read.c -lm */
/* */
@tzwenn
tzwenn / postfixadmin_addalias.sh
Created January 25, 2017 16:41
Postfix Admin: Create a new <foo>@example.com alias to your e-mail address by direct postgres insert over SSH.
#!/bin/bash
DOMAIN=example.com
TARGET=mail@$DOMAIN
SSH_HOST=example.com
SSH_USER=$USER
DBNAME=postfixadmin
@tzwenn
tzwenn / Toolchain-linux-gnu-powerpc64le.cmake
Created April 27, 2016 15:46
cmake-toolchain to cross compile opencv to powerpc64le-linux (coming from os x)
set(CMAKE_SYSTEM_NAME Linux)
# Adapt these to match your setup
set(CROSS_COMPILER_PREFIX /opt/gcc-cross)
set(CROSS_COMPILER_TARGET powerpc64le-linux-gnu)
set(CMAKE_SYSTEM_PROCESSOR powerpc64le)
set(CMAKE_C_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-gcc)
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-g++)
@tzwenn
tzwenn / link_files_from_itunes_list.py
Created March 16, 2015 23:38
Hardlink all files in an exported unicode iTunes playlist into a subfolder.
@tzwenn
tzwenn / rl.rb
Created January 25, 2015 19:32
Homebrew Formula for installing librl (robotics library)
class Rl < Formula
homepage "http://www.roboticslibrary.org"
url "https://github.com/roboticslibrary/rl/archive/0.6.2.tar.gz"
sha1 "b0e40bd06cae2a96f0a517ceaa72fc2237d1620b"
depends_on "cmake" => :build
depends_on "boost"
depends_on "cgal"
depends_on "coin"