Skip to content

Instantly share code, notes, and snippets.

View simonbogh's full-sized avatar
🚀

simonbogh

🚀
View GitHub Profile
@simonbogh
simonbogh / printer.cfg
Created March 25, 2024 07:43
My Creality CR-10 S5 klipper printer settings for OctoPrint
# This file contains pin mappings for the Creality CR-10 S5. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
@simonbogh
simonbogh / install_ros_noetic.sh
Last active March 19, 2024 10:55
One-click install of ROS Noetic on Ubuntu 20.04
#!/bin/bash
# Author: Simon Bøgh
# Year: 2024
# Run the script:
# chmod +x install_ros_noetic.sh
# ./install_ros_noetic.sh
echo "###################################################"
@simonbogh
simonbogh / convert_video_speed.py
Last active December 23, 2023 22:51
Python script that uses ffmpeg to change the speed of a video-file
import os
import subprocess
import argparse
"""
This script uses ffmpeg to change the playback speed of an MKV file
and save it as an MP4 file with a watermark. The user must provide the
name of the input MKV file and the playback speed as command line
arguments when running the script.
@simonbogh
simonbogh / inertia_matrix.py
Last active July 25, 2024 08:16 — forked from awesomebytes/inertia_matrix.py
Compute inertia matrix for simple solids: cube, sphere and cylinder
#/usr/bin/env python
# Based on:
# http://mathworld.wolfram.com/MomentofInertia.html
def get_cube_inertia_matrix(mass, x, y, z):
"""Given mass and dimensions of a cube return intertia matrix.
:return: ixx, ixy, ixz, ixy, iyy, iyz, ixz, iyz, izz
From https://www.wolframalpha.com/input/?i=moment+of+inertia+cube"""