Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
<?php | |
/* | |
Plugin Name: R Debug | |
Description: Set of dump helpers for debug. | |
Author: Andrey "Rarst" Savchenko | |
Author URI: https://www.rarst.net/ | |
License: MIT | |
*/ |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
#!/bin/bash | |
# Runs the specified command (provided by the first argument) in all tmux panes | |
# in every window. If an application is currently running in a given pane | |
# (e.g., vim), it is suspended and then resumed so the command can be run. | |
all-panes() | |
{ | |
all-panes-bg_ "$1" & | |
} |
FROM golang:1.4 | |
COPY entrypoint.sh /entrypoint.sh | |
COPY main.go main.go | |
RUN go build -o main main.go | |
RUN chmod +x /entrypoint.sh | |
EXPOSE 8080 | |
ENTRYPOINT ["/entrypoint.sh"] | |
CMD ["./main"] |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
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.
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.
//import.meta.url | |
function getPath(url) { | |
let result = new URL(import.meta.url) | |
let pathname = result.pathname | |
let pathArray = pathname.split('/') | |
let basename = pathArray.pop() | |
let dirname = pathArray.join('/') | |
return { pathname, dirname,basename} | |
} |