Skip to content

Instantly share code, notes, and snippets.

Marcus T llamasoft

Block or report user

Report or block llamasoft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
llamasoft /
Last active Sep 27, 2019
HVAC URL Escape Demo
import hvac
import pprint
import six.moves.urllib.parse as urllib
client = hvac.Client("http://localhost:8200")
def quote_path(path):
"""Returns a string that's safe to use as a path."""
# Yes, safe = "/" is the default, but I pass it here just to make it obvious.
import hvac
import pprint
client = hvac.Client("http://localhost:8200")
# Make sure the test user doesn't exist
# Create the user with a set of policies and metadata
llamasoft /
Created Apr 2, 2018
HaveIBeenPwned Found Plaintext Frequency
# Use bytewise locale, this provides performance benefits and prevents possible UTF8 warnings
export LC_ALL="C"
# `plains.txt` is the "found" list from
# `HIBP_hashcount.txt` is the Version 2 *ordered by hash* list from
# This perl snippet regenerates the SHA1 hash from the plaintext.
llamasoft / firmware_bug.gcode
Last active Apr 29, 2018
G-code or firmware bug on Wanhao Duplicator i3 Plus
View firmware_bug.gcode
; NOTE: hotend must be preheated otherwise extruder retract is ignored!
; Monoprice Maker Select Plus/Wanhao Duplicator i3 Plus
; =========================================================
; An extruder retract in relative positioning causes
; the X axis to no longer be able to home.
; Disabling the motors fixes the bug.
M117 Homing and moving to known position
llamasoft / holder.scad
Last active Aug 2, 2017
Film Canister Holder
View holder.scad
inches = 25.4;
module HexPack(rows, columns, spacing) {
// Assuming the circles are hexagonally packed,
// this is how far their center points are from each other.
// We can find the y spacing of the center points using the Pythagorean theorem because
// the center points between three adjacent circles will form an equilateral triangle.
function pythag(side, hypot) = sqrt(pow(hypot, 2) - pow(side, 2));
hex_x_spacing = spacing;

Keybase proof

I hereby claim:

  • I am llamasoft on github.
  • I am llamasoft ( on keybase.
  • I have a public key ASCjasuNkOapoGGjEQ0f6CsGhn5hJcXGqW8i100XUUn_pwo

To claim this, I am signing this object:

llamasoft /
Created Dec 6, 2016
Princeton WordNet Parser Short Example
while (my $line = <>) {
# If no 8-digit byte offset is present, skip this line
if ( $line !~ /^[0-9]{8}\s/ ) { next; }
my @tokens = split(/ /, $line);
shift(@tokens); # Byte offset
shift(@tokens); # File number
llamasoft /
Created Dec 6, 2016
Princeton WordNet Database Parser Example
use strict;
use warnings;
# Parses a synonym set line from a data.* file into a Synset hash
sub parse_synset($) {
my $line = shift(@_);
You can’t perform that action at this time.