Skip to content

Instantly share code, notes, and snippets.

View rjocoleman's full-sized avatar

Robert Coleman rjocoleman

  • Christchurch, New Zealand
View GitHub Profile
FROM ruby:2.3-alpine
RUN apk add --update \
build-base \
git \
libxml2-dev \
libxslt-dev \
tzdata \
rm -rf /var/cache/apk/*; \
gem update --system;
^xa^cfa,50^fo100,100^fdHello World^fs^xz
require 'net/http'
zpl = '^xa^cfa,50^fo100,100^fdHello World^fs^xz'
# adjust print density (8dpmm), label width (4 inches), label height (6 inches), and label index (0) as necessary
uri = URI 'http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/'
http = Net::HTTP.new uri.host, uri.port
request = Net::HTTP::Post.new uri.request_uri
request.body = zpl
@rjocoleman
rjocoleman / courierpost-270.zpi
Last active August 28, 2017 19:56
CourierPost logo in ZPL ASCII format
^XA
^FO50,50^GFA,12223,12223,17,,:::::T0KF8,R01MFC,R0OF8,Q07PF,P03QFE,P0SF8,O03SFE,O0UF8,N03UFC,N07VF,M01WF8,M03WFE,M07XF,L01IF07FEN0JF8,L03FFC03FEO0IFE,L07FF801FFO03IF,L0IF800FFO01IF8,K01IFI07F8O0IFC,K03IFI07F8O07FFE,K07IFI03FCO07IF,K0JFI01FCO03IF8,J01JFI01FEO01IF8,J01JFJ0FFO01IFC,J03JFJ07F8N01IFE,J07JFJ03FCO0JF,J0KFJ03FFO0JF8,J0KFJ01MFCI0JF8,I01KFK0MFEI0JFC,I03KFK0MFEI0JFC,I03KFK07LFEI0JFE,I07KFK03LFEI0KF,:I0LFK01LFEI0KF8,I0LFL0LFEI0KF8,001LFL07KFEI0KFC,:003LFL03KFEI0KFE,003LFL01KFEI0KFE,007LFL01KFEI0KFE,007LFM0KFEI0LF,007LFI04I07JFEI0LF,00MFI04I07JFEI0LF,00MFI06I03JFEI0LF8,00MFI07I01JFEI0LF8,01MFI07J0JFEI0LF8,01MFI078I0JFEI0LFC,01MFI07CI07IFEI0LFC,01MFI07CI03IFEI0LFC,01MFI07EI03IFEI0LFC,03MFI07FI01IFEI0LFC,03MFI07F8I0IFEI0LFE,:03MFI07FCI07FFEI0LFE,03MFI07FEI03FFEI0LFE,03MFI07FEI01FFEI0LFE,03MFI07FFI01FFEI0LFE,03MFI07FF8001FFEI0LFE,03MFI07FF8I0FFEI0LFE,07MFI07FFCI0FFEI0LFE,::03MFI07FF8I0FFEI0LFE,03MFI07FFJ0FFEI0LFE,03MFI07FFI01FFEI0LFE,03MFI0FFEI01FFEI0LFE,03MFI0FFCI03FFEI0LFE,03MFI0FF8I07FFEI0LFE,03MF001F
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
Disable-UAC
Disable-InternetExplorerESC
Update-ExecutionPolicy Unrestricted
Set-Service Audiosrv -startuptype automatic
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
{
"AWSTemplateFormatVersion": "2010-09-09",
"Conditions": {
"BlankAmi": { "Fn::Equals": [ { "Ref": "Ami" }, "" ] },
"BlankCertificate": { "Fn::Equals": [ { "Ref": "Certificate" }, "" ] },
"BlankKey": { "Fn::Equals": [ { "Ref": "Key" }, "" ] },
"BlankRegistryHost": { "Fn::Equals": [ { "Ref": "RegistryHost" }, "" ] },
"Development": { "Fn::Equals": [ { "Ref": "Development" }, "Yes" ] }
},
"Mappings": {
var replacements = {
"\x1e": "<RS>",
"\x1d": "<GS>",
"\x04": "<EOT>"
}
for (var replacement in replacements) {
filtered = decodeResults[0].content.replace(new RegExp(replacement, "g"), array[replacement]);
}
function delay(ms) {
ms += new Date().getTime();
while (new Date() < ms){}
}
$ sudo cat /tmp/flynn-host-logs/flynn-etcd-cb5ee45aa6fd4c90ad522d883ba11fab/flynn-etcd-cb5ee45aa6fd4c90ad522d883ba11fab.log
sudo: unable to resolve host ip-10-23-1-12
{"s":3,"t":1425007817176,"m":"t=2015-02-27T03:30:17+0000 lvl=info msg=\"registering RPC server\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"getting stdout pipe\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"getting stderr pipe\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"waiting to be resumed\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"starting RPC server\" app=containerinit fn=runRPCServer\n"}
{"s":3,"t":1425007817180,"m":"t=2015-02-27T03:30:17+0000 lvl=info msg=resuming app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"setting up the container\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"starting the command\" app=containerini
$ sudo cat /tmp/flynn-host-logs/flynn-flannel-282282faa8e44f518eec0510fce0fad8/flynn-flannel-282282faa8e44f518eec0510fce0fad8.log
sudo: unable to resolve host ip-10-23-1-12
{"s":3,"t":1425007817537,"m":"t=2015-02-27T03:30:17+0000 lvl=info msg=\"registering RPC server\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"getting stdout pipe\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"getting stderr pipe\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"waiting to be resumed\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"starting RPC server\" app=containerinit fn=runRPCServer\n"}
{"s":3,"t":1425007817538,"m":"t=2015-02-27T03:30:17+0000 lvl=info msg=resuming app=containerinit fn=containerInitApp\n"}
{"s":3,"t":1425007817538,"m":"t=2015-02-27T03:30:17+0000 lvl=info msg=\"setting up the container\" app=containerinit fn=containerInitApp\nt=2015-02-27T03:30:17+0000 lvl=info msg=\"s