- send a G29 to run through the autotramming procedure
- grab a piece of copy paper and slide that under the preheated hotend
- send a G92 Z10, which tells the printer / to assume that the printhead is now actually 10mm above the bed’s surface
- move the Z axis down in increments of 0.1mm until the tip of the hotend just touches the surface of the paper
- send M114 to see how much length of the 10mm on Z you have used up to # get down this far
- enter that into the z probe offset from extruder as a negative value since the trigger point of the probe is actually # closer to the bed’s surface than the tip of your hotend
View twitter_dns_bl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Host file to block twitter | |
# Title: Twitter DNS block list | |
0.0.0.0 twitter.com | |
0.0.0.0 www.twitter.com | |
0.0.0.0 t.co | |
0.0.0.0 analytics.twitter.com | |
0.0.0.0 platform.twitter.com | |
0.0.0.0 pbs.twimg.com # Photo Blob Store |
View sample-nginx-hello
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: hello | |
services: | |
- name: hello | |
http_port: 80 | |
image: | |
registry_type: DOCKER_HUB | |
registry: nginxdemos | |
repository: hello | |
tag: latest |
View healthchecks.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
set -o pipefail | |
# Run a command and report status to https://healthchecks.io | |
usage() { | |
echo "Usage: $0 <healthchecks.io UUID> <command>" | |
exit 1 | |
} | |
trap usage EXIT |
View aws_ec2_describeInstanceTypes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Play with AWS EC2 describe_instance_types | |
""" | |
from boto3.session import Session | |
sess = Session() | |
ec2c = sess.client('ec2') | |
resp = ec2c.describe_instance_types() |
View print_function_args.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def print_args(): | |
'''Print the callers function name along with argument values''' | |
# TODO: print * and ** args | |
frame, _, _, name, _, _ = inspect.getouterframes(inspect.currentframe())[1] | |
args, _, _, values = inspect.getargvalues(frame) | |
print("%s: %s)" % (name, ["%s=%s" % (i, values[i]) for i in args])) |
View count_read_io.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Measure the bytes read by a command | |
# count_command_io <cmd> <args>* | |
# Credit to shodanex from https://stackoverflow.com/a/8853287 | |
if [ -z $@ ] ; then | |
echo "Usage: $0 <cmd> <args>*" | |
exit 1 | |
fi |
View 3dp_tramming.md
View s3_presigned_url.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Generate a presigned URL to download an S3 object | |
<cmd> bucket_name key_name [expiration_days]""" | |
import sys | |
import boto3 | |
from botocore.client import Config |
View clipboard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Watch the clipboard for URLs and open them in the browser (on Linux) | |
""" | |
import subprocess | |
import time | |
import pyperclip # Requires xclip to be apt installed |
View apt_pinning_priorities.md
References:
Overview
Priority values
From man page: man apt_preferences
NewerOlder