Skip to content

Instantly share code, notes, and snippets.

:octocat:

nils måsén piksel

:octocat:
Block or report user

Report or block piksel

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
@piksel
piksel / _readme.md
Created Aug 1, 2019 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python
View _readme.md

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@piksel
piksel / Program.cs
Last active Dec 24, 2018
Try() and Attempt() Example
View Program.cs
using System;
namespace Piksel.TryAttemptExample
{
using static Piksel.Helpers.StaticFunctions;
static class Program
{
static int Main(string[] args)
{
@piksel
piksel / Program.cs
Created Sep 16, 2018
Reproduction results for SharpZipLib Issue #270
View Program.cs
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace npoi_test
{
class Program
View SharpZipLib-dependants.md
View gist:f375c33ff8cedcedafc022dcc7472ba2
nils @ piksel-nox ~
✔ ➡ curl -s https://pub.p1k.se/public.key | sudo apt-key add -
OK
nils @ piksel-nox ~
✔ ➡ sudo add-apt-repository https://pub.p1k.se/ubuntu
nils @ piksel-nox ~
✔ ➡ sudo apt install i-nex
...
@piksel
piksel / Program.cs
Created Jul 18, 2018
SharpZipLib v1.0.0-rc1 Jar File Test
View Program.cs
using System;
using ICSharpCode.SharpZipLib.Zip;
namespace JarZipTest
{
class Program
{
static void Main(string[] args)
{
var outDir = "out";
@piksel
piksel / Program.cs
Created Jul 18, 2018
SharpZipLib v1.0.0-rc1 Chinese Filename Test
View Program.cs
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
namespace chinese_test
{
class Program
{
static void Main(string[] args)
{
View sharpzip-v0.86-v1.0-changes.txt
cbd05248c25de00bd6437d6217b91890af560496 Enable Nuget package generation as well as Xml doc gen
321f52d3e0ad175faa4d7b0569b977e3d6d36afc Zip: Move tests to separate files
bd11347b3318c1a0bc905920c8e42f1040c56ef0 Disable PasswordCheckingWithDateInExtraData test
50fba7c5dcd36da773aca6559f61aa8d3075f917 Disable ReadingOfLockedDataFiles test
62764df675c0817cfda19327acca64d33b342d30 Remove test playlists. Please, please use the IgnoreAttribute if you want to temporarily disable a test.
dd912cd6ee65c738ee0f3035f2551f77b41ef592 Fix Replacement test
c1de396aea96b3444a437577c48e40db35dc44d1 Fix UnicodeText test
27c76d5da7c8cfe919079e376e965eb61010eb53 Update to latest nuget packages after 15.3 / Core 2.0 Launch
2ea330b92d4f91295611f0c61047e7cedb8d2b83 Apply http://www.alteridem.net/2017/05/04/test-net-core-nunit-vs2017/ NUnit3TestAdapter to version 3.8.0-alpha1
e52436bbf7141c0835dd5a44e47e39b403199a3c Update to latest preview2 of .NET Core 2.0.0
@piksel
piksel / Directory.Build.props
Created Jul 13, 2018
Allow for multiple .csproj being built from the same directory
View Directory.Build.props
<!--
This will cause project.assets.json to be written to $(ProjectDir)\obj\ProjectFileWithNoExtension\project.assets.json.
-->
<Project>
<PropertyGroup>
<MSBuildProjectExtensionsPath>obj\$(MSBuildProjectName)\</MSBuildProjectExtensionsPath>
</PropertyGroup>
</Project>
@piksel
piksel / helloworld.cs
Created Jun 24, 2018
Output from ProtobufGeneratorGRPC
View helloworld.cs
// Generated by ProtobufGenerator 2018-06-24 18:32:00
#region Using statments
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
using System;
using System.Threading;
You can’t perform that action at this time.