Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
SmartTub Authentication Diagnostic Script
This script helps diagnose authentication issues with the SmartTub API.
It will attempt to authenticate and report the exact error response
(without exposing your credentials).
Usage:
python diagnose_auth.py
mdz@MacBook-Air:[/tmp] ls foo
__init__.py __pycache__ bar.py
mdz@MacBook-Air:[/tmp] cat foo/__init__.py
print("hello")
zero@MacBook-Air:[/tmp] cat foo/bar.py
print("world")
mdz@MacBook-Air:[/tmp] python
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
resource "kubernetes_stateful_set" "eth-parity-ropsten" {
metadata {
name = "eth-parity-ropsten"
labels {
app = "eth-parity-ropsten"
}
}
spec {
replicas = 0
selector {
@mdz
mdz / keybase.md
Last active February 26, 2019 19:53

Keybase proof

I hereby claim:

  • I am mdz on github.
  • I am mdz (https://keybase.io/mdz) on keybase.
  • I have a public key whose fingerprint is 9DDF 626B 786C 71F0 8065 2E0B E336 5DC9 A108 0A08

To claim this, I am signing this object:

COLUMNS=1000 dpkg -l | grep '^ii' | awk ' {print $2}' | xargs apt-cache show
#!/usr/bin/python
# [email protected] 2012-11-13
import httplib
import ssl
import socket
import sys
class HTTPSConnectionWithSSLVersion(httplib.HTTPSConnection):
var PagerDuty = require('pagerduty');
var fs = require('fs');
var apikeys = JSON.parse(fs.readFileSync('Config/apikeys.json'));
var pager = new PagerDuty({serviceKey: apikeys['pagerduty']});
pager.create({
description: process.argv[2], // required
details: { },
callback: function(err, response) {
The "sys" module is now called "util". It should have a similar interface.
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '../../Common/node/lutil.js'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
Warning: multi_json is using default ok_json engine. Suggested action: require and load an appropriate JSON library.
15 Feb 19:36:15 - info: 127.0.0.1:53136 - GET /
15 Feb 19:36:15 - info: 127.0.0.1:53136 - GET /common/css/reset.css
15 Feb 19:36:15 - info: 127.0.0.1:53137 - GET /common/prettify/prettify.css
15 Feb 19:36:15 - info: 127.0.0.1:53139 - GET /common/js/compiled_templates.js
15 Feb 19:36:15 - info: 127.0.0.1:53138 - GET /common/js/less-1.1.5.min.js
15 Feb 19:36:15 - info: 127.0.0.1:53140 - GET /common/js/dust-core-0.3.0.min.js
15 Feb 19:36:15 - info: 127.0.0.1:53138 - GET /js/jquery.simplemodal.js
15 Feb 19:36:15 - info: 127.0.0.1:53142 - GET /common/js/moment.min.js
15 Feb 19:36:15 - info: 127.0.0.1:53136 - GET /common/js/generators.js
diff --git a/slya-proxy.js b/slya-proxy.js
index 57d5c39..0df2ca0 100644
--- a/slya-proxy.js
+++ b/slya-proxy.js
@@ -109,6 +109,9 @@ function setupIptables(portMap) {
function TCPProxy(port, destPort, destHost) {
return net.createServer(function (inbound) {
+ // suppress data events until we're ready
+ inbound.pause();