Skip to content

Instantly share code, notes, and snippets.

View Yardboy's full-sized avatar

Cayce Balara Yardboy

View GitHub Profile
@Yardboy
Yardboy / gist:511027972af259a44eb4f1e867eb67d6
Last active April 11, 2023 16:50
Create a custom post processing filament change script to workaround Creality latest Sonic Pad firmware

Intro

Creality's latest Sonic Pad update, v1.0.6.46.25, includes an internal M600 macro for a filament change, which will conflict with any custom M600 macro the user has included in their config. As such, the user is forced to remove their own M600 macro, if they have one, due to the conflict. Because the Creality macro is not accessible to the user, it cannot be tweaked. And, to make matters worse, it has a bug related to max extrusion distance, so you cannot successfully print a model with a filament change with this update installed.

The below workaround shows you how to go back to using your own M600 macro by renaming it, and how to create a modified Cura Filament Change post processing script to insert this new macro instead of M600.

UPDATE SONIC PAD CONFIGURATION

In your Sonic Pad printer.cfg, add your own M600 macro back in, but name it CUSTOM_FILAMENT_CHANGE:

if(creep.memory.transfering) {
if (creep.store[RESOURCE_ENERGY] == 0) {
creep.memory.transfering = false;
creep.say('🔄 harvest');
}
} else if(creep.store.getFreeCapacity() == 0) {
creep.memory.transfering = true;
creep.say('transfering');
} else {
[whatever]
remote: Compilation failed:
remote: events.js:174
remote: throw er; // Unhandled 'error' event
remote: ^
remote:
remote: Error: spawn bin/rails EACCES
remote: at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
remote: at onErrorNT (internal/child_process.js:415:16)
remote: at process._tickCallback (internal/process/next_tick.js:63:19)
remote: Emitted 'error' event at:
import $ from 'jquery'
import _ from 'lodash'
<% klasses = [] %>
<% Dir[Rails.root.join('app', 'javascript', 'pages', '*_page.js*')].each do |file| %>
<%
page = file.match(%r{.*/pages/(.*).js?}).captures.first
next if page == 'base_page'
klasses << page.classify
%>
FROM ruby:2.6.5
LABEL app-name="shards"
RUN apt-get update -qq && apt-get install -y \
nodejs \
curl \
vim
# Create and set the working directory
remote: +++ [[ ! -f /home/dokku/shards/DOKKU_PROCFILE ]]
remote: +++ procfile-util show --procfile /home/dokku/shards/DOKKU_PROCFILE --process-type web --default-port 3000
remote: ++ DOKKU_PROCFILE_START_CMD='puma -C config/puma.rb'
remote: ++ START_CMD='puma -C config/puma.rb'
remote: ++ echo 'puma -C config/puma.rb'
remote: + START_CMD='puma -C config/puma.rb'
remote: + [[ false == \f\a\l\s\e ]]
remote: ++ docker run --label=dokku -d -e PORT=3000 --env=DATABASE_URL=mysql2://mysql:54de2f4cf18ab5fd@dokku-mysql-shardsdb:3306/shardsdb --env=DOKKU_APP_TYPE=dockerfile --env=DOKKU_DOCKERFILE_PORTS=3000 --env=DOKKU_PROXY_PORT=80 --env=DOKKU_PROXY_PORT_MAP=http:3000:3000 --env=GIT_REV=9bf44d8ebd18fdc88ff391156a148cf6c23abce4 --env=RACK_ENV=production --env=RAILS_ENV=production --env=RAILS_SERVE_STATIC_FILES=true --env=REDIS_URL=redis://shardsrd:80738cf6c4eb5851551ed3f76ce287aa3821b15f490287f5e544841452e2acee@dokku-redis-shardsrd:6379 --env=SECRET_KEY_BASE=0448b7a2219f8630d06e76c969ac50542b92c84762dd966f91293145cb52b
[
{
"Id": "8ead9a7d1f98c687db122d40ea9a47113f1c8af646f601eb12c070a741c32ef9",
"Created": "2020-04-24T21:17:36.824396163Z",
"Path": "irb",
"Args": [],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
git : + export DOKKU_HOST_ROOT=/home/dokku
At line:1 char:1
+ git push dokku HEAD:master > deploy.log 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (+ export DOKKU_HOST_ROOT=/home/dokku:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
@Yardboy
Yardboy / acceptable_use
Created February 9, 2015 23:26
The ridiculous "acceptable use policy" I have to agree to in order to access my kids' grades through a school district website.
DUVAL COUNTY PUBLIC SCHOOLS (DCPS) INFORMATION SECURITY PROGRAM
SUBJECT: ACCEPTABLE USE POLICY (AUP) POLICY NUMBER: 8.71
PURPOSE/SCOPE: This establishes the School Board Policy for Acceptable Use of Information Resources and applies to all users of DCPS information resources. Individuals using information resources belonging to DCPS must act in a legal, ethical, responsible, and secure manner, with respect for the rights of others.
The primary purpose of the DCPS network is to assist in preparing students for success in life and work in the 21st century. Computer and/or Electronic networks provide the ability to share educational and research resources from around the world. These resources include but are not limited to, access to instructional/business applications, interactive collaboration between teachers, students and other users, document sharing, and communications of all forms with people from around the world.
Access to computers, computing systems and networks owned by the School Board is a pri
@Yardboy
Yardboy / gist:05bb7f5044d7db2bbf5a
Created August 27, 2014 18:51
Ruby any? and all? with an empty array as receiver.
2.0.0-p451 :001 > [].any? { |wtf| wtf.locked? }
=> false
2.0.0-p451 :002 > [].all? { |wtf| wtf.locked? }
=> true