Skip to content

Instantly share code, notes, and snippets.

View foosel's full-sized avatar
🐙
Working full-time on OctoPrint!

Gina Häußge foosel

🐙
Working full-time on OctoPrint!
View GitHub Profile
// ==UserScript==
// @name Soup.io vi keys
// @namespace http://foosel.org/snippets/userscripts
// @include http://*.soup.io/*
// @description Enables jumping from post to post on soup.io by using the vi keys (j for next, k for previous; n and p are supported as well).
// ==/UserScript==
window.addEventListener("keydown", KeyCheck, true);
function scrollDown() {
var postOffset = 50;
@foosel
foosel / README.md
Last active December 18, 2015 09:18
Bus Pirate v3.6 case, created in OpenSCAD

Case for Bus Pirate v3.6 (Dangerous Prototypes/Seeedstudio version)

Case for Bus Pirate v3.6

This is a case for the Bus Pirate v3.6 from Dangerous Prototypes as listed on Thingiverse to be printed on a 3D printer.

In order to compile this file to an STL you'll need OpenSCAD and also the file oshw.scad which you can find here on Thingiverse.

@foosel
foosel / webcamDaemon
Created July 28, 2013 17:44
Adjusted webcamDaemon for OctoPi that does not hang
#!/bin/bash
vcgencmd version
while true; do
if [ "`vcgencmd get_camera`" = "supported=1 detected=1" ]; then
logger "Starting webcam"
pushd /home/pi/mjpg-streamer-experimental
LD_LIBRARY_PATH=. ./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so -d 100"
popd
fi
@foosel
foosel / psu-holder.scad
Created September 16, 2013 16:29
Bracket for mounting the stock PSU that comes with the Ultimaker beneath the printer
psuX=65;
psuY=170;
psuZ=40;
wall=3;
screw=2.8;
earsX=10;
earsY=40;
zBlocker=6;
@foosel
foosel / serial.log
Last active March 3, 2016 08:59 — forked from nophead/serial.log
2014-10-23 16:58:02,141 - SERIAL - DEBUG - Enabling serial logging
2014-10-23 16:58:09,247 - SERIAL - DEBUG - Changing monitoring state from 'Operational' to 'Closed'
2014-10-23 16:58:13,303 - SERIAL - DEBUG - Connection closed, closing down monitor
2014-10-23 16:58:16,878 - SERIAL - DEBUG - Changing monitoring state from 'Offline' to 'Opening serial port'
2014-10-23 16:58:16,883 - SERIAL - DEBUG - Connecting to: /dev/ttyAMA0
2014-10-23 16:58:16,922 - SERIAL - DEBUG - Connected to: Serial<id=0x1ad8fb0, open=True>(port='/dev/ttyAMA0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=20.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2014-10-23 16:58:16,926 - SERIAL - DEBUG - Changing monitoring state from 'Opening serial port' to 'Connecting'
2014-10-23 16:58:36,974 - SERIAL - DEBUG - Send: M105
2014-10-23 16:58:37,000 - SERIAL - DEBUG - Recv: ok T:21.5 /0.0 B:21.1 /0.0 @:0%
2014-10-23 16:58:37,005 - SERIAL - DEBUG - Changing monitoring state from 'Connecting' to 'Operational'
@foosel
foosel / README.md
Last active January 24, 2017 20:14
First experiments with NodeMCU to publish the current settings of my adjustable height working desk to MQTT

First experiments with NodeMCU to publish the current settings of my adjustable height working desk to MQTT.

NodeMCU can be found here: https://github.com/nodemcu/nodemcu-firmware

Note that you'll need a current version with support for floats (which the ultrasonic sensor library utilizes), I'm using 0.9.5 2015-03-18 with float support myself.

Support for the HC-SR04 sensor in NodeMCU can be found here: https://github.com/sza2/node_hcsr04

I provided my slightly adjusted version which makes measuring a non-blocking afair, allowing for callbacks when the measurement completes.

@foosel
foosel / liberapay_per_month.js
Last active December 14, 2017 17:59
Small user script to be used with something like TamperMonkey that will add a tooltip to the "x receives y per week from z patrons" that provides the amount per month. Currently only works with the english locale of liberapay.
// ==UserScript==
// @name Liberapay donations per month
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hovering over the "user receives ... per week from ... patrons" will now show the received amount per month. Currently only works for the english version since it matches the header line via the contained text - couldn't find better attributes for that.
// @author Gina Häußge <osd@foosel.net>
// @match https://liberapay.com/*
// @grant none
// ==/UserScript==
@foosel
foosel / strip_m110_parameter.py
Created January 11, 2018 10:12
OctoPrint plugin that strips any parameters from M110 commands to work around firmware quirks. Manually place in ~/.octoprint/plugins
# coding=utf-8
def strip_M110_parameter(comm_instance, phase, cmd, cmd_type, gcode, subcode=None, *args, **kwargs):
if gcode != "M110":
return
return "M110" # make sure we always just send M110, no N parameters or anything else
__plugin_name__ = "Strip M110 Parameters"
__plugin_description__ = "Strips any parameters from M110 commands to work around firmware quirks"
__plugin_author__ = "Gina Häußge"
@foosel
foosel / README.md
Created March 7, 2017 10:34
OctoPrint settings for BQ Hephestos 2

OctoPrint settings for BQ Hephestos 2

Printer Profile

Print volume:

  • width: 210
  • depth: 297
  • height: 220
@foosel
foosel / Dockerfile
Created May 12, 2019 13:26
Simple Dockerfile & composition to run a speedtest2mqtt setup using speedtest-go from https://github.com/showwin/speedtest-go
FROM alpine:3.7
ADD entrypoint.sh /opt/speedtest2mqtt.sh
COPY speedtest-go /usr/bin/speedtest-go
RUN apk update && \
apk add ca-certificates mosquitto-clients && \
rm -rf /var/cache/apk/* && \
chmod 777 /opt/speedtest2mqtt.sh