-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtodo
329 lines (270 loc) · 12.5 KB
/
todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
write up the getty
debian agetty fix
hardware stuff
print some perlin noise
moon: find an alternative to usno.navy.mil
try https://github.com/spacerest/moon
write up getty & stty for 110 baud "true serial" not the spoiled-simple usb
write up the serial cables & getty
StarTech (Prolific PL2303): should work down to 110
ispeed 110 ospeed 110 icrnl iuclc -iutf8 istrip ignpar -parenb cs7 cr3 nl1
FTDI: down to 300 baud only
TTL level shifter: N/A
Record some teletype sounds, add to ttyemu
print some Wolfram automata
weather (e.g. reformat https://github.com/chubin/wttr.in JSON)
moon pix rotate to local orientation ("parallactic angle")
https://astronomy.stackexchange.com/questions/26200/implementation-of-formulae-for-meeus-for-the-moon/26215#26215
tan(q) = sin(H) / (tan(phi).cos(delta) - sin(delta).cos(H))
where: H = the hour angle (??)
delta = declination of the moon (???)
phi = geographic latitude
https://astronomy.stackexchange.com/questions/29672/the-movement-of-the-moon/29691#29691
https://github.com/mourner/suncalc/blob/master/suncalc.js#L196
moon/emoji rewrite in flask/celery and relocate to render.com?
sea ice index pix
ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/images/2019/09_Sep/
ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/south/daily/geotiff/2019/09_Sep/S_20190924_concentration_v3.0.tif
image2.py --width 68 S_20190924_concentration_v3.0.tif --chars1 "'.:" --chars2 "-ICE" --gamma 1.5
(cite: Fetterer, F., K. Knowles, W. N. Meier, M. Savoie, and A. K. Windnagel. 2017, updated daily. Sea Ice Index, Version 3. [Indicate subset used]. Boulder, Colorado USA. NSIDC: National Snow and Ice Data Center. doi: https://doi.org/10.7265/N5K072F8. [Date Accessed].)
cron job for sending moon pix to autostart itty (autostart.itty@gmail.com or direct via the 'mailer')
tile 'pattern sequences --part fade2 --svg --width 17.5'
mandelbrot set using the hammersley characters ('.-o) and overstrike
mandelbrot set in 8080 BASIC V1.0 (4kbasic)?
- not really possible since it doesn't have string printing, just numerics
- could fake something with only numbers...
twitchbot:
input (from file? from stdin?) to make it an interactive client
lasercut braille tile (inverted; braille overlay)
Brickyard workshop: ASCII-Art
bring your own photos (or mail them in advance)
process on the laptop (or the design-team's PCs)
print to the Teletype (hands-on)
Brickyard workshop: Plotter Art
work with old-fashioned Logo on tty https://linuxgazette.net/166/silva.html https://linuxgazette.net/167/silva.html
https://dspace.mit.edu/handle/1721.1/6226#files-area
directly connected to a pen-plotter
ex-vi "open mode"
night-mode teletype
test suite
twitchbot:
!task -> report contents of ~/.project
firmware to slash->uppercase
tour of the CDC6500, and Fortran
tour of the LambdaMoo
tour of the PRIMOS emulators
tour of the VAX
pdp7-unix0 for 50th anniv
https://github.com/DoctorWkt/pdp7-unix/blob/master/README.md
sdf.org shell
compare menu-driven & command-driven
cloud shell (goog or azure)
google search
clipboard
news e.g. headlines from reuters or somewhere
twitter background subscribe -> to print queue
sms send
sms receive -> to print queue
slack bot
reddit reader
weather report app
finish print services:
lpadmin -E -p tempfile -v 2file:/tmp/tempfile.prn -m drv:///tty.drv/tty.ppd
only if mesg()
backend/filter into
Go for "bold"
custom backend
lpadmin -p teletype3 -E -v tty:/dev/ttyACM0 -m drv:///tty.drv/tty.ppd
- report status ("other", "busy (interactve)")
- test with: lpstat -v
"print from Word" doesn't work yet
it sends a postscript doc to the server
it sends a pdf that gets rasterized by ghostscript and whatevs, fails
should send plaintext
or at least, catch pdf and get it into plaintext
finish mime.types
/usr/share/cups/mime/mime.convs
/usr/share/cups/mime/mime.types
unblock the print queue depending on mesg()
maybe to block and unblock, use ipptool
#!/usr/bin/env ipptool -tv ipp://localhost/printers/your_queue
{
OPERATION Resume-Printer
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
}
potentially, the cache image would be wiped out (although I don't yet understand when the cache clears)
ln -s the cachefile instead of installing it there
then recreate every time the filter backend is run
-------------------------------------------------------------------------------------------------------
. CUPS icon
PPD file:
APPrinterIconPath (MacOS extension)
*APPrinterIconPath: "/Library/Printers/vendor/filename.icns"
This keyword defines the location of a printer icon file to use when displaying the printer. The file must be in the Apple icon format.
- doesn't work in rpi cups (Apple extension)
ippfind
ipptool -tv ipp://upstairs.local:631/printers/teletype get-printer-attributes.test
Get-Printer-Attributes
printer-icons (uri) = http://upstairs.local:631/icons/teletype.png
(128x128 png, 8-bit sRGB)
/var/cache/cups/teletype.png
(just name it for the cups printer destination)
. python tape: termios set raw while it runs
# incoming spool... background... only when idle
# internet-visible url to post to spool...
. clear the screen
. twitch chatbot (use git@github.com:hughpyle/chat-samples.git)
- new base: pip install git+https://github.com/TwitchIO/TwitchIO.git
x look for "is the process 'bash' the login process" (i.e. the shell is on top)
then look for "idle > 1m"
then unblock the print queue.
. "automesg":
background job that does mesg() automatically so
don't print unless
"the login shell is foreground"
and "tty has been idle for a while"
w -> idletime
os.stat("/dev/ttyACM0"), or os.fstat(1) or 2) -> time of last input
w -> "foreground process"
os.tcgetpgrp(fd) -> pid for the foreground process
is it the login shell?
/proc/xxx/cmdline begins with "-"
with open("/proc/521/cmdline") as proc:
if proc.readline().startswith("-"):
is_login = bool(1)
use this to set
like "mesg"
tty is group-writeable
(so other people can send you messages)
mode = os.stat(1).st_mode
if not mode & stat.S_IWGRP:
os.chmod(1, mode | stat.S_IWGRP)
inotify so we see when the writeable flag changes
(or any attrib)
(no, just loop and sleep)
. twitchbot: !bell
x twitchbot: set the stream title to ~/.project when startup
. practice 'ed'
x automesg check os.isatty(fd) for stdin, stdout, stderr
(fails ENOTTY, let's just leave it working on stdout)
. automesg check atime/mtime/ctime
x automesg check S_IWOTH as well as GRP
- no need, we're just setting it
. good stuff here: http://tilde.club/~phooky/logging_wall.html
. talk about mesg, write, who -w, wall, (etc) (and finger)
. src/util-linux/term-utils
. twitchbot: other messages to stdout (with mesg checking)
. twitchbot:
await asyncio.ensure_future(wait_for_mesg())?
async def wait_for_mesg():
# Sleep until the tty is group-writable
while not (os.fstat(1).st_mode & stat.S_IWGRP):
asyncio.sleep(1)
. hardware lid off
. getty and login and /etc/issue
https://github.com/karelzak/util-linux/blob/master/term-utils/agetty.c
https://github.com/shadow-maint/shadow/blob/master/src/login.c
. make getty non-automatic
. dig into termios and stty, and anything we can move out of firmware
https://github.com/coreutils/coreutils/blob/master/src/stty.c
https://github.com/torvalds/linux/tree/master/drivers/tty
. www
. gopher
. coral; serial console
https://coral.withgoogle.com/tutorials/devboard/
http://0pointer.de/blog/projects/serial-console.html
. getty and ssh on the coral
. print some emoji: dog2 cat2 scorpion taco wind_blowing_face
hack a python ipp server instead of cups
https://github.com/h2g2bob/ipp-server
lp -d coral.local thing.txt => sends (1, b'document-format', 73): [b'application/pdf', b'application/octet-stream']
reject if wrong mime type
'document-format-supported':
[ 'application/vnd.hp-PCL',
'image/jpeg',
'application/PCLm',
'image/urf',
'application/octet-stream' ],
print with:
lp -d localhost -o raw=true testpage.txt
or
lpr -l -P localhost testpage.txt
(sends document-format: application/octet-stream, not text/plain)
. twitchbot:
!bell to stderr (without any mesg checking)
. fix 'ed' weirdness on the coral
(hacky workaround, anyway)
x gpt2:
chop sentences (>25 chars, up to ".")
x twitchbot: separate version for AWS/GPT2
. TOPS-10 BASIC
functions http://www.bitsavers.org/pdf/dec/pdp10/TOPS10_softwareNotebooks/vol06/DEC-10-LBLMA-A-D_BASIC_Conversational_Language_Manual_Mar74.pdf
page 5.1.6
. itty
FSK and ITA2 decoder with gnuradio
http://internet-tty.net:8000/ITTY
x TECO
http://www.bitsavers.org/pdf/dec/pdp10/TOPS10/1972_PDP-10_Users_Handbook/05_tecoReference.pdf
http://www.avanthar.com/healyzh/teco/TecoPocketGuide.html#NOVICE
http://almy.us/teco.html
. moon pix: https://svs.gsfc.nasa.gov/4442
image2.py [file] --width 40 --chars1 "'.<*" --chars2 "-O>"
or --chars1 "'.=" --chars2 "-<>MO0N"
files from https://svs.gsfc.nasa.gov/vis/a000000/a004400/a004442/frames/730x730_1x1_30p/ (hourly)
or 216x216 https://svs.gsfc.nasa.gov/vis/a000000/a004400/a004442/frames/216x216_1x1_30p
or https://api.usno.navy.mil/imagery/moon.png?date=9/23/2019&time=20:50 (much wider time coverage, 1024x1024)
current time, or a specified time (month, day, hour UTC) (ideally handle prior years too)
moon 09 22 00
label saying the time
label describing the phase (waxing gibbous, etc)
. print a series of moon pix ('moon -big 9/23/2019')
. lasercut tile
. punchtape input (fix the firmware flakiness first)
. mandelbrot set in c on the pdp-11 at lcm&l
. modify https://github.com/piratefsh/art1.js for overstrike
and reproduce 'jelly centers'
https://www.wright20.com/items/index/3000/104_1_art_design_september_2015_frederick_hammersley_jelly_centers_no_31__wright_auction.jpg
'busy lion to jelly center'
http://media.newmexicoculture.org/media_files/files/BUSY-LION-ON-JELLY-CENTERS-39.jpg
. pjw
. Wolfram cellular automata
rule NNN <table> <start> <lines>
- rules: https://en.wikipedia.org/wiki/Elementary_cellular_automaton
- start: random, solid, or a seed??
- table: render to ASCII by specifying 2- 4- 8- or 16-character table
(how choose overstrike??)
. try serial to GPIO pins via level shifter
Caution: 3v3, not 5v tolerant, but just power the SparkFun board at 3.3v (NOT 5v)
https://www.raspberrypi.org/documentation/usage/gpio/
rpi3/4 GPIO pins 14 and 15 use the “mini-uart” aka /dev/ttyS0
https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3-4/
https://pinout.xyz/pinout/uart#
https://elinux.org/RPi_Serial_Connection
ABC ==> AQ\$^
. kernel patches to implement Teletype-friendly termios
- add null-filled (or RUBOUT-filled) CRDLY / NLDLY (if OFILL)
cr delays per termio(7)
- XCASE output upper‐case characters preceded by \ and lowercase convert to upper
(not if UTF8)
(only if ICANON)
- XCASE input convert to lower‐case, except for characters preceded by \
(not if UTF8)
(only if icanon)
lcase handle common punctuation \! => | \' => ` \( => { \) => } \^ => ~
. shopt -u checkwinsize
. shopt -s nocaseglob
x use getty_ps getty, not agetty
https://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/getty-getty.html
http://www.mit.edu/afs.new/athena/system/rhlinux/redhat-6.2-docs/HOWTOS/other-formats/html/Text-Terminal-HOWTO-html/Text-Terminal-HOWTO-14.html
/etc/gettydefs:
<label># <initial_flags> # <final_flags> #<login_prompt>#<next_label>
# Serial console 9600, 8, N, 1, CTS/RTS flow control
CON110# B110 CS8 -PARENB -ISTRIP CRTSCTS HUPCL # B110 SANE CS8 -PARENB -ISTRIP CRTSCTS HUPCL #@S @L login: #CON110
(no, couldn't really get this working, so stick with agetty despite its bugs)
x awsbot: gpt2 talk on "?" and random timer
x zes and word-wrap (put wrap logic in 'utf?' or put utf8 logic in firmware?)
. dig into termios and stty, and anything we can move out of firmware
. test tape reading: tread