Skip to content

Instantly share code, notes, and snippets.

View jondkelley's full-sized avatar
:octocat:

Jonathan D Kelley jondkelley

:octocat:
View GitHub Profile
@jondkelley
jondkelley / __INSTALL_MINIKUBE.txt
Last active February 14, 2024 21:59
Flink on k8s Issue
kubectl apply -f flink-configuration-configmap.yaml
kubectl apply -f jobmanager-svc.yaml
kubectl apply -f jobmanager-session-deployment.yaml -f task-manager-session-deployment.yaml
@jondkelley
jondkelley / netstat without netstat.txt
Created May 10, 2022 22:25
netstat without netstat
awk 'function hextodec(str,ret,n,i,k,c){
ret = 0
n = length(str)
for (i = 1; i <= n; i++) {
c = tolower(substr(str, i, 1))
k = index("123456789abcdef", c)
ret = ret * 16 + k
}
return ret
}
@jondkelley
jondkelley / busy_box_non_root.yaml
Created April 7, 2022 14:16
busy box non root
# 1) Deploy the pod
#
# kubectl create -f busybox-non-root.yaml
#
# 2) Access the shell
#
# kubectl exec -ti busybox-1000 -- sh
#
# 3) from the shell run:
#
@jondkelley
jondkelley / gist:d47e3e5c238ad9864483f33ad1ad9428
Created June 17, 2021 15:37 — forked from methane/gist:2185380
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker

Macbook Pro 2015 Python 3.7

Framework Server Req/s Max latency +/- Stdev
@jondkelley
jondkelley / cachepy_example.py
Last active December 15, 2020 20:25
Caching from serialized file example
# pip3 install cachepy
# https://github.com/scidam/cachepy
import time # used to simulate heavy CPU penalty
from cachepy import FileCache
from os.path import expanduser
from os import environ
import warnings
@jondkelley
jondkelley / delete_dicts_by_keyname_rercusively.py
Last active October 24, 2021 21:36
Python Dictionary Stuff from Stackoverflow
#The version that modifies in-place (very much like Ned Batchelders solution):
# https://stackoverflow.com/questions/3405715/elegant-way-to-remove-fields-from-nested-dictionaries
from collections import MutableMapping
from contextlib import suppress
def delete_keys_from_dict(dictionary, keys):
for key in keys:
with suppress(KeyError):
del dictionary[key]
@jondkelley
jondkelley / logdna.py
Last active December 2, 2020 16:14
LogDNA Ansible Execution Runner Callback Plugin
# -*- coding: utf-8 -*-
# (c) 2020, Jonathan Kelley <jonathan.kelley@logdna.com>
# This file belongs as part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,

Keybase proof

I hereby claim:

  • I am jondkelley on github.
  • I am jonklogdna (https://keybase.io/jonklogdna) on keybase.
  • I have a public key ASDLdfte9xqZbNeMjtKiYbb16GpwIhyHPkQchf5d_71muAo

To claim this, I am signing this object:

var logdna_ingestion_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var http = require("http");
var Logger = require('logdna');
var options = {
hostname: 'myHostname',
app: 'testJavascript',
env: 'dev'
};