Skip to content

Instantly share code, notes, and snippets.

View Apsu's full-sized avatar

Eve Apsu

  • Lambda Labs
  • Pittsburgh, PA
View GitHub Profile
@Apsu
Apsu / sizes.md
Last active November 18, 2016 01:45
Metric PLA Hole Sizes
  • M3 - 2.8mm tight threaded, 3.0mm threaded, 3.3mm clearance
  • M5 - 5.5mm threaded
  • M8 - 8.0mm threaded, 8.5mm shoulder
  • 608 - 22.3mm
  • 2020 - 20.3mm
@Apsu
Apsu / ik.py
Last active October 29, 2016 04:02
Inverse Kinematics for Inverted Cantilever Delta printer
#!/usr/bin/env python
from __future__ import print_function
import math
Motor= ["X", "Y", "Z"] # Motor axes
class Vector:
@Apsu
Apsu / fixmtu.sh
Last active August 26, 2016 18:58
Fix jumbo frame MTUs
#!/usr/bin/env bash
while read line
do
iface=$(cut -d':' -f2 <<< $line | tr -d '[[:space:]]')
mtu=$(sed -nr 's/^.* mtu ([^ ]+) .*$/\1/p' <<< $line)
echo $iface: $mtu
if [[ "$mtu" -eq "8950" ]]
@Apsu
Apsu / change.py
Created June 9, 2016 19:58
SICP Python Conversion
#!/usr/bin/env python
def count_change(amount):
return cc(amount, 5)
def cc(amount, kinds_of_coins):
if(amount == 0):
return 1
@Apsu
Apsu / data.md
Last active October 9, 2015 16:08
Infusion Data Points
@Apsu
Apsu / infuse.py
Last active October 9, 2015 11:13
Destiny Infusion Path Calculator
#!/usr/bin/env python3
import argparse
import functools
import itertools
# Legendary Mark cost per infusion
COST = 3
@Apsu
Apsu / makefloats.sh
Last active September 21, 2015 16:06
Create and associate Neutron floats with Nova instances that do not currently have floats
#!/usr/bin/env bash
if [[ $# -lt 1 ]]
then
echo "Usage: $0 <float_network>"
exit 1
fi
declare -A floats
@Apsu
Apsu / output.txt
Last active September 15, 2015 19:34
PLAY [Test with_items] ********************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [List with dereferencing/without nesting] *******************************
ok: [localhost] => (item=one) => {
"item": "one",
"msg": "one"
}
@Apsu
Apsu / check-veths.sh
Last active December 4, 2015 03:06
Find veth pairs on the host which are not in any running containers
#!/usr/bin/env bash
# Create associative arrays
declare -A interior=()
declare -A exterior=()
# Make sure ethtool is installed on this host
apt-get install -y ethtool &>/dev/null
# For each container
@Apsu
Apsu / fix-veths.sh
Last active February 1, 2018 21:29
Find and fix veth pairs that aren't connected to LXC containers anymore
#!/usr/bin/env bash
# Create associative arrays
declare -A interior=()
declare -A exterior=()
# Make sure ethtool is installed on this host
apt-get install -y ethtool
# For each container