Skip to content

Instantly share code, notes, and snippets.

View machinekoder's full-sized avatar
💻
view-source

Alexander (Rössler) Poss machinekoder

💻
view-source
View GitHub Profile
#!/bin/bash
echo Building Google Protobuf for Mac OS X / iOS.
echo Use 'tail -f build.log' to monitor progress.
(
#PREFIX=`pwd`/protobuf
PREFIX=/opt/protobuf-ios
mkdir ${PREFIX}
mkdir ${PREFIX}/platform
@machinekoder
machinekoder / qt-qml-deploy-note
Last active August 29, 2015 13:59
Deploying Qt/QML Applications
Deploying Qt/QML Applications
-------
A good blog post can be found here:
http://lemirep.wordpress.com/2013/06/01/deploying-qt-applications-on-linux-and-windows-3/comment-page-1/
For Linux note that the run script should use /bin/bash to work properly on Ubuntu. Older distributions may also need libc and gcc libraries deployed.
On Mac OSX deploying applications is really easy using the macdeployment tool. Don't forget to tell it the qml dir.
@machinekoder
machinekoder / slic3r_postprocess.sh
Created April 19, 2014 07:05
Post processing script for Slic3r to work with Machinekit
#!/bin/sh
# convert all E to A axis
sed '/^G/s/ E/ A/' "$1" > "$1post"
rm "$1"
# convert all M106 to B axis
sed '/^M106/s/M106 P/G0 B/' "$1post" > "$1"
rm "$1post"
@machinekoder
machinekoder / qt-sdk-online.sh
Created May 1, 2014 08:26
Download and start latest Qt SDK online installer
#!/bin/bash
HOST=linux-x64
lynx -dump -listonly http://download.qt-project.org/official_releases/online_installers/ | grep "\<http:.*$HOST.*online.run\>" -oh | tail -n 1 | xargs wget
chmod +x qt*$HOST*run
./qt*$HOST*run
@machinekoder
machinekoder / machinekit_install.sh
Last active August 29, 2015 14:03
Installks the latest Machinekit Machinetalk previe on Debina wheezy
#!/bin/bash
sudo sh -c "echo '# Machinekit package archive tracking the master branch\n# From the Dovetail Automata LLC Buildbot\ndeb http://deb.dovetail-automata.com wheezy main\ndeb-src http://deb.dovetail-automata.com wheezy main' >> /etc/apt/sources.list.d/machinekit.list"
sudo sh -c "echo '# Machinekit needs a recent cython from wheezy-backports:\ndeb http://ftp.us.debian.org/debian wheezy-backports main' >> /etc/apt/sources.list.d/wheezy-backports.list"
sudo sed -i '/cdrom/d' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install automake1.11 libtool liburiparser-dev libssl-dev openssl python-setuptools libusb-1.0-0-dev libudev-dev uuid-dev uuid-runtime libavahi-client-dev libavahi-compat-libdnssd-dev avahi-daemon libprotobuf-dev protobuf-compiler python-protobuf libprotoc-dev uuid-runtime python-avahi python-netifaces libxenomai-dev
sudo apt-get install libmodbus-dev libsodium-dev libzmq4-dev libczmq-dev libjansson-dev libwebsockets-dev python-zmq liburiparser-dev
sudo apt-get install -t
@machinekoder
machinekoder / coding_style.el
Last active August 29, 2015 14:19
pycheckers for Emacs
;; Setup flymake for Python
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
@machinekoder
machinekoder / run.py
Created April 30, 2015 16:35
run.py for axis config
#!/usr/bin/python
import sys
import os
import subprocess
import importlib
from machinekit import launcher
from time import *
@machinekoder
machinekoder / hal-mode.el
Created May 6, 2015 21:37
Emacs HAL mode
(require 'generic-x)
(define-generic-mode hal-generic-mode
'("#")
(apply 'append
(mapcar #'(lambda (s) (list (upcase s) (downcase s) (capitalize s)))
'("loadrt" "loadusr" "addf" "setp" "sets" "start"
"newpin" "newcomp" "sete"
"newg" "newsig" "ready" "net" "log")))
'(;;("\\(#<_?[A-Za-z0-9_]+>\\)" (1 font-lock-type-face))
@machinekoder
machinekoder / cos_test.c
Created May 10, 2015 14:26
Quick test for timing behavior of cos C function
/* Program to demonstrate time taken by function cos() */
#include <stdio.h>
#include <time.h>
#include <math.h>
// The main program calls fun() and measures time taken by fun()
int main()
{
// Calculate the time taken by fun()
clock_t start;
#!/bin/bash
echo Building Google Protobuf for Mac OS X / iOS.
echo Use 'tail -f build.log' to monitor progress.
(
VERSION=2.6.1
DARWIN_RELEASE=`uname -r`
CORES=`sysctl hw.ncpu | awk '{print $2}'`
#PREFIX=`pwd`/protobuf