Skip to content

Instantly share code, notes, and snippets.

View wohali's full-sized avatar
πŸ’­
I may be slow to respond.

Joan Touzet wohali

πŸ’­
I may be slow to respond.
View GitHub Profile
@wohali
wohali / metar.py
Last active April 23, 2017 20:00
for geekmoon METAR/TAF support
# http://avwx.rest/documentation has all the details
import requests
STATION='CYYZ'
SPEECH=True
r = requests.get("http://avwx.rest/api/metar/" + STATION + "?options=info,speech")
metar = r.json()
if SPEECH:
def _size_format(bytes, precision=2):
"""Returns a humanized string for a given amount of bytes"""
bytes = int(bytes)
if bytes < 1000:
return "{} bytes".format(bytes)
log = math.floor(math.log(bytes, 1000))
return "{:.{}f} {}".format(
bytes / math.pow(1000, log),
precision,
['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][int(log)]
Verifying I am +wohali on my passcard. https://onename.com/wohali
@wohali
wohali / howto.md
Last active June 25, 2023 04:01
How to get the data off of a Micro PDP-11

I assume you have an RX50 dual-floppy on your machine, and that you're trying to get the data off of e.g. an ST506 MFM HDD that's in the machine.

  1. Get a PC or laptop setup with serial to the box. You want to connect to the Console port (the top left one), set the rotary switch to 9600 bps (setting 14) as 19200 is too unstable. You'll also need a null modem crossover to swap RX/TX and RTS/CTS. I recommend using Kermit on your machine to speak to the PDP, as you'll need it for file copies anyway. You can create the following script as e.g. pdp.ck and execute $ kermit pdp.ck to automatially connect to the machine with the correct parameters:

     set line /dev/ttyR0             ; replace with the correct device for you
                                     ; this is port 0 on a RocketCom 8-port serial card
     set speed 9600                  ; rotary switch setting 14 on the micro PDP-11
     set parity even                 ;
     set stop-bits 1                 ;
    

set session-log binar

@wohali
wohali / dance.py
Last active August 29, 2015 14:01
def dance(_glob, sock, params, channel, sender):
sock.say(channel if channel else sender, "\x01ACTION dances :D|-<\x01")
sock.say(channel if channel else sender, "\x01ACTION dances :D\-<\x01")
sock.say(channel if channel else sender, "\x01ACTION dances :D/-<\x01")
sock.say(channel if channel else sender, "\x01ACTION dances :D>-<\x01")
_glob.commands.append( {
'command': 'dance',
'function': dance,
'karma': 3,
### Keybase proof
I hereby claim:
* I am wohali on github.
* I am wohali (https://keybase.io/wohali) on keybase.
* I have a public key whose fingerprint is 8226 3205 9321 9191 DB21 0661 08D4 E0A1 2B5D 696B
To claim this, I am signing this object:
@wohali
wohali / simple-view-no-null.erl
Created February 24, 2014 06:39
Simple Erlang views for CouchDB
%% this is an exact match for the original JS function
fun({Doc}) ->
case proplists:is_defined(<<"diet">>, Doc) of
true ->
Emit(proplists:get_value(<<"diet">>, Doc), 1);
false ->
ok
end
end.
SONOTHERM 1000
SONOTHERM 1000
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PRIMARY OPTIONS INDEX β”‚
β”‚ QUALITY ASSURANCE AND TRAINING β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1 PREPARE
2 THERAPY