- Connect printer, install printer drivers, and enable Printer Sharing.
- Open terminal, run:
dns-sd -Z _ipp._tcp
. You'll see a few lines of repeated text. Look for your printer's name, next to that record you will see aTXT
, copy everything afterTXT
into a notepad. - In that TXT line, you'll see a line like this:
"pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster"
Change that, to add,image/urf
. So it'll look like:"pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf"
- Now take that entire TXT line, and add it to this:
dns-sd -R "name_to_be advertised" _ipp._tcp.,_universal . 631 URF=none pdl=application/pdf,image/urf YOUR_TXT_STRING
- Run that line in the terminal, and Airprint should be enabled.
#!/usr/bin/env python3 | |
PRINTER = '/dev/usb/lp0' # the printer device | |
DOTS_MM = 8 # printer dots per mm, 8 == 203 dpi | |
WIDTH_MM = 100 # sticker width, mm | |
HEIGHT_MM = 35 # sticker height, mm | |
GAP_MM = 2 # sticker gap, mm | |
FONT = "0" # built-in vector font, scalable by X and Y |
--- | |
layout: null | |
--- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:media="http://www.rssboard.org/media-rss" version="2.0"> | |
<channel> | |
<title>Darknet Diaries</title> | |
<link>https://darknetdiaries.com/</link> | |
<language>en-us</language> | |
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" /> |
$ uname -r
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
In your command-line run the following commands:
brew doctor
brew update
There are two main modes to run the Let's Encrypt client (called Certbot
):
- Standalone: replaces the webserver to respond to ACME challenges
- Webroot: needs your webserver to serve challenges from a known folder.
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com
.
HTML is served from /var/www/mydomain
, and challenges are served from /var/www/letsencrypt
.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# copy-and-paste the output of this script into a shell, and rejoice. | |
files=Dir.glob('*.mp3').sort.join('|') | |
puts "ffmpeg -i \"concat:#{files}\" -acodec copy output.mp3" |