Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
I'm probably coding.

Alexander Rössler machinekoder

💻
I'm probably coding.
View GitHub Profile
@machinekoder
machinekoder / fix_rosinstall.py
Created Feb 7, 2019
Fix .rosinstall file for the time the GitHub is around (see https://github.com/vcstools/vcstools/issues/147)
View fix_rosinstall.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shutil
import sys
import tarfile
import tempfile
from sh import wget
import os
import yaml
@machinekoder
machinekoder / SimpleTweak.py
Created Dec 3, 2018
Cura PostProcessingPlugin for my 3D printer
View SimpleTweak.py
from ..Script import Script
class SimpleTweak(Script):
def __init__(self):
super().__init__()
def getSettingDataString(self):
return """{
"name":"SimpleTweak (for Alex Uni-Print-3D)",
"key": "SimpleTweak",
"metadata":{},
View btrfs_cleanup.sh
sudo su
service docker stop
ls -d -1 /var/lib/docker/btrfs/subvolumes/* | xargs btrfs subvolume delete
rm -rf /var/lib/docker
@machinekoder
machinekoder / rc_servo_machinekit.py
Last active Aug 22, 2018
Controlling an RC servo with Machinekit (untested)
View rc_servo_machinekit.py
# Turn commanded position -5 to +5 into 1-2 mS pulse for RC (hobby) servo
# gain = 1 mS (range) / 50 mS (PWM period) / 10 (units)= 0.002
# offset = 1.5 mS (value) / 50 mS (PWM period) = 0.03
# Resulting PWM values should be between 0.02 and 0.04, representing a
# 1 mS to 2 mS wide pulse
def rc_servo(thread, name, range_ms, offset_ms, period_ms, min_step, max_step, in_signal, out_signal):
gain = range_ms / pwm_ms / (max_step - min_step)
offset = value_ms / pwm_ms
@machinekoder
machinekoder / ros-bb-stretch.sh
Last active Jan 21, 2019 — forked from mhaberler/ros-bb-jessie.sh
installing ROS kinetic ROS-comm on beaglebone stretch
View ros-bb-stretch.sh
# derived from http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20Raspberry%20Pi
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu stretch main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
@machinekoder
machinekoder / Hotspot
Created Jun 7, 2018
place in /etc/NetworkManager/system-connections/ to create a AP hotspot under Linux
View Hotspot
[connection]
id=Hotspot
uuid=bd4058b4-f99e-48f9-ac88-26513b9ac517
type=wifi
autoconnect=true
permissions=
[wifi]
hidden=false
mac-address=00:0F:60:06:EE:BE
@machinekoder
machinekoder / dxf_postpro.cfg
Created Mar 27, 2018
DXF Postprocessor for Dxf2GCode
View dxf_postpro.cfg
[Number format]
post_decimals = 3
pre_decimal_zero_padding = 0
signed_values = 0
pre_decimals = 4
decimal_seperator = .
post_decimal_zero_padding = 1
[Program]
cutter_comp_left =
View gdrive_download.sh
#!/usr/bin/env bash
fileid="$1"
destination="$2"
# try to download the file
curl -c /tmp/cookie -L -o /tmp/probe.bin "https://drive.google.com/uc?export=download&id=${fileid}"
probeSize=`du -b /tmp/probe.bin | cut -f1`
# did we get a virus message?
# this will be the first line we get when trying to retrive a large file
View gdrive_download.py
import requests
def download_file_from_google_drive(id, destination):
def get_confirm_token(response):
for key, value in response.cookies.items():
if key.startswith('download_warning'):
return value
return None
View PIN_7I76x1D_UART_34.vhd
library IEEE;
use IEEE.std_logic_1164.all; -- defines std_logic types
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Copyright (C) 2007, Peter C. Wallace, Mesa Electronics
-- http://www.mesanet.com
--
-- This program is is licensed under a disjunctive dual license giving you
-- the choice of one of the two following sets of free software/open source
You can’t perform that action at this time.