Skip to content

Instantly share code, notes, and snippets.

@Bouni
Bouni / SoftSerialTest.cpp
Last active August 29, 2015 14:21
BufferedSoftSerial issue
// SerialTestControl.h
#ifndef SERIAL_TEST_MODULE_H
#define SERIAL_TEST_MODULE_H
#include "SpindleControl.h"
class BufferedSoftSerial;
// This module implements closed loop PID control for spindle RPM.
@Bouni
Bouni / ulogger.c
Created June 13, 2015 21:24
ulogger
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#define TEMPERATUR PF0
#define BUTTON PF1
@Bouni
Bouni / BeagleBoneGreen RS485.py
Last active November 12, 2018 15:48
Get RS485 on a BeagleBoneGreen + Waveshare CAN RS485 CAPE up and running
import serial, fcntl, struct
#inspired by http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-communication.html
#enable ttyO4 by editing /boot/uEnv.txt:
#cape_enable=capemgr.enable_partno=BB-UART4
# RX and TX Jumpers on the Waveshare Cape are set to UART4
# A jumper wire is connected from P9_15 to RSE (middle pin of the three)
@Bouni
Bouni / init.vim
Created March 21, 2017 19:58 — forked from samuelb/init.vim
" ~/.config/nvim/init.vim
"
" After add / remove Plugins, run :PlugInstall / :PlugClean
if has('nvim')
let $VIMHOME = '~/.config/nvim'
else
let $VIMHOME = '~/.vim'
endif
@Bouni
Bouni / .xinitrc
Created January 29, 2018 15:17
.xinitrc for alarmmonitor
# don't turn off display
xset dpms 0 0 0
xset -dpms
xset s noblank
xset s off
# simple fullscreen wm
matchbox-window-manager -use_cursor no -use_titlebar no &
# start VNC client
@Bouni
Bouni / xinit-login.service
Created January 29, 2018 15:35
xinit-login.service
[Unit]
After=systemd-user-sessions.service
[Service]
ExecStart=/bin/su pi -l -c /usr/bin/xinit -- VT08
Restart=always
[Install]
WantedBy=multi-user.target
@Bouni
Bouni / cec-on.sh
Created January 29, 2018 15:38
CEC script for turning TV on
#!/bin/sh
# Turn TV on using CEC
echo "on 0" | cec-client -s -d 1
@Bouni
Bouni / cec-off.sh
Created January 29, 2018 15:38
CEC script for turning TV off (standby)
#!/bin/sh
# Turn TV off (standby) using CEC
echo "standby 0" | cec-client -s -d 1
@Bouni
Bouni / gist:4405ead83596aa0d8581b7abdcaa247c
Created February 4, 2018 12:49 — forked from dbrgn/gist:8243aaaa0a0e47eda094
Mikrotik RouterOS: Block DNS lookups for names containing "samsung"
/ip firewall filter add
chain=input
action=drop
comment="deny DNS resolution containing 'samsung' from SmartTV"
protocol=udp dst-port=53
content="samsung"
src-mac-address=<smartv-mac-addr>
/ip firewall filter add
chain=forward
action=drop
@Bouni
Bouni / gist:e17cad0b913b83f30c67fd3660d2893e
Created April 19, 2018 11:12
FMS32Pro to Feuersoftware Connect
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import os
import socket
import requests
import json
from datetime import datetime as dt
class ConnectAPI: