Skip to content

Instantly share code, notes, and snippets.

View symmetryninja's full-sized avatar

Adam Purdie symmetryninja

  • Melbourne
View GitHub Profile
@symmetryninja
symmetryninja / gist:e5860af663653859809d7fefe284a33f
Created April 1, 2021 04:22
Start/stop scripts - for 3d printer with bl-touch
; Start script
G28 ; Home all axes
G29 ; 9 point measure
G0 X5 Y15 F9000 ; Go to front
G0 Z0.3 ; Drop to bed
G92 E0 ; Zero the extruded length
G1 X50 E20 F300 ; Extrude 20mm of filament in a 50mm line
G92 E0 ; Zero the extruded length
G1 E-3 F500 ; Retract a little
G1 X80 F4000 ; Quickly wipe away from the filament line

Setting up WSL v1 to linux on windows

THIS IS A WIP

Install WSL and fix pathing

Install Ubuntu from the microsoft app store.

There's some weird things with pathing, by default, all drives including C are mounted in /mnt but for docker (and other things) to play nice we need to change c to be mounted in / - edit the /etc/wsl.conf (sudo)

@symmetryninja
symmetryninja / mywsl.md
Last active July 27, 2020 12:56
A basic howto for of the WSL setup I have now that I have no Apple products.

Setting up WSL v2 to do some linux on windows

This is a constant work in progress.

Why Windows with WSL

Because I became so accustom to having bash behind my VSCode app to run linux-like commands on my MacBookPro and now that I don't have or want another MacBook variant, I want to be able to have a linux-like command system behind visual studio code.

Why not just use linux? Because I use a lot of apps that don't run on linux.

// note PI10 is a constant with pi to ten places
void ikTrippleAngle(double targetX, double targetY, double targetZ) {
double legLengthXY, legLength, base, lift, reach;
// determining the leglengths is our first hurdle
legLengthXY = sqrt(sq(targetX) + sq(targetY)); // view from the top
legLength = sqrt(sq(legLengthXY) + sq(targetZ)); // view from the side
// base rotation
base = atan(targetY/targetX) * 180/PI10;
// note PI10 is a constant with pi to ten places
void ikDualAngle(double targetX, double targetY, double targetZ) {
double legLength, base, lift, reach;
// leglength is our first hurdle
legLength = sqrt(sq(targetX) + sq(targetZ));
// base rotation -- not working on this yet - set it to zero
base = 0;