Skip to content

Instantly share code, notes, and snippets.

Michael Haberler mhaberler

View GitHub Profile
mhaberler /
Last active Jun 27, 2016
running jekyll-asciidoctor with LiveReload on change

The website is formatted with the docker-jekyll-asciidoctor docker image.

to run this locally "at home":

  • install docker - see
  • pull the image from dockerhub: docker pull haberlerm/docker-jekyll-asciidoctor
  • review and run the script in the toplevel directory of your website
  • review the values in config_preview.yml which were generated by the first run
  • run again, let it run to completion for the initial format of the whole site which can take 10-15mins
  • stop with ^C and run it again, it will start with --incremental --skip-initial-build for quick startup since the _site directory already exists
mhaberler /
Last active Mar 16, 2020
Installing the Machinekit Altera CycloneV test image


This SD image is a debian jessie console image with:

  • a 4.1.22-ltsi-rt kernel with RT-PREEMPT patches applied
  • tested on Terasic DE0-Nano-SoC Kit, other SoCKit platforms should work with appropriate dtb
  • machinekit RIP-build under /home/machinekit/machinekit, all build artefacts are in place (no need to run make)
  • machinekit packages are NOT installed and you do not have to!
  • all machinekit build- and runtime required packages ARE installed.
  • /home/machinekit/.bashrc already set up to run machinekit from the RIP build directory.
  • one known-to-work configuration with hostmot2/onboard FPGA support is: machinekit/configs/hm2-soc-stepper/5i25-socfpga.ini
mhaberler / blinkenleds.hal
Last active Apr 24, 2016
Blinkenleds with hm2_soc driver
View blinkenleds.hal
loadrt hostmot2
loadrt hm2_soc config="firmware=socfpga/soc_system.rbf num_encoders=2 num_pwmgens=2 num_stepgens=2"
newthread servo-thread 1000000 fp
newthread slow 1000000000 fp # 1sec
# task1: blink the leds CR01 and CR02
newinst not osci
newinst not inverter
mhaberler /
Created Jan 5, 2016
installing ROS indigo ROS-comm on beaglebone jessie
# derived from
sudo sh -c 'echo "deb jessie main" > /etc/apt/sources.list.d/ros-latest.list'
wget -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
mhaberler / ptpd
Last active Aug 27, 2019
ptpd (Precision Time Protocol) config files for debian
View ptpd
# /etc/default/ptpd
# Set to "yes" to actually start ptpd automatically
# Add command line options for ptpd
PTPD_OPTS="-c /etc/ptpd.conf"
mhaberler / Makefile
Created Jul 30, 2015
see what gcc and c++ generate for atomic builtins (NOT std::atomic)
View Makefile
all: atomic-c++.s atomic-c.s atomic-c++ atomic-c
rm -f atomic-c++.s atomic-c.s atomic-c++ atomic-c
atomic-c++.s: atomic.c
gcc -x c++ -std=c++11 -Wa,-adhln -g $^ > $@
atomic-c++: atomic.c
gcc -x c++ -std=c++11 -g $^ -o $@
mhaberler / 90-slcan.rules
Created May 3, 2015
making USBtin work with wheezy boot-time
View 90-slcan.rules
# add this file to /etc/udev/rules.d:
# 04d8:000a USBtin
KERNEL=="ttyACM*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a",SYMLINK+="USBtin%n" ,RUN+="/usr/local/bin/ /dev/%k can%n"
mhaberler / README.vcan
Last active Aug 29, 2015
setting up vcan (virtual can interface - loopback) in wheezy
View README.vcan
# in /etc/modules add
so the vcan module is loaded at boot
# in /etc/rc.local, add
ip link add dev vcan0 type vcan
ip link set up vcan0
mhaberler / lutn-demo.hal
Last active Aug 29, 2015
instantiable HAL component - finalized API
View lutn-demo.hal
newsig in0 bit
newsig in1 bit
loadrt lutn
newinst lutn or2.0 inputs=2 function=0xe
newinst lutn and2.0 inputs=2 function=0x8
net in0 and2.0.in0 or2.0.in0
net in1 and2.0.in1 or2.0.in1
mhaberler /
Last active Aug 29, 2015
example linuxcncrsh - style command interpreter using the Python cmd2 module
# you might have to:
# sudo easy_install cmd2 readline
# or the equivalent debian incantations, whatever they are
from cmd2 import Cmd
import linuxcnc
class MachinekitApp(Cmd):
def __init__(self):
You can’t perform that action at this time.