Skip to content

Instantly share code, notes, and snippets.

View shift's full-sized avatar

Vincent Palmer shift

  • Berlin, Germany
  • 18:38 (UTC +01:00)
View GitHub Profile
@shift
shift / star.scad
Last active November 15, 2024 00:10
module star_2d(num_points = 5, outer_radius = 10, inner_radius = 4) {
angle = 360 / num_points;
points = [ for (i = [0 : num_points - 1]) [
outer_radius * cos(i * angle),
outer_radius * sin(i * angle)
] ];
inner_points = [ for (i = [0 : num_points - 1]) [
inner_radius * cos(i * angle + angle),
inner_radius * sin(i * angle + angle)
] ];
@shift
shift / knot-odhcpd-dynamic-updates.sh
Last active April 6, 2024 09:20
Enables knotd+kresd to serve as a replacement for DNSmasq and still retain the dynamic DNS updates from DHCPv4 & DHCPv6 leases.
#!/bin/sh
# Configuration
lease_file='/tmp/hosts/odhcpd'
forward_zone='ber.section.me.'
reverse_zone_ipv4='1.168.192.in-addr.arpa.'
reverse_zone_ipv6='f.d.0.5.0.7.4.0.1.0.0.2.ip6.arpa.'
# Function for code reusability and readability
expand_ipv6() {
# Flake sops-nix
https://github.com/Mic92/sops-nix#usage-example explains how to setup the keys in the `.sops.yaml` file.
If using JSON add the following step below, if YAML, you can already nest things and goto adding the module.
Add
```
sops-nix.url = "github:juspay/sops-nix/json-nested"; # https://github.com/Mic92/sops-nix/pull/328
```
To your inputs.
@shift
shift / flake.nix
Created February 1, 2024 11:45
esp flake.nix/shell.nix
{
description = "shift's esphome-devices.";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
@shift
shift / flake.nix
Last active January 8, 2024 16:33
Very bare flake example using the image builder for the dynalink_dl-wrx36 access point.
{
inputs = {
openwrt-imagebuilder.url = "github:astro/nix-openwrt-imagebuilder";
};
outputs = { self, nixpkgs, openwrt-imagebuilder }: {
packages.x86_64-linux.ap1 =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
profiles = openwrt-imagebuilder.lib.profiles { inherit pkgs; };
https://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/iso/latest/archlinux-x86_64.iso
@shift
shift / output.log
Last active January 7, 2023 19:46
The output from OpenOCD flashing Klipper onto a SKR Pico board.
pi@dio-print:~/klipper $ openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "program out/klipper.elf verify reset exit"
Open On-Chip Debugger 0.11.0-g4f2ae61-dirty (2023-01-07-19:39)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
@shift
shift / afterburner
Created May 22, 2021 06:27
Extruders Klipper
microsteps: 128
full_steps_per_rotation: 200
rotation_distance: 7.68
run_current: .5
hold_current: 0.4
@shift
shift / gist:0cebeff20228ed3e79115f302235be4a
Created May 8, 2021 15:17
klipper arduino nano flashing command
avrdude -patmega328p -c arduino -b 57600 -P /dev/ttyUSB0 -v -D -Uflash:w:out/klipper.elf.hex:i
# generated by SuperSlicer 2.3.55 on 2020-12-27 at 18:45:50 UTC
[print:0.2mm]
allow_empty_layers = 0
avoid_crossing_not_first_layer = 1
avoid_crossing_perimeters = 0
bottom_fill_pattern = monotonic
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
bridge_acceleration = 0