Skip to content

Instantly share code, notes, and snippets.

REM Set Printer IP ---------
SET PRINTERIP="192.168.0.47"
REM ------------------------
ECHO OFF
CLS
IF [%1] == [] GOTO :no_file
FOR /F tokens^=4^ delims^=^" %%a in ('C:\windows\System32\curl.exe -s -X ^"POST^" http://%PRINTERIP%:8080/api/v1/connect') DO (SET TOKEN=%%a)
ECHO Token is: %TOKEN%
@zvalentine22
zvalentine22 / jqueryUploadGcode.html
Created October 10, 2020 02:59
snapmaker2.0 jquery upload without luban
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<style>
#fileselector, #upload {display: none;}
</style>
<form id="fileform">
<input type="button" id="connect" value="Connect">
@zvalentine22
zvalentine22 / upload_script.py
Created September 14, 2020 06:31
snapmaker2.0 upload without luban
import requests
import argparse
import os.path
import sys
debug = False
# if debug = True, ignore command line arguments and use the following:
ip = "192.168.0.47"
port = 8080