Skip to content

Instantly share code, notes, and snippets.

@bholzer
bholzer / animation_config.py
Last active August 7, 2023 11:19
Blender rendering from the command line.
import sys
import bpy
import addon_utils
argv = sys.argv
argv = argv[argv.index("--") + 1:] # get all args after "--"
C = bpy.context
bpy.context.scene.cycles.device = 'GPU'
cycles_prefs = C.user_preferences.addons['cycles'].preferences
@bholzer
bholzer / fpv.md
Created February 5, 2023 02:35
Getting Started with FPV

Getting Started

To get flying, you'll need to get a few different systems together:

  1. Control link
  2. Video link
  3. The drone itself

Both your control and video links will need to be compatible with the systems on the drone, options can usually be selected during checkout.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Object iteration</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@bholzer
bholzer / set_params.sh
Created March 15, 2020 05:51
Fetch and set environment variables from AWS systems manager param store.
#!/bin/bash
params=$(aws ssm get-parameters-by-path --region $REGION --with-decryption --path "/path/to/variable" --recursive)
for param in $(echo $params | jq -r ".Parameters[] | @base64"); do
ORIG_IFS=$IFS
IFS="/"
full_name=$(echo $param | base64 --decode | jq -r ".Name")
read -ra name_components <<< "$full_name"
IFS=$ORIG_IFS
var_name=${name_components[-1]}
@bholzer
bholzer / out.rb
Created February 8, 2020 06:49
BulqScriptOutput
{:title=>"General Merchandise - General Merchandise, Bojeux - Orig. Retail $139", :price=>"$62", :manifest_link=>"https://www.bulq.com/pallet_manifests/csaa086314/general-merchandise-general-merchandise-bojeux.xlsx"}
{:title=>"General Merchandise - General Merchandise, As Seen On TV, Up & Up - Orig. Retail $291", :price=>"$91", :manifest_link=>"https://www.bulq.com/pallet_manifests/csaa086362/general-merchandise-general-merchandise-as-seen-on-tv-up-up.xlsx"}
{:title=>"General Merchandise - General Merchandise, Magnolia Home by Joanna Gaines, The Manhattan Toy Company - Orig. Retail $262", :price=>"$75", :manifest_link=>"https://www.bulq.com/pallet_manifests/csaa086353/general-merchandise-general-merchandise-magnolia-home-by-joanna-gaines-the-manhattan-toy-company.xlsx"}
{:title=>"General Merchandise - General Merchandise, Heyday, Kanex - Orig. Retail $504", :price=>"$128", :manifest_link=>"https://www.bulq.com/pallet_manifests/csaa086797/general-merchandise-general-merchandise-heyday-kanex.xlsx"}
{:title=>"Ge
module.worker_node.aws_autoscaling_policy.worker_node_scale_in: Modifying... [id=worker_node_scale_in]
2019/10/03 16:16:21 [TRACE] GetResourceInstance: aws_autoscaling_group.worker_nodes is a single instance
2019/10/03 16:16:21 [DEBUG] module.worker_node.aws_autoscaling_policy.worker_node_scale_in: applying the planned Update change
2019/10/03 16:16:21 [TRACE] GRPCProvider: ApplyResourceChange
2019-10-03T16:16:21.559-0500 [DEBUG] plugin.terraform-provider-aws_v2.31.0_x4: 2019/10/03 16:16:21 [DEBUG] AutoScaling PutScalingPolicy on Update: {
2019-10-03T16:16:21.560-0500 [DEBUG] plugin.terraform-provider-aws_v2.31.0_x4: AdjustmentType: "PercentChangeInCapacity",
2019-10-03T16:16:21.560-0500 [DEBUG] plugin.terraform-provider-aws_v2.31.0_x4: AutoScalingGroupName: "render_workers",
2019-10-03T16:16:21.560-0500 [DEBUG] plugin.terraform-provider-aws_v2.31.0_x4: Cooldown: 0,
2019-10-03T16:16:21.560-0500 [DEBUG] plugin.terraform-provider-aws_v2.31.0_x4: EstimatedInstanceWarmup: 0,
2019-10-03T16:16:21.560-0500 [
$( function() {
var width, height, canvas, ctx, points, target, animateHeader = true;
// Main
initHeader();
initAnimation();
addListeners();
function initHeader() {
@bholzer
bholzer / bucket_encrypter.rb
Last active May 2, 2018 22:19
Encrypt existing objects in S3 bucket.
#!/usr/bin/env ruby
#
# Script to encrypt the contents of an entire S3 bucket
#
# This works by copying each object in the bucket onto
# itself while modifying its server_side_encryption attribute
#
#
##############################################################
def response_for_auth_fail(auth_error: :invalid)
messages = {
invalid: "Some error",
inactive: "Some error"
locked: "Some error"
}
{ auth_error: auth_error, message: messages[:auth_error] }
end
@bholzer
bholzer / cloudbuild.yml
Last active January 2, 2018 21:20
Cloudbuild config for automating deployments to Kubernetes using Helm.
steps:
- name: 'gcr.io/cloud-builders/git'
# Determine if the commit that triggered this build includes a directive to destroy a previously created environment
# If so, write a file as a flag for conditional future steps, always return true to allow build to continue
entrypoint: '/bin/bash'
args:
- '-c'
- 'git log -n 1 --pretty=format:%s $COMMIT_SHA | grep -q "\[helm\-delete\]" && touch /workspace/helm_delete || true'
- name: 'gcr.io/cloud-builders/docker'