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
### 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 / 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,
Verifying I am +wohali on my passcard. https://onename.com/wohali
SONOTHERM 1000
SONOTHERM 1000
┌──────────────────────────────────────┐
│ PRIMARY OPTIONS INDEX │
│ QUALITY ASSURANCE AND TRAINING │
└──────────────────────────────────────┘
1 PREPARE
2 THERAPY
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)]
@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:

Keybase proof

I hereby claim:

  • I am wohali on github.
  • I am wohali (https://keybase.io/wohali) on keybase.
  • I have a public key ASAkSYRbJrWZ9idg-PaOPWzyELLINJFtu63PiUjG4pxVMgo

To claim this, I am signing this object:

@wohali
wohali / makeit.py
Created December 13, 2017 06:49
repro support script for apache/couchdb#745
#!/usr/bin/python3
"""
Puts random docs in localhost:5984/foo.
Usage:
makeit.py <number_of_docs> [--size=<size>]
makeit.py -h | --help
makeit.py --version
Options:
@wohali
wohali / json-pprint.py
Last active January 26, 2018 04:34
json pretty printer in python
#!/usr/bin/env python
# (C) 2017 wohali
#
# I don't give a fuck about how this will be used. Everything will be allowed, including changing the name, citing wrongly, claiming ownership and destroying the computer. You are allowed to do anything with this as long as:
#
# 0. I don't give a fuck.
# 1. You agree that you don't give a fuck.
# 2. You agree that your use of this will have nothing to fuck with me now and in the future.
# 3. You don't fuck me legally/illegally.
#
@wohali
wohali / script.sh
Created January 26, 2018 04:29
save this as /etc/dhcp/dhclient-enter-hooks.d/no_default_route and chmod +x it
#!/bin/sh
# prevent dhclient-script from setting any default route
# except for ens6, which is our public interface
INTERFACE_DEFAULT_ROUTE="ens6"
DEBUG_FILE="/tmp/dhclient-nodefroute.debug"
echo "Interface ${interface} entered DHCP because of $reason." >> $DEBUG_FILE