Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
#!/bin/sh | |
## Node.js for Raspberry Pi Packaging Script | |
## ========================================= | |
## Execute this script from within node.js git repo | |
## Use like this: | |
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh | |
if [ -z $VERSION ]; then | |
echo "set the VERSION first" | |
exit 1 |
#!/usr/bin/env python | |
import datetime | |
import json | |
import gtk | |
import gobject | |
# TODO: fix gi.repository.WebKit to have a working webview.get_dom_document | |
import webkit |
const GLib = imports.gi.GLib; | |
const Lang = imports.lang; | |
const System = imports.system; | |
let _breakpoints = 0; | |
function _getCurrentStack() { | |
try { | |
throw new Error(); | |
} catch (e) { |
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological
I wanted to easily make HTTP requests (both GET & POST) with a simple interface that returns promises.
The popular request
& request-promises
package are good, but I wanted to figure out how to do it w/out using external dependencies.
The key features are:
from zipfile import ZipFile | |
from struct import Struct | |
class Deserializer: | |
u16 = Struct('<H') | |
u32 = Struct('<I') | |
def __init__(self, stream): | |
self.stream = stream |
Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/
Source: http://nategood.com/client-side-certificate-authentication-in-ngi
This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.
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.
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |